Object representing the results of MCMC estimation on an object of class
synlik, from which it inherits.
Vector of initial parameters where the MCMC chain will start (
Number of MCMC iterations (
Number of simulations from the simulator at each step of the MCMC algorithm (
Number of initial MCMC iterations that are discarded (
Function that takes a vector of parameters as input and the log-density of the prior
as output. If the output is not finite the proposed point will be discarded. (
The function needs to have signature
fun(x, ...), where
x represents the input parameters (
Matrix representing the covariance matrix to be used to perturb the
parameters at each step of the MCMC chain (
Target rate for the adaptive MCMC sampler. Should be in (0, 1), default is NULL (no adaptation). The adaptation
uses the approach of Vihola (2011). (
If TRUE the synthetic likelihood will be evaluated at the current and proposed positions in the parameter
space (thus doubling the computational effort). If FALSE the likelihood of the current
position won't be re-estimated (
Number of cores to use if multicore == TRUE (
Acceptance rate of the MCMC chain, between 0 and 1 (
Matrix of size niter by length(initPar) where the i-th row contains the position of the MCMC algorithm
in the parameter space at the i-th (
Vector of niter elements where the i-th element is contains the estimate of the
synthetic likelihood at the i-th iteration (
Control parameters used by the MCMC sampler:
theta = controls the speed of adaption. Should be between 0.5 and 1.
A lower gamma leads to faster adaption.
adaptStart = iteration where the adaption starts. Default 0.
adaptStop = iteration where the adaption stops. Default
burn + niter
saveFile = path to the file where the intermediate results will be stored (ex: "~/Res.RData").
saveFreq = frequency with which the intermediate results will be saved on
verbose = if
TRUE intermediate posterior means will be printer.
verbFreq = frequency with which the intermediate posterior means will be printer. Default 500.
Matteo Fasiolo <[email protected]>
Vihola, M. (2011) Robust adaptive Metropolis algorithm with coerced acceptance rate. Statistics and Computing.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# Load "synlik" object data(ricker_sl) plot(ricker_sl) # MCMC estimation set.seed(4235) ricker_sl <- smcmc(ricker_sl, initPar = c(3.2, -1, 2.6), niter = 50, burn = 3, priorFun = function(input, ...) 1, propCov = diag( c(0.1, 0.1, 0.1) )^2, nsim = 200, multicore = FALSE) # Continue with additional 50 iterations ricker_sl <- continue(ricker_sl, niter = 50) plot(ricker_sl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.