Function to sample for a complex probabibility density function using MCMC with the adaptative Metropolis algorithm proposed by Roberts and Rosenthal(2009).
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. |
A matrix with the sampled values of the fit parameters.
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) = \left\{ \begin{aligned} &(1-\theta)N(x, (2.38)^{2}\Sigma_{n}/d) + \theta N(x,(0.1)^{2}I_{d}/d), &\Sigma_{n}\text{ is positive definite} \\ &N(x,(0.1)^{2}I_{d}), &\Sigma_{n}\text{ is not positive definitive}\\ \end{aligned} \right.$$ where
\(\theta \in (0,1)\): control parameters
\(N()\): Normal distribution
\(\Sigma_{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.
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