unbiased_score_increment: Unbiased estimator of score increment between two successive...

View source: R/unbiased_scores.R

unbiased_score_incrementR Documentation

Unbiased estimator of score increment between two successive discretization levels

Description

Computes unbiased estimator of the difference of the time-discretized score functions between two successive discretization levels.

Usage

unbiased_score_increment(
  model,
  theta,
  discretization,
  observations,
  nparticles,
  resampling_threshold = 1,
  coupled2_resampling,
  coupled4_resampling,
  initialization = "particlefilter",
  algorithm = "CPF",
  k = 0,
  m = 1,
  max_iterations = Inf
)

Arguments

model

a list representing a hidden Markov model, e.g. hmm_ornstein_uhlenbeck

theta

a vector of parameters as input to model functions

discretization

lists containing stepsize, nsteps, statelength, obstimes for fine and coarse levels, and coarsetimes of length statelength_fine indexing time steps of coarse level

observations

a matrix of observations of size nobservations x ydimension

nparticles

number of particles

resampling_threshold

ESS proportion below which resampling is triggered (always resample at observation times by default)

coupled2_resampling

a 2-marginal coupled resampling scheme, such as coupled2_maximal_independent_residuals

coupled4_resampling

a 4-marginal coupled resampling scheme, such as coupled4_maximalchains_maximallevels_independent_residuals

initialization

choice of distribution to initialize chains, such as dynamics or the default particlefilter

algorithm

character specifying type of algorithm desired, i.e. CPF for conditional particle filter, CASPF for conditional ancestor sampling particle filter, CBSPF for conditional backward sampling particle filter

k

iteration at which to start averaging (default to 0)

m

iteration at which to stop averaging (default to 1)

max_iterations

iteration at which to stop the while loop (default to infinity)

Value

a list with objects such as: mcmcestimator_coarse is the MCMC estimator of the score at level-1; mcmcestimator_fine is the MCMC estimator of the score at level; unbiasedestimator_coarse is an unbiased estimator of the score at level-1; unbiasedestimator_fine is an unbiased estimator of the score at level; mcmcestimator is the MCMC estimator of the score increment between the two discretization levels; unbiasedestimator is an unbiased estimator of the score increment between the two discretization levels; meetingtime_coarse is the meeting time of the two chains at level-1; meetingtime_fine is the meeting time of the two chains at level; iteration is the number of iterations taken; finished indicates if the algorithm has completed successfully; cost_coarse is the cost of the algorithm in units of the CPF kernel at coarse discretization level; cost_fine is the cost of the algorithm in units of the CPF kernel at fine discretization level; elapsedtime is the time taken by the algorithm.


jeremyhengjm/UnbiasedScore documentation built on Nov. 17, 2023, 1:48 a.m.