Deterimine the number of checkpoints for the warmup and sampling, given the desired number of iterations for each and the iterations per checkpoint.

chkpt_setup(iter_sampling, iter_warmup, iter_per_chkpt)

Arguments

iter_sampling

(positive integer) The number of post-warmup iterations to run per chain. Note: in the CmdStan User's Guide this is referred to as num_samples.

iter_warmup

(positive integer) The number of warmup iterations to run per chain. Note: in the CmdStan User's Guide this is referred to as num_warmup.

iter_per_chkpt

(positive integer) The number of iterations per check point.

Value

A list with the following:

  • warmup_chkpts: Number of warmup checkpoints

  • sample_chkpts: Number of sampling checkpoints

  • total_chkpts: Total number of checkpoints (warmup_chkpts + sample_chkpts)

  • iter_per_chkpt: Iterations per checkpoint

Examples

chkpt_setup <- chkpt_setup(
  iter_sampling = 5000,
  iter_warmup = 2000,
  iter_per_chkpt = 10
)

chkpt_setup
#> chkptstanr
#> -----
#> Checkpoint setup:
#> 
#> Total checkpoints: 700 
#> Warmup checkpoints: 200 
#> Sampling checkpoints: 500 
#> Iterations per checkpoint: 10 
#> -----