Skip to contents

Visualize the behavior of the Law of Large Numbers with a given function compared to a normal distribution.

Usage

draw_lln_with_func_facet(
  animate = FALSE,
  n = 1000,
  theoretical_mean,
  random_function,
  ...
)

Arguments

animate

Whether the returned plot should animate the draws

n

The number of draws to be made

theoretical_mean

The theoretical mean of the function

random_function

The function from which samples are to be drawn

...

Additional arguments to pass to the random function

Value

a plot or animated plot

Examples

draw_lln_with_func_facet(
  animate = FALSE, n = 400,
  theoretical_mean = 2.5, rgamma, shape = 10, scale = 0.25
)

draw_lln_with_func_facet(
  animate = FALSE, n = 400,
  theoretical_mean = 2.5, stats::rgamma, shape = 10, scale = 0.25
)

draw_lln_with_func_facet(
  animate = FALSE, n = 200,
  theoretical_mean = 2.5, stats::rcauchy, location = 2.5, scale = 2
)

draw_lln_with_func_facet(
  animate = FALSE, n = 200,
  theoretical_mean = 2.5, stats::rcauchy, location = 2.5, scale = 2
)