singleStep: Updating mechanisms used in the metropolis algorithm

Description Usage Arguments Details Value Author(s) See Also

Description

Updating mechanisms used in the metropolis algorithm

Usage

1
2
3
4
5
6
7
8
singleStep(par, lidat, nam, pum, ctrl, logposterior, postcur, optimiser, debug,
  dumpfile, composition)

MultipleIndependentSteps(par, lidat, nam, pum, ctrl, logposterior, postcur,
  optimiser, debug, dumpfile, composition)

MultiNormalStep(par, lidat, nam, pum, ctrl, logposterior, postcur, optimiser,
  debug, dumpfile, composition)

Arguments

par

a named list containing the parameters of the model (the names of the list correspond to the names of the parameters)

lidat

a named list containing the variables and constants required by the model (especially the function logposterior

nam

character string. The name of the parameter to be updated.

pum

for singleStep, the standard deviation of the Gaussian distribution used to generate the proposal. For MultipleIndependentSteps, a vector containing the standard deviations for the Gaussian distribution used to generate the proposal of every element of the vector. For MultiNormalStep, the covariance matrix of the multinormal distribution.

ctrl

a named list with two parameters: (i) namePar is the name of the parameter in par that is updated, (ii) if this parameter is a vector where each component is updated in turn (e.g. for MultipleIndependentSteps), iter indicates the element of this vector that is updated (this element is ignored in other cases).

logposterior

a function used to calculate the log-posterior probability of par (up to a constant). This function must have two arguments: par is the list of parameters and lidat is the list containing the data used in the model.

postcur

the current value of the posterior, before updating.

optimiser

logical. If TRUE, the log-posterior calculation is optimized for the current parameter (i.e. the posterior is proportional to the log-posterior but the proportionality constant is not necessarily the same for other optimized parameters, so that the current posterior should be calculated before every step). If FALSE the function logposterior returns the exact log-posterior. In other words, if optimiser is TRUE, the function singleStep, etc. calculates the current posterior (prior to updating) and does not take into account the value of postcur passed to the function. If FALSE, the function relies on the value of postcur passed as argument for the updating.

debug

logical. If TRUE the updating should be run in debugging mode.

dumpfile

character. The name of the debugging file.

composition

character. How composition of parameters are managed (see the help page of GeneralSingleMetropolis). Currently, only used by MultipleIndependentSteps.

Details

singleStep implements an updating mechanism for a unique parameter based on a normal distribution. MultipleIndependentSteps implements the same updating mechanism for a vector of parameters. MultiNormalStep implements an updating mechanism relying on the sampling of a multinormal distribution. These functions are used by the package, but are not to be used directly by the user.

Value

A list with three elements: (i) parm is the updated vector of parameters, (ii) postcur is the value of the (optionally optimized) posterior after updating, and (iii) accept is a vector containing TRUE if an element proposed has been accepted and FALSE otherwise

Author(s)

Clement Calenge, clement.calenge@oncfs.gouv.fr

See Also

GeneralSingleMetropolis


ClementCalenge/metroponcfs documentation built on May 6, 2019, 12:05 p.m.