jthaman / ciTools

An R Package for Quick Uncertainty Intervals
GNU General Public License v3.0
106 stars 9 forks source link

Reuse simulation data #34

Open jthaman opened 6 years ago

jthaman commented 6 years ago

For certain methods like add_pi.glm and add_quantile.glm, a small parametric bootstrap is performed to generate the desired statistic. Presently if these two methods are used, a separate simulation is run for each method. If the number of replicates (nSims) and new data (tb) are not changed, it would be nice to store and reuse the simulation data.

The benefits of storing simulation data are twofold:

  1. We can speed up our computations if many methods are run in sequence
  2. add_pi, add_qauntile, and add_probs will be consistent within an analysis --- each statistic calculated on the same simulation data.

Though we could just handle the second point by setting a seed.

jebyrnes commented 3 years ago

Returning the simulations to the user would also have a great utility for plotting outcomes. Hrm....

jebyrnes commented 3 years ago

See http://imachordata.com/2020/09/24/simulating-posterior-predictions-from-non-bayesian-fits/