这个版本可以估计Berry, Levinsohn, and Pakes模型,目前是IO里面比较时髦的。
程序:
SAMPLE ; 1-1000 $
CREATE ; market = Trn(10,0) $ (There will be 10 brands in each market) $
SETPANEL ; Group = market ; Pds = mkt $
CREATE ; x1 = Rnn(0,.2) ; x2 = Rnn(0,.1) ; x3 =Rnn(0,.1) $ (Attributes and price) $
CREATE ; u = Rnn(1,.05)*x2+x1+Rnn(-.5,.3)*x3+.6 $ (Utilities with RPs) $
CREATE ; eu = Exp(u) $
CREATE ; iv = Group Sums(eu, Pds = mkt) $ (Inclusive value) $
CREATE ; iv = iv+1 $ (Includes base opt-out brand) $
CREATE ; eu = Rnu(.7,.9)*eu/iv $
CREATE ; total = Group Sums(eu, Pds = mkt) $
CREATE ; shares = eu $ (Random market shares) $
? Instruments are 2 exogenous variables and products of exogenous attributes.
CREATE ; z1 = Rnu(1,1.5) ; z2 = x1 ; z3 = x2 ; z4 = x1*x2 ; z5 = x1*x1 ; z6 = x2*x2 $
CREATE ; z7 = Rnn(0,1) ; z8 = z7*z7 $
NAMELIST ; z = one,z* $ (All instruments) $
NAMELIST ; x = one,x1,x2,x3 $ (All attributes) $
BLPLOGIT ; Lhs = shares ; Rhs = one,x1 ; RPL = x2,x3
; Inst = z
; Draws = 50
; markets = 10 $
结果:
Iterative procedure has converged
Normal exit: 7 iterations. Status=0, F= .1434121D-02
Maximum of 25 iterations. Exit iterations with status=1
Maximum of 25 iterations. Exit iterations with status=1
Iterative procedure has converged
Normal exit: 13 iterations. Status=0, F= .8732352D-01
Iterative procedure has converged
Normal exit: 7 iterations. Status=0, F= .8737990D-01
Iterative procedure has converged
Normal exit: 7 iterations. Status=0, F= .8738937D-01
Iterative procedure has converged
Normal exit: 4 iterations. Status=0, F= .8739076D-01
-----------------------------------------------------------------------------
Random Parameters Logit (BLP) Model
-----------------------------------------------------------------------------
--------+--------------------------------------------------------------------
| Standard Prob. 95% Confidence
SHARES| Coefficient Error z |z|>Z* Interval
--------+--------------------------------------------------------------------
|Variables with Nonrandom Parameters in Utility Function.............
Constant| -1.18826 265.6695 .00 .9964 -521.89096 519.51444
X1| .92254*** .31271 2.95 .0032 .30965 1.53543
|Variables with Random Parameters in Utility Function................
X2| .92450 1.01950 .91 .3645 -1.07369 2.92269
X3| -.14799 1.21830 -.12 .9033 -2.53581 2.23983
|Standard Deviations of Random Parameters............................
sX2| .48469 .93317 .52 .6035 -1.34430 2.31368
sX3| .01339 .06622 .20 .8397 -.11640 .14318
--------+--------------------------------------------------------------------
***, **, * ==> Significance at 1%, 5%, 10% level.
Model was estimated on Oct 11, 2016 at 07:41:08 PM
-----------------------------------------------------------------------------
|