confRegion: Confidence regions (ellipses) for Monte Carlo estimates

Description Usage Arguments Value Examples

View source: R/confRegion.R

Description

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

Usage

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

Arguments

mcse.obj

The list returned by the mcse.multi or mcse.initseq command, or an mcmcse class object.

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.

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Bivariate Normal with mean (mu1, mu2) and covariance sigma
n <- 1e3
mu <- c(2, 50)
sigma <- matrix(c(1, 0.5, 0.5, 1), nrow = 2)

out <- BVN_Gibbs(n, mu, sigma)

mcerror <- mcse.multi(out, blather = TRUE)

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

mcmcse documentation built on Sept. 9, 2021, 9:06 a.m.