numEff: Compute Numerical Standard Error and Relative Numerical...

Description Usage Arguments Details Value Warning Author(s) References Examples

View source: R/numEff.R

Description

numEff computes the numerical standard error for the mean of a vector of draws as well as the relative numerical efficiency (ratio of variance of mean of this time series process relative to iid sequence).

Usage

1
numEff(x, m = as.integer(min(length(x),(100/sqrt(5000))*sqrt(length(x)))))

Arguments

x

R x 1 vector of draws

m

number of lags for autocorrelations

Details

default for number of lags is chosen so that if R=5000, m=100 and increases as the sqrt(R).

Value

A list containing:

stderr

standard error of the mean of x

f

variance ratio (relative numerical efficiency)

Warning

This routine is a utility routine that does not check the input arguments for proper dimensions and type.

Author(s)

Peter Rossi, Anderson School, UCLA, [email protected].

References

For further discussion, see Chapter 3, Bayesian Statistics and Marketing by Rossi, Allenby, and McCulloch.
http://www.perossi.org/home/bsm-1

Examples

1
2
numEff(rnorm(1000), m=20)
numEff(rnorm(1000))

Example output

$stderr
           [,1]
[1,] 0.02639064

$f
          [,1]
[1,] 0.7341646

$m
[1] 20

$stderr
           [,1]
[1,] 0.02750013

$f
          [,1]
[1,] 0.7625682

$m
[1] 44

bayesm documentation built on July 21, 2017, 7:18 p.m.