As part of my Master's thesis, I am trying to create a moment condition in a GMM that maps a cross-sectional regression. I have 12 portfolios that serve as dependent variables and 2 factors (of systematic risk whose premium I try to estimate via a GMM similar to Cochrane 2005) that serve as independent variables.
My model takes the form :
Ri = Alpha i + Bi(Market_Return)+ Di(DEF_Factor)
where Ri is the return on portfolio i, Market_Return is the excess return on the market portfolio and DEF_factor is just the factor that I use to augment the CAPM.
More concretely, the first moment conditions allow me to estimate the intercept and the coefficients of my factors as time series OLS estimates for each portfolio. So far, I'm doing fine.
But the last moment conditions are supposed to represent a cross-sectional regression. In the last lines of my code, Re should be a 12x1 vector of the returns of the 12 portfolios in month t. b and d should be 12x1 vectors of the coefficients obtained with the first moment conditions and the estimated lambda will correspond to the premium of each factor I am trying to estimate.
This is the code I use. The first moment conditions are good, I put the last ones for the last moment conditions as an example.
In order for Re to correspond to what I am trying to do, I would need to know if it is possible to create a variable where each monthly observation is a vector of the returns over the month made by the 12 portfolios.
Then, b and d should be vectors representing the 12 coefficients estimated in the first step (b1,b2,...,b12,d1,d2,...d12).
Is this possible in Stata? Or is there another way around my problem?
Here is an example of my data, the variables that start with B and S are the 12 portfolios I work with.
My model takes the form :
Ri = Alpha i + Bi(Market_Return)+ Di(DEF_Factor)
where Ri is the return on portfolio i, Market_Return is the excess return on the market portfolio and DEF_factor is just the factor that I use to augment the CAPM.
More concretely, the first moment conditions allow me to estimate the intercept and the coefficients of my factors as time series OLS estimates for each portfolio. So far, I'm doing fine.
But the last moment conditions are supposed to represent a cross-sectional regression. In the last lines of my code, Re should be a 12x1 vector of the returns of the 12 portfolios in month t. b and d should be 12x1 vectors of the coefficients obtained with the first moment conditions and the estimated lambda will correspond to the premium of each factor I am trying to estimate.
This is the code I use. The first moment conditions are good, I put the last ones for the last moment conditions as an example.
Code:
gmm ( BHh - {a1} -Mkt_Rf* {b1} - DEF_Factor*{d1}) (BHl - {a2} - Mkt_Rf* {b2} - DEF_Factor*{d2}) (BHm - {a3}- Mkt_Rf* {b3} - DEF_Factor *{d3} ) (BLh - {a4} - Mkt_Rf* {b4} - DEF_Factor*{d4}) (BLl - {a5} - Mkt_Rf* {b5} - DEF_Factor*{d5}) (BLm - {a6} - Mkt_Rf* {b6} - DEF_Factor*{d6}) (SHh - {a7} - Mkt_Rf* {b7} - DEF_Factor*{d7}) (SHl - {a8} - Mkt_Rf* {b8} - DEF_Factor*{d8}) (SHm - {a9} - Mkt_Rf* {b9} - DEF_Factor*{d9}) (SLh - {a10} - Mkt_Rf* {b10} - DEF_Factor*{d10}) (SLl - {a11} - Mkt_Rf* {b11} - DEF_Factor*{d11}) (SLm - {a12}- Mkt_Rf* {b12} - DEF_Factor*{d12})// The first moment conditions to estimate the coefficients as time series OLS estimates for each portfolio
(Re - {b}*{lambda_m}) (Re - {d}*{lambda_d})// The last moment conditions
, instruments(1 2 3 4 5 6 7 8 9 10 11 12 : Mkt_Rf DEF_Factor) winitial(identity) vce(robust)
Then, b and d should be vectors representing the 12 coefficients estimated in the first step (b1,b2,...,b12,d1,d2,...d12).
Is this possible in Stata? Or is there another way around my problem?
Here is an example of my data, the variables that start with B and S are the 12 portfolios I work with.
Code:
input float(months BHh BHl BHm BLh BLl BLm SHh SHl SHm SLh SLl SLm Mkt_Rf DEF_Factor) 507 -.06308237 .020132286 -.0884329 -.1184433 -.03412001 -.0828582 -.09492547 .018215122 -.05384039 -.03062054 -.03703001 -.05116905 -.08428764 -.07813185 508 -.14808667 -.07259968 -.1106821 -.27025634 -.09846856 -.12549312 -.16995627 -.06209308 -.1266427 -.2154937 -.04425187 -.16134925 -.06315205 -.10484485 509 -.06261309 -.06242198 -.15799314 -.21480024 -.1143972 -.2108242 -.06384285 -.07492935 -.07474729 -.1798431 -.10416538 -.11460046 -.1107862 -.027223393 end

Comment