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

Description Usage Arguments Value Examples

View source: R/batchmeans.R

Description

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

Usage

1
2
estvssamp(x, fun = mean, main = "Estimate vs Sample Size", add = FALSE,
  ...)

Arguments

x

a sample vector.

fun

a function such that E(fun(x)) is the quantity of interest. The default is fun = 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
 9
10
# Simulate a sample path of length 10,000 for an AR(1) chain with rho equal to 0.7.

X = numeric(10000)
X[1] = 1
for (i in 1:9999)
    X[i + 1] = 0.7 * X[i] + rnorm(1)

# Plot MC estimates versus sample size.

estvssamp(X)

batchmeans documentation built on July 2, 2020, 4:15 a.m.