Dear Statalist,
I am trying to fit a linear regression model by using the Kalman filter in Stata 12.
Since this is the first time for me working with state-space models and the Kalman filter I’m having trouble to set up the correct Stata code.
The model to be estimated:
Time series of asset returns are regressed on market return and interest return, plus a white noise error term.
The coefficients Beta0, Beta1 and Beta2 are to be estimated via Kalman Filter.
Stata Code used so far:
Stata output:
Questions:
Any help is greatly appreciated!
Kind Regards
Carl
I am trying to fit a linear regression model by using the Kalman filter in Stata 12.
Since this is the first time for me working with state-space models and the Kalman filter I’m having trouble to set up the correct Stata code.
The model to be estimated:
Code:
Asset_Return = Beta0 + Beta1 * Market_Return + Beta2 * Interest_Return + Error_Term
The coefficients Beta0, Beta1 and Beta2 are to be estimated via Kalman Filter.
Stata Code used so far:
Code:
constraint define 1 [MB] L.MB = 1 /// Beta1 modelled as random walk constraint define 2 [ZB] L.ZB = 1 /// Beta2 modelled as random walk sspace (MB L.MB, state noconstant) /// State Equation for Beta1 (ZB L.ZB, state noconstant) /// State Equation for Beta2 (AssetReturn MB ZB MarketReturn InterestReturn /*, noconstant*/), /// Observation Equation covstate (diagonal) constraints (1 2) predict Betas_V3, state equation(MB) smethod(filter) rmse(RMSE_V3) predict Betas_V4, state equation(ZB) smethod(filter) rmse(RMSE_V4)
Stata output:
Questions:
- Is this the correct Stata code to estimate the model mentioned above? If not, what would the correct code look like?
I am not sure how to account for the regressors / independent variables Market_Return and Interest Return in a correct way and how to link them to Beta1 and Beta2. Did I do it right? - I expected to obtain the series of coefficients for Beta1 and Beta2 by the two -predict- commands.
In which way do they differ from the coefficients reported in the -sspace- output or what are those coefficients from the -sspace- ouput referring to at all? - Is it correct not to use a third state equation for modelling the constant Beta0, since the underlying process of the constant Beta0 is not a stochastic process and therefore the constant Beta0 is modelled by including a constant in the observation equation?
Any help is greatly appreciated!
Kind Regards
Carl
Comment