check_run_stage_args: Test the arguments to the run_stage function for correctness

Description Usage Arguments

View source: R/sampling.R

Description

Takes the arguments to run_stage and checks them for completeness and correctness. Returns a list of cleaned/checked arguments to the caller.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
check_run_stage_args(
  pmwgs,
  stage,
  iter,
  particles,
  display_progress,
  n_cores,
  n_unique,
  epsilon,
  mix,
  pdist_update_n
)

Arguments

pmwgs

A Particle Metropolis within Gibbs sampler which has been set up and initialised

stage

The sampling stage to run. Must be one of 'burn', 'adapt' or 'sample'.

iter

The number of iterations to run for the sampler. For 'burn' and 'sample' all iterations will run. However for 'adapt' if all subjects have enough unique samples to create the conditional distribution then the stage will finish early.

particles

The default here is 1000 particles to be generated for each iteration, however during the sample phase this should be reduced.

display_progress

Display a progress bar during sampling.

n_cores

Set to more than 1 to use mclapply. Setting n_cores greater than 1 is only permitted on Linux and Mac OS X machines.

n_unique

A number representing the number of unique samples to check for on each iteration of the sampler (An initial test for the generation of the proposal distribution). Only used during the 'adapt' stage.

epsilon

A value between 0 and 1 that controls the extent to which the covariance matrix is scaled when generating particles from the previous random effect. The default will be chosen based on the number of random effects in the model.

mix

A vector of floats that controls the mixture of different sources for particles. The function numbers_from_proportion is passed this value and includes extra details on what is accepted.

pdist_update_n

The number of iterations in the sample stage after which the proposal distribution will be recomputed.


pmwg documentation built on Feb. 17, 2021, 9:07 a.m.