Stan developer here with a few technical changes to base.stan. If you would like more help with Stan, do not hesitate to ask on https://discourse.mc-stan.org/ . Lots of people there can help you, including some who are epidemiologists (which I am not).
fd27cc9: It is often (but not always) better in terms of effective sample size to utilize the scaling property of the exponential distribution (see the top line of https://en.wikipedia.org/wiki/Exponential_distribution#Related_distributions ) if you are going to put exponential priors on unknowns. So I created vector[M] y_raw; in the parameters block and vector[M] y = tau * y_raw; in the transformed parameters block, which allows me to use a unit-exponential prior on y_raw in the model block and induce less posterior dependence on tau.
f6e4079: I used subindexing to eliminate the inner loop in the likelihood, which won't change anything put how fast it is evaluated
78290f2: I declared convolution locally inside the for loops in transformed parameters and generated quantities. This is mostly cosmetic but allows you to not store something that is not of interest.
Stan developer here with a few technical changes to base.stan. If you would like more help with Stan, do not hesitate to ask on https://discourse.mc-stan.org/ . Lots of people there can help you, including some who are epidemiologists (which I am not).
vector[M] y_raw;
in the parameters block andvector[M] y = tau * y_raw;
in the transformed parameters block, which allows me to use a unit-exponential prior ony_raw
in the model block and induce less posterior dependence ontau
.convolution
locally inside thefor
loops in transformed parameters and generated quantities. This is mostly cosmetic but allows you to not store something that is not of interest.