Hey guys,
I'm running different sets of data on the same model in different chains in parallel,
this can for example be very useful if you are doing some sort of cross validation on your model.
One way of doing this is for example :
s1 <- stan_model(model_code = hcode) # compile the model
library(parallel)
sflist <-
mclapply(1:36, mc.cores = 36,
function(i) sampling(object = s1, data = foo_data[[i]], chains = 1,
chain_id = i, iter = 1000, warmup = 350,seed = seed))
But if you do it with the mclapply from the parallel package, you can't see the progress bars in Rstudio.
So in the newest version of Stan it is actually possible to run chains in parallel(without the parallel package), but I can't figure out if I can input a list of different data sets to run on in parallel(foo_data[[i]]), without the parallel package.
So can I do this with only the sampling function? And if not, can you show me how you did get the output to be printed in the console of Rstudio so I can implement this?
Best regards,
Jökull Snæbjarnarson