independent_sum: Unbiased independent-sum estimator of the score function

View source: R/unbiased_estimators.R

independent_sumR Documentation

Unbiased independent-sum estimator of the score function

Description

Estimates the score function using the independent-sum estimator of Rhee and Glynn (2015).

Usage

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

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

Value

a list with objects such as: random_level is the random level to truncated infinite sum; unbiasedestimator is an unbiased estimator of the gradient of the log-likelihood; cost is the cost to compute the independent-sum estimator; elapsedtime is the time taken to compute the independent-sum estimator.


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