A Note on Reproducability

knitr::opts_chunk$set(collapse = T)

By specifying seed values when calling functions dependent on random number generation (RNG) both rstan and rstansim allow for fully reproducable results to be produced. However, in cases where rstan is used to generate new values in the generated quantities code block (using "_rng" suffixed commands) a common seed is not sufficient to guarantee reproducability within the same R session (see the discussion here).

This can be managed by restarting the R session in advance of calling any functions reliant on rstans RNG functions. If running rstudio this is easily achieved by calling .rs.restartR().

Manual tests of this behaviour are available with this package for examples of this in practice.



Try the rstansim package in your browser

Any scripts or data that you put into this service are public.

rstansim documentation built on Sept. 22, 2017, 1:06 a.m.