7. [R] Estimation of the parameter for exponential distribution 2 (Jan17)

# 7. [R] Estimation of the parameter for exponential distribution 2 (Jan17)

This preview shows pages 1–2. Sign up to view the full content.

# Estimation of the parameter for exponential distribution # E(X) = 1/lam lam = .5 n = 40 x = rexp(n, lam) # 2 of many possible estimators lam.hat.1 = 1/mean(x) lam.hat.2 = 1/sqrt(var(x)) lam.hat.1 lam.hat.2 # how good is a normal approximation to the sampling distribution? # sampling distribution # numerical aproximation to obtain this based on Monte Carlo simulation experiment M = 1000 lh.1.rep = rep(0, M) lh.2.rep = rep(0, M) lambda = lam for(i.rep in 1:M){ x.sim = rexp(n, lambda) lh.1.rep[i.rep] = 1/mean(x.sim) lh.2.rep[i.rep] =1/sqrt(var(x.sim)) } # x.bar = 1/lam.hat.1 # By CLT # z.n = sqrt(n)*(x.bar - 1/lam)/sqrt( 1/lam^2) = (x.bar - 1/lam)/sqrt( 1/(n*lam^2) ) # = (x.bar - 1/lam)/sqrt( var(x.bar) ) # converges in distribution to N(0,1) mu.1 = mean(1/lh.1.rep) s2.1 = var(1/lh.1.rep) z.1.n = ( 1/lh.1.rep - mu.1)/sqrt( s2.1) hist( z.1.n , freq=F , main = "x.bar and normal approximation") x.pts = seq(-3,3, .02) lines( x.pts , dnorm(x.pts , 0,1) , lty = 2) # normal approximation to ( lam.hat - E( lam.hat) ) # do not normalize to variance = 1 Page 1 of 2 19/01/2011 http://www.stats.uwo.ca/faculty/kulperger/Stat3858/Computing/RScripts/EstEG1-expone...

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
# normal approximation for lam.hat.1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern