Learn R Programming

geoRglm (version 0.9-16)

asympvar: Asymptotic Variance

Description

Calculates the initial monotone/positive sequence estimate of the asymptotic variance from CLT (Geyer 92). Useful for estimation of the variance of a Markov Chain Monte Carlo estimate.

Usage

asympvar(timeseries, type="mon", lag.max = 100, messages)

Arguments

timeseries

a vector with a timeseries, or a matrix where the rows are different timeseries.

type

"pos" and "mon" gives the monotone and the positive sequence estimator, respectively, and "all" gives both. Default is type="mon".

lag.max

maximum lag at which to calculate the asymptotic variance. Default is lag.max = 100.

messages

logical. If TRUE, the default, status messages are printed while the function is running.

Value

A number (or a vector) with the estimate, when type="mon" or type="pos". A list with components mon and pos when type="all"

References

Geyer, C. (1992). Practical Monte Carlo (with discussion). Statist. Sci. 7, 473-511.

Examples

Run this code
# NOT RUN {
data(p50)
# }
# NOT RUN {
test <- pois.krige(p50, krige = krige.glm.control(cov.pars = c(1,1), beta = 1),
      mcmc.input = mcmc.control(S.scale = 0.5, n.iter = 1000, thin = 1))
asympvar(test$intensity[45,])
ass <- asympvar(test$intensity[1:10,], type = "pos")
# }

Run the code above in your browser using DataLab