lln_demo: Law of Large Numbers Demo

Description Usage Arguments Value References Examples

View source: R/lln_demo.R

Description

Provides a demonstration of the law of large numbers using draws from a gamma distribution with shape 20 and scale 1/20. The mean and variance, then, are kθ = 120 and kθ^2 = 2400 for each i. Draws from the distribution used here can be made by rgamma(n, 6, 1/20); see ?rgamma for more details about the function.

The law of large numbers essentially states that, for independent samples from some parent distribution, the sample mean (variance) converges in probability towards the expected value of a population statistic. More precise statements can be found in the references or from Wikipedia.

The Law of Large Numbers is useful because it gives conditions under which an estimator converges to its population value.

Usage

1
lln_demo(n = 5000)

Arguments

n

A positive integer greater than 100.

Value

A list with

data

The constructed dataset used for plotting

plot

A ggplot plot object showing convergence of the mean and variance

References

Billingsley, Patrick. Probability and measure. John Wiley & Sons, 2008.

Examples

1

danjdrennan/surveyr documentation built on Dec. 19, 2021, 8:08 p.m.