systematic_estimator: Unbiased estimators of the score function based on systematic...

View source: R/unbiased_estimators.R

systematic_estimatorR Documentation

Unbiased estimators of the score function based on systematic sampling

Description

Estimates the score function using the unbiased stratified estimators of Vihola (2018)

Usage

systematic_estimator(
  model,
  theta,
  observations,
  nparticles,
  resampling_threshold = 1,
  coupled2_resampling,
  coupled4_resampling,
  initialization = "particlefilter",
  algorithm = "CPF",
  k = 0,
  m = 1,
  level_distribution,
  maxnrepeats
)

Arguments

model

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

theta

a vector of parameters as input to model functions

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)

level_distribution

list containing mass_function and tail_function that specify the distribution of levels, e.g. by calling compute_level_distribution

maxnrepeats

maximum number of replicates to be stratified

Value

a list with objects such as: nlevel_repeats is a matrix of the number of repetitions on each level; unbiasedestimator is a matrix of unbiased estimators of the gradient of the log-likelihood; cost is a vector of cost to compute the unbiased estimators; elapsedtime is the time taken to compute the estimators.


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