unbiased_discretized_score: Unbiased estimator of score function at a discretization...

View source: R/unbiased_scores.R

unbiased_discretized_scoreR Documentation

Unbiased estimator of score function at a discretization level

Description

Computes unbiased estimator of the time-discretized score function.

Usage

unbiased_discretized_score(
  model,
  theta,
  discretization,
  observations,
  nparticles,
  resampling_threshold = 1,
  coupled_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

list containing stepsize, nsteps, statelength and obstimes

observations

a matrix of observations of size terminal_time x ydimension

nparticles

number of particles

resampling_threshold

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

coupled_resampling

a 2-marginal coupled resampling scheme, such as coupled2_maximal_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 is the MCMC estimator of the discretized score; unbiasedestimator is an unbiased estimator of the discretized score; meetingtime 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 is the cost of the algorithm in units of the CPF kernel at current discretization level; elapsedtime is the time taken by the algorithm.


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