heidel.welch | R Documentation |
Conducts a Heidelberger and Welch convergence diagnostic on MCMC iterations.
heidel.welch(object, pvalue) ## S3 method for class 'krige' heidel.welch(object, pvalue = 0.05) ## S3 method for class 'summary.krige' heidel.welch(object, pvalue = 0.05) ## Default S3 method: heidel.welch(object, pvalue = 0.05)
object |
An matrix or |
pvalue |
Alpha level for significance tests. Defaults to 0.05. |
This is a generic function currently works with matrix
, krige
,
and summary.krige
objects. It is a simplified version of the Heidelberger
and Welch test for use with this package.
This is an adaptation of a function in Plummer et al.'s coda
package.
Heidelberger and Welch's (1993) test for nonconvergence. This version of the
diagnostic only reports a Cramer-von Mises test and its corresponding p-value
to determine if the chain is weakly stationary with comparisons of early
portions of the chain to the end of the chain.
A matrix
in which the first row consists of the values of the
Cramer-von Mises test statistic for each parameter, and the second row consists
of the corresponding p-values. Each column of the matrix represents another
parameter of interest. A significant result serves as evidence of nonconvergence,
so non-significant results are desired.
Philip Heidelberger and Peter D. Welch. 1993. "Simulation Run Length Control in the Presence of an Initial Transient." Operations Research 31:1109-1144.
Martyn Plummer, Nicky Best, Kate Cowles and Karen Vines. 2006. "CODA: Convergence Diagnosis and Output Analysis for MCMC." R News 6:7-11.
heidel.welch.krige
, heidel.welch.summary.krige
,
geweke
## Not run: # Load Data data(ContrivedData) # Set seed set.seed(1241060320) M <- 100 contrived.run <- metropolis.krige(y ~ x.1 + x.2, coords = c("s.1","s.2"), data = ContrivedData, n.iter = M, n.burnin = 20, range.tol = 0.05) heidel.welch(contrived.run) heidel.welch(summary(contrived.run)) heidel.welch(contrived.run$mcmc.mat) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.