Econometrics-I-24

Bu β i i i i t y gives the sign of y y | y is a draw

Info iconThis preview shows pages 13–18. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Bu β i i i i t, y gives the sign of y * . y * | , y is a draw from the truncated normal (above if y=0, below if y=1) Part 24: Bayesian Estimation Gibbs Sampling for the Probit Model &#152;&#152;™™ ™ 13/34 i i (1) Choose an initial value for (maybe the MLE) (2) Generate y * by sampling N observations from the truncated normal with mean and variance 1, truncated above 0 if y 0, from below if y ′ = i β x β i-1-1 1. (3) Generate by drawing a random normal vector with mean vector ( ) * and variance matrix ( ) (4) Return to 2 10,000 times, retaining the last 5,000 draws - first 5,000 are the = β X'X X'y X'X 'burn in.' (5) Estimate the posterior mean of by averaging the last 5,000 draws. (This corresponds to a uniform prior over .) β β Part 24: Bayesian Estimation Generating Random Draws from f(X) &#152;&#152;™™ ™ 14/34-1 The inverse probability method of sampling random draws: If F(x) is the CDF of random variable x, then a random draw on x may be obtained as F (u) where u is a draw from the standard uniform (0,1). Exampl θ θ θ θ Φ Φ μ Φ Φ μ-1-1 i i es: Exponential: f(x)= exp(- x); F(x)=1-exp(- x) x = -(1/ )log(1-u) Normal: F(x) = (x); x = (u) Truncated Normal: x= + [1-(1-u)* ( )] for y=1; x μ Φ Φ μ-1 i i = + [u (- )] for y=0. Part 24: Bayesian Estimation Example: Simulated Probit ? Generate raw data Sample ; 1 - 1000 $ Create ; x1=rnn(0,1) ; x2 = rnn(0,1) $ Create ; ys = .2 + .5*x1 - .5*x2 + rnn(0,1) ; y = ys > 0 $ Namelist; x=one,x1,x2$ Matrix ; xx=x'x ; xxi = <xx> $ Calc ; Rep = 200 ; Ri = 1/Rep$ Probit ; lhs=y;rhs=x$ ? Gibbs sampler Matrix ; beta=[0/0/0] ; bbar=init(3,1,0);bv=init(3,3,0)$$ Proc = gibbs$ Do for ; simulate ; r =1,Rep $ Create ; mui = x'beta ; f = rnu(0,1) ; if(y=1) ysg = mui + inp(1-(1-f)*phi( mui)); (else) ysg = mui + inp( f *phi(-mui)) $ Matrix ; mb = xxi*x'ysg ; beta = rndm(mb,xxi) ; bbar=bbar+beta ; bv=bv+beta*beta'$ Enddo ; simulate $ Endproc $ Execute ; Proc = Gibbs $ (Note, did not discard burn-in) Matrix ; bbar=ri*bbar ; bv=ri*bv-bbar*bbar' $ Matrix ; Stat(bbar,bv); Stat(b,varb) $ &#152;&#152;™™ ™ 15/34 Part 24: Bayesian Estimation Example: Probit MLE vs. Gibbs--> Matrix ; Stat(bbar,bv); Stat(b,varb) $ +---------------------------------------------------+ |Number of observations in current sample = 1000 | |Number of parameters computed here = 3 | |Number of degrees of freedom = 997 | +---------------------------------------------------+ +---------+--------------+----------------+--------+---------+ |Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | +---------+--------------+----------------+--------+---------+...
View Full Document

{[ snackBarMessage ]}

Page13 / 35

Bu β i i i i t y gives the sign of y y | y is a draw from...

This preview shows document pages 13 - 18. Sign up to view the full document.

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