plot.convergence: Plot Convergence for Simulations

plot.convergenceR Documentation

Plot Convergence for Simulations

Description

Over each iteration, the function will compute the mean estimate of the simulated statistic for all past iterations. Curve should stabilise if convergence is reached.

Usage

## S3 method for class 'convergence'
plot(x)

Arguments

x

vector object. Index should match number of iterations

Value

ggplot object. Plots mean of estimate against number of iterations

Examples

set.seed(100)
flip.coin <- function(n){
  return(sample(0:1, size=n, replace = T))
}
flips <- flip.coin(100)
plot.convergence(flips)


dennisteowh/dthelper documentation built on March 19, 2022, 11:42 a.m.