{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Econometric take home APPS_Part_30

# Econometric take home APPS_Part_30 - Calc i = 0 gamma =-1 \$...

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

Calc ; i = 0 ; gamma = -1 \$ Exec ; Proc=LM(gamma) ; n = 1000 \$ samp;1-1000\$ create;LMv=lmi \$ create;reject=lmv>3.84\$ Calc ; List ; Type1 = xbr(reject) ; pwr = 1-Type1 \$ ?**************************************************************** ? Procedure studies the Wald statistic ?**************************************************************** Proc = Wald(c) \$ Create ; if(type=1)Eps = Rnn(0,1) ? Standard normal distribution ; if(type=2)vi=exp(.2*xi) ? eps = vi*rnn(0,1) ? Heteroscedasticity ; if(type=3)eps= Rnt(5) ? Nonnormal distribution ; y = 0 + xi + c*zi +eps \$ Matrix ; b0=XXinv*X'y \$ Create ; e0=y-X'b0\$ Calc ; ss0 = e0'e0/(47) ; v0 = ss0*xxinv(3,3) ; wald0=(b0(3))^2/v0 ; i=i+1 \$ Matrix ; Waldi(i)=Wald0 \$ EndProc \$ ? Set the values for the simulation Calc ; i = 0 ; gamma = 0 ; type=1 \$ Sample ; 1-50 \$ Exec ; Proc=Wald(gamma) ; n = 1000 \$ samp;1-1000\$ create;Waldv=Waldi \$ create;reject=Waldv > 3.84\$ Calc ; List ; Type1 = xbr(reject) ; pwr = 1-Type1 \$ To carry out the simulation, execute the procedure for different values of “gamma” and “type.” Summarize the results with a table or plot of the rejection probabilities as a function of gamma. 119

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

View Full Document
Chapter 18 Bayesian Estimation and Inference Exercise a. The likelihood function is L( y | λ ) = 11 1 exp( ) 1 (|) e x p ( ) (1 ) i ii y nn n y i i fy n yy Σ == = −λ λ λ= = −λλ Γ+ ∏∏ . ) b. The posterior is 1 1 1 0 ( ,. .., | ) ( ) ( | ,..., ) ( ,. .., | ) ( ) n n n py y p y y p d λ λ λ λλ . The product of factorials will fall out. This leaves () 1 0 1 1 0 1 1 0 exp( ) (1/ ) ( | ,..., ) exp( ) (1/ ) exp( ) exp( ) exp( ) exp( ) y n y y y ny ny n y nd n n λ λ λ = λ = λ = Σ Σ Σ Σ 1 exp( ) . ny ny ny Γ where we have used the gamma integral at the last step. The posterior defines a two parameter gamma distribution, G(n, ny ). c. The estimator of λ is the mean of the posterior. There is no need to do the integration. This falls simply out of the posterior density, E[ λ | y ] = ny / n = y .
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

Econometric take home APPS_Part_30 - Calc i = 0 gamma =-1 \$...

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

View Full Document
Ask a homework question - tutors are online