Description Usage Arguments Details Value Author(s) References See Also
View source: R/adaptative_mcmc_utilities.R
Function to sample for a complex probabibility density function using MCMC with the adaptative Metropolis algorithm proposed by Roberts and Rosenthal(2009).
1 2 3 | run_adap_metropolis_MCMC(startvalue, iterations = 10000,
iter_update_par = 100, ptest, model, prior.pdf, prior.parameters,
proposal.sigma, cov.corr = FALSE)
|
startvalue |
A numeric vector with the fit parameters of the pumping test. |
iterations |
An integer with the number of iterations to run the chain. |
iter_update_par |
An integet specifying the number of iterations to update the covariance matrix. |
ptest |
A pumping_test object. |
model |
A character string with the name of the model used in the parameter estimation. |
prior.pdf |
A character vector with the distributions of the fit parameters ( 'unif' and 'norm' are currently supported). |
prior.parameters |
A matrix with the parameters of the distributions (min and max for uniform distributions, mean and sd for normal distributions) |
proposal.sigma |
A numeric vector with the standard deviations of the proposal distribution. |
cov.corr |
A logical flag indicating if the covariance matrix must be corrected for positive definiteness. |
This function implements the adaptative MCMC proposed by Roberts and Rosenthal (2009), in which the proposal distribution Q_{n}(x, \cdot) is given by:
Q_{n}(x, \cdot) = ≤ft\{ \begin{aligned} &(1-θ)N(x, (2.38)^{2}Σ_{n}/d) + θ N(x,(0.1)^{2}I_{d}/d), &Σ_{n}\text{ is positive definite} \\ &N(x,(0.1)^{2}I_{d}), &Σ_{n}\text{ is not positive definitive}\\ \end{aligned} \right.
where
θ \in (0,1): control parameters
N(): Normal distribution
Σ_{n}: empirical covariance matrix
d: number of parameters
I_{d}: identity matrix of size d.
This proposal function is implemented in the function proposalfunction_cov.
A matrix with the sampled values of the fit parameters.
Oscar Garcia-Cabrejo khaors@gmail.com
Roberts, G. O. & Rosenthal, J. S. Examples of adaptive MCMC Journal of Computational and Graphical Statistics, 2009, 18, 349-367.
Other amcmc_auxiliary_function functions: posterior
,
prior
, proposalfunction_cov
,
proposalfunction
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.