Conducting Simulation Studies in RStan


Are there any guidelines (articles, code or examples) as to how to conduct simulation studies using RStan? Is simulating the data in R then passing it to Stan the best way to do this?


There is not universal convention for how best to simulate data, but I prefer to simulate within Stan itself to keep everything as consistent (and transferable to other environments) as possible. Even then there are two ways to simulated with Stan – simulating in the transformed data block and simulating in the generated quantities block. The case study has many examples using the generated quantities approach.

1 Like

Thanks Michael!