*
* Martin, Hurn and Harris, "Econometric Modelling with Time Series"
* Examples 10.11, 10.16 from pp 373-377
* Estimating the C-CAPM
*
open data "ccapm.dat"
data(format=prn,nolabels,org=columns) 1 238 cratio g_return e
*
* cratio is the ration of consumption
* g_return is the gross real return on TBills, so 1 has to be subtracted
* to get r.
*
set r = g_return-1
nonlin gamma beta
*
compute gamma=2,beta=.99
*
frml m = beta*cratio^(-gamma)*(1+r)-1
*
* The timing has to be correct on the instruments. cratio and r are both
* actually for t+1, so we need the lags for cratio, r and e in the
* instrument sets.
*
instruments constant cratio{1}
*
nlls(inst,frml=m,optimalweights) *
*
instruments constant cratio{1} r{1}
nlls(inst,frml=m,optimalweights) *
*
instruments constant cratio{1} r{1} e{1}
nlls(inst,frml=m,optimalweights) *