Description Usage Arguments Details Value Examples
This function updates the MCMC iterations associated with the kriging models.
1 2 3 4 5 |
krige.mat |
The output MCMC matrix from |
mcmc.samples |
Number of MCMC iterations to be run for updating |
accepted.beta |
The accepted.beta from the previous run |
accepted.nugget |
The accepted.nugget from the previous run |
accepted.decay |
The accepted.decay from the previous run |
accepted.psill |
The accepted.psill from the previous run |
y |
The dependent variable that was used in the previous model. The same as in |
X |
The matrix of independent variables used in the previous model. The same as in |
east |
Vector of eastings for all observations. The same as in |
north |
Vector of northings for all observations. The same as in |
powered.exp |
A powered exponential correlation structure for the data. The same as in |
spatial.share |
Prior for proportion of unexplained variance that is spatial in nature. The same as in |
range.share |
Prior for the effective range term, as a proportion of the maximum distance in the data. The same as in |
beta.var |
Prior for the variance on zero-meaned normal priors on the regression coefficients. The same as in |
range.tol |
Tolerance term for setting the effective range. The same as in |
b.tune |
Tuning parameter for candidate generation of regression coefficients. The same as in |
nugget.tune |
Tuning parameter for candidate generation of the nugget term ( |
psill.tune |
Tuning parameter for candidate generation of the partial sill term ( |
message |
Experimental feature: An integer that specifies the frequency of the reporting of estimates in progress. |
save |
Experimental feature: An integer that specifies the frequency to save the iterations in progress. |
time |
Experimental feature: A vector that specifies when to report the progress and time remained. |
checks |
Experimental feature: A logical variable that defines whether to check NA and comformity of parameters. |
This function updates the previous run by metropolis.krige
since MCMC iterations need to run typically long to gurantee convergence.
krige.mat
is the output MCMC matrix of metropolis.krige()
from the previous run. Analysts can specify the number of interations for update run by mcmc.samples
. The acceptance rates for beta, nugget, decay, and psill from the previous model also need to be specified to make sure consistency. Other arguments should also be specified as the same as in the metropolis.krige()
, including y
, X
, east
, north
, powered.exp
, spatial.share
, range.share
, beta.var
, range.tol
, b.tune
, nugget.tune
, psill.tune
, message
, save
, time
, and
checks
.
The returned object is the same as metropolis.krige()
, a matrix of sampled values from the posterior distribution. Rows represent the iteration number, and ideally the user will discard the first several rows as burn-in. Columns represent the parameter, so summarizing the matrix by column offers summaries of the model's results.
Returns an object of class matrix
that includes all iterations of the Metropolis-Hastings sampler. Each column of the matrix represents a different parameter–starting with tau2
, phi
, and sigma2
before listing regression coefficients. Each row represents another iteration of the MCMC sampler. Summarizing the matrix by column offers summaries of the marginal posterior distribution by parameter.
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 | ## Not run:
#Set seed
set.seed(1241060320)
#For simple illustration, we set to few iterations.
#But much more are needed for the realistic estimation.
#In this case, a 10,000-iteration run converges to the true parameters.
M1<-5
contrived.run<-metropolis.krige(y=ContrivedData$y,X=covariates,range.tol=0.05,
east=ContrivedData$s.1,north=ContrivedData$s.2,mcmc.samples=M1)
#Acceptance rates for the first 5 iterations.
#"Acceptance percentages: Coefficients=50%. Nugget=75%. Decay=75%.
#Partial sill=75%."
#Update for another 5 iterations.
M2<-5
contrived.run.update<-update.krige(krige.mat=contrived,mcmc.samples=M2,
accepted.beta=0.5,accepted.nugget=0.75,accepted.decay=0.75,
accepted.psill=0.75,y=ContrivedData$y,X=covariates,range.tol=0.05,
east=ContrivedData$s.1,north=ContrivedData$s.2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.