estvssamp: Create a plot that shows how Monte Carlo estimates change...

Description Usage Arguments Value Examples

View source: R/mcmcse.R

Description

Create a plot that shows how Monte Carlo estimates change with increasing sample size.

Usage

1
estvssamp(x, g = mean, main = "Estimates vs Sample Size", add = FALSE, ...)

Arguments

x

a sample vector.

g

a function such that E(g(x)) is the quantity of interest. The default is g = mean.

main

an overall title for the plot. The default is “Estimates vs Sample Size”.

add

logical. If TRUE, add to a current plot.

...

additional arguments to the plotting function.

Value

NULL

Examples

1
2
3
4
5
6
7
8
## 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)

estvssamp(out[,1], main = expression(E(x[1])))

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