dynamite icon indicating copy to clipboard operation
dynamite copied to clipboard

Faster extraction of posterior samples from Stan output

Open helske opened this issue 1 year ago • 1 comments

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.

helske avatar Apr 04 '24 06:04 helske

brms:::read_csv_as_stanfit takes a cmdstan csv and reads it into R as a stanfit object.

jsocolar avatar Apr 05 '24 15:04 jsocolar

rstan is no longer used to read CSV files.

santikka avatar Aug 12 '24 06:08 santikka