Please help me with the GMM estimation ofasset pricing model
Please help me with the GMM estimation ofasset pricing model
Hello everyone:
I am new to RATS. I had a hard time implementing GMM in rats.
Basically, I want to estimate an asset pricing model using GMM based on the book of Cochrane:
But i don't know how to properly specify the moment conditions.
It is about implementing a linear factor asset pricing model.
II have nine Fama-French portfolios and three risk factors.
I need to run a time-series regressions to get the coefficient estimates on three risk factors for each of the nine portfolio and the residuals should be orthogonal to the risk factors. This is the first and second moment conditions as in the screenshot of the book.(equation 12.23)
Then i need to run a cross-section regression. that is to regress coefficient estimates from the above regression (which becomes the right hand variables) on the average excess return of the portfolios. this is the third moment conditions.
The reason for using GMM is that the covariance matrix is supposed to take care the generated regressor problem and gives me robust inference.
But i really don't know how to do.
But i am able to specify the first nine time series regression and don't know how to proceed further.
I think what i need to do is to saved the estimated coefficients and the VCV of the parameter estimates and somehow tell rats to use that information in estimating the third moment conditions.
I attaches the the screenshot from cochrane's book where he specifies the moment conditions and the spreadsheet.
SMB LMH and Mkt_tvw_a are the three risk factors.
any help and suggestion is greatly appreciated.
Thank you very much.
I am new to RATS. I had a hard time implementing GMM in rats.
Basically, I want to estimate an asset pricing model using GMM based on the book of Cochrane:
But i don't know how to properly specify the moment conditions.
It is about implementing a linear factor asset pricing model.
II have nine Fama-French portfolios and three risk factors.
I need to run a time-series regressions to get the coefficient estimates on three risk factors for each of the nine portfolio and the residuals should be orthogonal to the risk factors. This is the first and second moment conditions as in the screenshot of the book.(equation 12.23)
Then i need to run a cross-section regression. that is to regress coefficient estimates from the above regression (which becomes the right hand variables) on the average excess return of the portfolios. this is the third moment conditions.
The reason for using GMM is that the covariance matrix is supposed to take care the generated regressor problem and gives me robust inference.
But i really don't know how to do.
But i am able to specify the first nine time series regression and don't know how to proceed further.
I think what i need to do is to saved the estimated coefficients and the VCV of the parameter estimates and somehow tell rats to use that information in estimating the third moment conditions.
I attaches the the screenshot from cochrane's book where he specifies the moment conditions and the spreadsheet.
SMB LMH and Mkt_tvw_a are the three risk factors.
any help and suggestion is greatly appreciated.
Thank you very much.
- Attachments
-
- gmm1996.xlsx
- (41.69 KiB) Downloaded 761 times
-
- Screen Shot 2013-11-19 at 7.46.57 PM.png (129.44 KiB) Viewed 9132 times
-
- Screen Shot 2013-11-19 at 7.46.29 PM.png (201.19 KiB) Viewed 9132 times
Re: Please help me with the GMM estimation ofasset pricing m
Do you know if he has examples with data for that approach? So far as I can tell, the GMM weight matrix is singular by construction. The program below theoretically does what he describes, but the weight matrix is deficient rank so the estimation doesn't work. (No matter what the values of "lambda" are, there are some linear combinations of the TS conditions and CS conditions which wash out).
Code: Select all
*
* Joint estimation of pricing kernel with three Fama-French factors
*
open data gmm1996.xls
calendar(m) 1996:1
data(format=xls,org=columns) 1996:01 2013:06 smb lmh mkt_tvw_a highfbig_excess highfmedium_excess highfsmall_excess $
LowFBig_excess LowFMedium_excess LowFSmall_excess MedFBig_excess MedFMedium_excess MedFSmall_excess $
Trd_year Trd_month
*
* This sets up the time series regressions to be estimated by non-linear GMM. This
* matches exactly with OLS equation by equation, so is overkill, but it's a useful
* first step.
*
compute np=9
*
dec vect[int] portfolios(np)
compute portfolios=||HighFBig_excess,HighFMedium_excess,HighFSmall_excess,LowFBig_excess,$
LowFMedium_excess,LowFSmall_excess,MedFBig_excess,MedFMedium_excess,MedFSmall_excess||
*
compute nf=3
dec vect[int] factors(nf)
compute factors=||Mkt_tvw_a,Smb,Lmh||
*
dec vect[frml] tserrors(np)
dec rect[frml] tsconditions(nf+1,np)
dec rect tsparms(nf+1,np)
*
do i=1,np
frml tserrors(i) = portfolios(&i){0}-tsparms(1,&i)-tsparms(2,&i)*factors(1){0}-$
tsparms(3,&i)*factors(2){0}-tsparms(4,&i)*factors(3){0}
frml tsconditions(1,i) = tserrors(&i){0}
do j=1,nf
frml tsconditions(j+1,i) = tserrors(&i){0}*factors(&j){0}
end do j
end do i
*
compute tsparms=%zeros(nf+1,np)
nonlin tsparms
instruments constant
*
nlsystem(inst) / tsconditions
*
* Get guess values for the pricing function by averaging across securities.
*
dec vector lambda
compute lambda=%xsubvec(%sumr(tsparms),2,nf+1)
disp "OLS estimates" lambda
*
* Create the cross-section conditions
*
dec vect[frml] csconditions(np)
do i=1,np
frml csconditions(i) = portfolios(&i){0}-lambda(1)*tsparms(2,&i)-$
lambda(2)*tsparms(3,&i)-lambda(3)*tsparms(4,&i)
end do i
*
* Estimate the joint system. This is using a 12 lag Bartlett window to handle the
* (likely) autocorrelation in the moment conditions.
*
nonlin tsparms lambda
nlsystem(inst,lags=12,lwindow=newey,zudep,update=once,swout=sw) / tsconditions csconditions
Re: Please help me with the GMM estimation ofasset pricing m
Thank you so much for the post and sorry for the late reply I didn't receive any email notification, so i thought no body had replied to my post.
Unfortunately, i don't believe that there are examples with data available.
My director told me that maybe this is too hard for me, because i am writing a master thesis. I should try to things that are easier.
So i have been trying to use GMM with the time-series(Assuming SDF is a linear combination of the three risk factors) and compare the
results to the OLS estimates.
I use a modified Fama-French three factor model. The book-to-market risk factor is less relevant in Chinese stock market
I repalce the book-to-market factor with a floating risk factor
mkt_tvw_a(MKT) is the time series of the market risk factor
smb is the time series of the size factor
lmh is the time series of the floating ratio factor
HighFbig, etc are the monthly portfolio returns
I attach a new excel file and the pricing error equation i use to do the GMM.
I would like to use Hansen's optimal weighting matrix and 1 as instruments and Newey-West estimator.
I include the codes, but i don't think that they are right, could you help me with it.
Thank you very much.
Best regards.
Unfortunately, i don't believe that there are examples with data available.
My director told me that maybe this is too hard for me, because i am writing a master thesis. I should try to things that are easier.
So i have been trying to use GMM with the time-series(Assuming SDF is a linear combination of the three risk factors) and compare the
results to the OLS estimates.
I use a modified Fama-French three factor model. The book-to-market risk factor is less relevant in Chinese stock market
I repalce the book-to-market factor with a floating risk factor
mkt_tvw_a(MKT) is the time series of the market risk factor
smb is the time series of the size factor
lmh is the time series of the floating ratio factor
HighFbig, etc are the monthly portfolio returns
I attach a new excel file and the pricing error equation i use to do the GMM.
I would like to use Hansen's optimal weighting matrix and 1 as instruments and Newey-West estimator.
I include the codes, but i don't think that they are right, could you help me with it.
Thank you very much.
Best regards.
- Attachments
-
- GMM.RPF
- (1.42 KiB) Downloaded 1157 times
-
- gmmff3by3_1996.xlsx
- (73.68 KiB) Downloaded 760 times
-
- Screen Shot 2013-12-19 at 12.01.55 AM.png (12.89 KiB) Viewed 9054 times
Re: Please help me with the GMM estimation ofasset pricing m
You want ZUDEP on the NLSYSTEM instruction, but other than that, it looks fine. However, your MedFMedium series isn't right---it looks like net returns rather than gross.