heidel.welch: Heidelberger and Welch Diagnostic for MCMC

View source: R/diagnostics.R

heidel.welchR Documentation

Heidelberger and Welch Diagnostic for MCMC

Description

Conducts a Heidelberger and Welch convergence diagnostic on MCMC iterations.

Usage

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)

Arguments

object

An matrix or krige/summary.krige object for which a Heidelberger and Welch diagnostic is desired

pvalue

Alpha level for significance tests. Defaults to 0.05.

Details

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.

Value

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.

References

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.

See Also

heidel.welch.krige, heidel.welch.summary.krige, geweke

Examples

## 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)


krige documentation built on May 1, 2022, 5:06 p.m.

Related to heidel.welch in krige...