Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

confRegion

Confidence regions (ellipses) for Monte Carlo estimates


Description

Constructs confidence regions (ellipses) from the Markov chain output for the features of interest. Function uses the ellipse package.

Usage

confRegion(mcse.obj, which = c(1,2), level = .95)

Arguments

mcse.obj

the list returned by the mcse.multi or mcse.initseq command

which

integer vector of length 2 indicating the component for which to make the confidence ellipse. Chooses the first two by default.

level

confidence level for the ellipse

Details

Returns a matrix of x and y coordinates for the ellipse. Use plot function on the matrix to plot the ellipse

Examples

library(mAr)
p <- 3
n <- 1e3
omega <- 5*diag(1,p)

## Making correlation matrix var(1) model
set.seed(100)
foo <- matrix(rnorm(p^2), nrow = p)
foo <- foo %*% t(foo)
phi <- foo / (max(eigen(foo)$values) + 1)
  
out <- as.matrix(mAr.sim(rep(0,p), phi, omega, N = n))
mcerror <- mcse.multi(out, blather = TRUE)

## Plotting the ellipse
plot(confRegion(mcerror), type = 'l')

mcmcse

Monte Carlo Standard Errors for MCMC

v1.4-1
GPL (>= 2)
Authors
James M. Flegal <jflegal@ucr.edu>, John Hughes <j.hughes@ucdenver.edu>, Dootika Vats <dootika@iitk.ac.in>, and Ning Dai <daixx224@umn.edu>
Initial release
2020-01-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.