Econometrics-I-24

2 generate y by sampling n observations from the

Info icon This preview shows pages 14–20. Sign up to view the full content.

View Full Document Right Arrow Icon
(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  .) β β
Image of page 14

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

View Full Document Right Arrow Icon
Part 24: Bayesian Estimation Generating Random Draws from f(X) ™    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.
Image of page 15
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) $ ™    15/34
Image of page 16

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

View Full Document Right Arrow Icon
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] | +---------+--------------+----------------+--------+---------+ BBAR_1 .21483281 .05076663 4.232 .0000 BBAR_2 .40815611 .04779292 8.540 .0000 BBAR_3 -.49692480 .04508507 -11.022 .0000 +---------+--------------+----------------+--------+---------+ |Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | +---------+--------------+----------------+--------+---------+ B_1 .22696546 .04276520 5.307 .0000 B_2 .40038880 .04671773 8.570 .0000 B_3 -.50012787 .04705345 -10.629 .0000 ™    16/34
Image of page 17
Part 24: Bayesian Estimation A Random Effects Approach p Allenby and Rossi, “Marketing Models of Consumer Heterogeneity” n Discrete Choice Model – Brand Choice n “Hierarchical Bayes” n Multinomial Probit p Panel Data: Purchases of 4 brands of Ketchup ™    17/34
Image of page 18

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

View Full Document Right Arrow Icon
Part 24: Bayesian Estimation Structure ™    18/34 , , , , , , Conditional data generation mechanism * , . 1[ * ] (constant, log price, "availability," "f it j i it j it j it j it j it j y Utility for consumer i, choice t, brand j Y y maximum utility among the J choices ε = + = = = x x β , 1 eatured") ~ [0, ], 0 Implies a J outcome multinomial probit model.
Image of page 19
Image of page 20
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern