dynamite
dynamite copied to clipboard
Faster extraction of posterior samples from Stan output
Currently returning the posterior samples from Stan to R is very slow due to the CSV reading implemented in rstan, as is documented for example in here: https://github.com/stan-dev/rstan/issues/1018. There is now faster CSV reading inbrms and also in cmdstanr. At least for cmdstanr backend we could use cmdstanr::read_cmdstan_csv (which also allows us to omit some variables from the output as in rstan), but as we work with the stanfit object in the post processing, we need some extra steps to convert the cmdstanr output to stanfit object.
brms:::read_csv_as_stanfit takes a cmdstan csv and reads it into R as a stanfit object.
rstan is no longer used to read CSV files.