Learn R Programming

bayesm (version 1.1-2)

numEff: Compute Numerical Standard Error and Relative Numerical Efficiency

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

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

Value

  • stderrstandard error of the mean of x
  • fvariance ratio (relative numerical efficiency)

concept

numerical efficiency

Warning

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

Details

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

References

For further discussion, see Bayesian Statistics and Marketing by Allenby, McCulloch, and Rossi, Chapter 3. http://gsbwww.uchicago.edu/fac/peter.rossi/research/bsm.html

Examples

Run this code
numEff(rnorm(1000),m=20)
 numEff(rnorm(1000))

Run the code above in your browser using DataLab