A movie to illustrate that as we increase the size of a sample simulated from a continuous probability distribution a histogram of these data gives a closer approximation to the underlying probability density function (p.d.f.).

ox_births_movie(starting_n = 100, delta_n = 1000)

Arguments

starting_n

A numeric scalar. The size of the first sample to be simulated.

delta_n

A numeric scalar. The amount by which the sample size is increased (or decreased) after one click of the + (or -) button in the parameter window.

Value

Nothing is returned, only the animation is produced.

Details

ox_births_movie first fits a gamma distribution (see GammaDist) to the time data in the ox_births data. Then we simulate samples (using rgamma) from the fitted gamma distribution and produce a histogram of the simulated data. The p.d.f. of the fitted gamma distribution is superimposed on the histogram.

We will not study the gamma distribution in STAT0002, but you will encounter it in STAT0003 if you take that next term.

See also

stat0002movies: general information about the movies.

Examples

ox_births_movie()