nse.geyer: Variance of sample mean of functional of reversible Markov...

Description Usage Arguments Details Value References Examples

Description

Calculate Geyer (1992) NSE estimator.

Usage

1
nse.geyer(x, type, nbatch = 30, iseq.type = "pos")

Arguments

x

A numeric vector or a matrix(only for type "bm").

type

The type c("iseq","bm","obm","iseq.bm").

nbatch

An optional parameter for the type m and iseq.bm.

iseq.type

constraints on function, ("pos") nonnegative, ("dec") nonnegative and nonincreasing, and ("con") nonnegative, nonincreasing, and convex. The default value is "pos".

Details

The type "iseq" is a wrapper around initseq from the MCMC package and gives the positive intial sequence estimator. The type "bm" is the batch mean estimator. The type "obm" is the overlapping batch mean estimator. The type "iseq.bm" is a combinaison of the two.

Value

The variance estimator in the univariate case or the variance-covariance matrix estimator in the multivariate case.

References

Geyer, Charles J. "Practical markov chain monte carlo." Statistical Science (1992): 473-483.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
n = 1000
ar = c(0.9,0.6)
mean = c(1,5)
sd = c(10,2)
 
Ts1 = as.vector(arima.sim(n = n, list(ar = ar[1]), sd = sd[1]) + mean[1])
Ts2 = as.vector(arima.sim(n = n, list(ar = ar[2]), sd = sd[2]) + mean[2])
Ts = cbind(Ts1,Ts2)
 
nbatch = 30
nse::nse.geyer(x = Ts1, nbatch = nbatch, type =  "bm",)
nse::nse.geyer(x = Ts, nbatch = nbatch , type =  "bm")
nse::nse.geyer(x = Ts1 , type = "iseq", iseq.type = "pos")
nse::nse.geyer(x = Ts1, nbatch = nbatch, type = "iseq.bm", iseq.type = "con")
 

AmurG/nse documentation built on May 5, 2019, 4:56 a.m.