Description Usage Arguments Details Value Author(s) See Also Examples
Estimates parameters and parameter uncertainties for the spatio-temporal
model using a Metropolis-Hastings based Markov Chain Monte Carlo (MCMC)
algorithm.
The function runs uses a Metropolis-Hastings algorithm (Hastings, 1970) to
sample from the parameters of the spatio-temporal model, assuming flat
priors for all the parameters (flat on the log-scale for the covariance
parameters).
1 2 3 4 5 6 |
object |
|
x |
Point at which to start the MCMC. Could be either only
log-covariance parameters or regression and log-covariance
parameters. If regression parameters are given but not needed they are
dropped, if they are needed but not given they are inferred by calling |
x.fixed |
Vector with parameter to be held fixed; parameters marked as
|
type |
A single character indicating the type of log-likelihood to
compute. Valid options are "f" or "r", for full, or restricted
maximum likelihood (REML). Since profile is not a proper
likelihood |
N |
Number of MCMC iterations to run. |
Hessian.prop |
Hessian (information) matrix for the log-likelihood, can be used to create a proposal matrix for the MCMC. |
Sigma.prop |
Proposal matrix for the MCMC. |
info |
Outputs status information every info:th iteration.
If |
... |
ignored additional arguments. |
At each iteration of the MCMC new parameters are proposed using a random-walk with a proposal covariance matrix. The proposal matrix is determined as:
If Sigma.prop
is given then this is used.
If Sigma.prop=NULL
then we follow Roberts et.al. (1997) and
compute
c <- 2.38*2.38/dim(Hessian.prop)[1]
Sigma.prop <- -c*solve(Hessian.prop)
.
If both Sigma.prop=NULL
and Hessian.prop=NULL
then the
Hessian is computed using loglikeSTHessian
and
Sigma.prop
is computed according to point 2.
The resulting proposal matrix is checked to ensure that it is positive
definite before proceeding,
all(eigen(Sigma.prop)$value > 1e-10)
.
mcmcSTmodel
object with elements:
par |
A |
log.like |
A vector of length |
acceptance |
A vector of length |
Sigma.prop, chol.prop |
Proposal matrix and it's Choleskey factor. |
x.fixed |
Any fixed parameters. |
Johan Lindstrom
Other STmodel methods: c.STmodel
,
createSTmodel
,
estimate.STmodel
,
estimateCV.STmodel
,
plot.STdata
, predict.STmodel
,
print.STmodel
,
print.summary.STmodel
,
qqnorm.predCVSTmodel
,
scatterPlot.predCVSTmodel
,
simulate.STmodel
,
summary.STmodel
Other mcmcSTmodel methods: density.mcmcSTmodel
,
plot.density.mcmcSTmodel
,
plot.mcmcSTmodel
,
print.mcmcSTmodel
,
print.summary.mcmcSTmodel
,
summary.mcmcSTmodel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ##load data
data(mesa.model)
##and results of estimation
data(est.mesa.model)
##strating point
x <- coef(est.mesa.model)
##Hessian, for use as proposal matrix
H <- est.mesa.model$res.best$hessian.all
## Not run:
##run MCMC
MCMC.mesa.model <- MCMC(mesa.model, x$par, N = 2500, Hessian.prop = H)
## End(Not run)
##lets load precomputed results instead
data(MCMC.mesa.model)
##Examine the results
print(MCMC.mesa.model)
##and contens of result vector
names(MCMC.mesa.model)
##Summary
summary(MCMC.mesa.model)
##MCMC tracks for four of the parameters
par(mfrow=c(5,1),mar=c(2,2,2.5,.5))
plot(MCMC.mesa.model, ylab="", xlab="", type="l")
for(i in c(4,9,13,15)){
plot(MCMC.mesa.model, i, ylab="", xlab="", type="l")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.