hyunjimoon / hyunjimoon/DataInDM

Parameter indexing in function and gq block

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

1. which is better btw theta[2] vs alpha, beta? as function input argument?
2. could we vectorize in gq block w.o. extra td block as the solution below?
```
theta_tilde[1] = normal_rng(1, 0.5); //TODO U5
theta_tilde[3] = normal_rng(1, 0.5); //TODO U5
theta_tilde[2] = normal_rng(0.05, 0.05); //TODO U5
theta_tilde[4] = normal_rng(0.05, 0.05); //TODO U5
```
sol. suggested in [here](https://discourse.mc-stan.org/t/applying-vectorization-in-generated-quantities-section/13769/6?u=hyunji.moon)
```{stan}
transformed data {
int N = 10;
vector[N] ones_N = rep_vector(1, N);
}

generated quantities {
real yrep [N] = normal_rng(ones_N * 1, ones_N * 10);
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.