Learn R Programming

CaliCo (version 0.1.1)

MetropolisHastingsCpp: C++ implementation of the algorithm for parameter calibration (without discrepancy)

Description

Run a Metropolis Hastings within Gibbs algorithm and a Metropolis Hastings algorithm with the covariance matrix estimated on the the sample set generated in the Metropolis within Gibbs. This algorithm is suitable only for models without discrepancy.

Usage

MetropolisHastingsCpp(Ngibbs, Nmh, theta_init, r, SIGMA, Yf, binf, bsup,
  LogTest, stream)

Arguments

Ngibbs

the number of iteration in the Metropolis within Gibbs

Nmh

the number of iteration in the Metropolis Hastings

theta_init

the starting point

r

regulation percentage in the modification of the k in the Metropolis Hastings

SIGMA

the covariance of the proposition distribution

Yf

the vector of recorded data

binf

the lower bound of the parameters to calibrate

bsup

the upper bound of the parameters to calibrate

LogTest

the log posterior density distribution

stream

(default=1) if stream=0 the progress bar is disabled

Value

list of outputs:

  • PHIwg the points of the Metropolis within Gibbs algorithm in the transformed space

  • PHI the points of the Metropolis Hastings algorithm in the transformed space

  • THETAwg the points of the Metropolis within Gibbs algorithm in the real space

  • THETA the points of the Metropolis Hastings algorithm in the real space

  • AcceptationRatioWg the vector of the acceptance ratio for each parameter in the Metropolis within Gibbs

  • AcceptationRatio the acceptance ratio in the Metropolis Hastings

  • S the covariance computed after the Metropolis within Gibbs

  • LikeliWG the likelihood computed at each iteration of the Metropolis within Gibbs algorithm

  • Likeli the likelihood computed at each iteration of the Metropolis Hastings algorithm