I was running some simulations in which I needed a separate parameter estimate for each run of 1000 simulations. So I was basically running a for loop in R, and then running rstan::sampling for each of the 1000 simulations with separate data inputs for each. In order to improve the efficiency of my code, I opted to change the stan model to a vectorized approach, and am feeding in a vector of data inputs. My question is, are the posterior distributions in the vectorized approach independent of one another (from data input to the next).
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Assign priors for parameters in a matrix | 3 | 852 | June 11, 2022 | |
Vectorized != loop | 12 | 960 | December 29, 2020 | |
Is there a way to vectorize my code that contains a custom distribution? | 1 | 280 | October 4, 2023 | |
Assigning priors to vector of parameters | 4 | 3278 | April 7, 2020 | |
How to vectorize this code? | 3 | 483 | September 3, 2020 |