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

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

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

View Full Document Right Arrow Icon
# 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) )
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/17/2012 for the course AM 1234 taught by Professor Qqqq during the Spring '11 term at UWO.

Page1 / 2

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online