April 16, 2017

Overview

Motivation

Consider we want to estimate the population mean of a uniform/exponential random variable.

To estimate the population mean, we can carry out simulations and apply the Central Limit Theorem.

Example

Consider the case where we want to estimate the population mean of an exponentially distributed random variable with lambda = 1.

We could first simulate a sample of 50 random exponentials and take the mean.

Then, we repeat this procedure 100,000 times to create the sample mean distribution.

   samples <- sapply(1:100000, FUN = function(x){
                  mean( rexp(50, rate = 1) )
        })

Histogram

The population mean estimates should be centered around the sample mean distribution. Hence, the population mean is approximately 0.9997984.

If you're interested to interactively simulate and visualize the effect of Central Limit Theorem, do check out my shiny app once again at: https://jycheah.shinyapps.io/central_limit_theorem/
Enjoy!