pmcmc: Run a Particle-MCMC

Description Usage Arguments Value

View source: R/wrap.r

Description

Function to run a MCMC using a SMC (particle filter) to evaluate the log-likelihood.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
pmcmc(
  ssm,
  approx = c("ode", "sde", "psr"),
  dt = NULL,
  id = 0,
  root = NULL,
  iter = NULL,
  n_parts = NULL,
  n_thread = 1,
  n_obs = NULL,
  cooling = NULL,
  switch = NULL,
  eps_switch = NULL,
  eps_max = NULL,
  eps_abs_integ = NULL,
  eps_rel_integ = NULL,
  smooth = FALSE,
  alpha = NULL,
  like_min = NULL,
  freeze_forcing = NULL,
  interpolator = NULL,
  verbose = FALSE,
  warning = FALSE,
  no_dem_sto = FALSE,
  no_white_noise = FALSE,
  no_diff = FALSE,
  traj = TRUE,
  n_traj = NULL,
  hat = FALSE,
  trace = TRUE,
  acc = TRUE,
  seed_time = TRUE
)

Arguments

ssm

a ssm object, returned by new_ssm.

approx

character, approximation used to simulate ssm:

  • "ode" deterministic approximation, based on Ordinary Differential Equations.

  • "sde" diffusion approximation, based on Stochastic Differential Equations.

  • "psr" Euler-multinomial approximation, based on Poisson process with Stochastic Rates.

dt

numeric, integration time step.

id

integer, unique integer identifier that will be appended to the output.

root

character, root path for output files (if any) (no trailing slash). If NULL (default), outputs are written in "your_model_path/the_name_of_the_wrapper".

iter

numeric, number of iterations.

n_parts

numeric, number of particles.

n_thread

numeric, number of threads to be used. Default to 1. Use "max" to set it automatically to the number of cores available on the machine using detectCores.

n_obs

numeric, number of observations to be fitted (for tempering). If NULL (default), all observations are fitted.

cooling

numeric, cooling factor (for sampling covariance live tuning or mif cooling).

switch

numeric, select switching iteration from initial covariance to empirical one (kmcmc and pmcmc) or to update formula introduced in Ionides et al. 2006 (mif)

eps_switch

numeric, select number of burn-in iterations before tuning epsilon.

eps_max

numeric, maximum value allowed for epsilon.

eps_abs_integ

numeric, absolute error for adaptive step-size control.

eps_rel_integ

numeric, relative error for adaptive step-size control.

smooth

logical, tune epsilon with the value of the acceptance rate obtained with exponential smoothing. Default to FALSE.

alpha

numeric, smoothing factor of exponential smoothing used to compute smoothed acceptance rate (low values increase degree of smoothing)

like_min

numeric, particles with likelihood smaller than like_min are considered lost. If NULL (default) lower bound on likelihood based on machine precision.

freeze_forcing

character, freeze covariates to their value at specified date (in YYYY-MM-DD format).

interpolator

character, gsl interpolator for covariates

verbose

logical, print logs (verbose). Default to FALSE.

warning

logical, print warnings. Default to FALSE.

no_dem_sto

logical, turn off demographic stochasticity (if any). Default to FALSE.

no_white_noise

logical, turn off white noises (if any). Default to FALSE.

no_diff

logical, turn off diffusions (if any). Default to FALSE.

traj

logical, print the trajectories. Default to TRUE.

n_traj

numeric, number of trajectories stored. If NULL (default), one trajectory is stored at each iteration.

hat

logical, print the state estimates. Default to FALSE.

trace

logical, print the trace. Default to TRUE.

acc

logical, print the acceptance rate. Default to TRUE.

seed_time

logical, seed the random number generator with the current time. Default to TRUE.

Value

a ssm object updated with latest SSM output and ready to be piped into another SSM block.


StateSpaceModels/ssminr documentation built on Feb. 7, 2020, 8:20 p.m.