College mathematics R project

profileyyhujessie

Download R project:    https://www.r-project.org

1. Use Chebychev's inequality to prove the LLN for the sample mean of i.i.d. data with finite variance. 2. Use the R code to empirically check the LLN and CLT via simulation.

 

n<-100 # sample size
m<- c(1:200)
for (i in 1:200){ #simulate 200 samples x<-rnorm(n)
m[i]<- mean(x) }
hist(m)
var(m)

Repeat the above with n=400 and compare the histograms.
Repeat the above with runif() and/or rexp() instead of rnorm() and compare. 

    • 9 years ago
    • 3
    Answer(0)
    Bids(0)