I would like to compare the SSR of linear models vs models on logged data. I understand I therefore need to calculate SSR manually, as EViews output the SSR for the transformed variable. I thought I would use the .fit command to do an in sample static forecast in order to get y_hat values and then calculcate residuals, and then square and sum them:
Code: Select all
' linear model
equation lin_model.ls y c @trend ar(1) ar(2)
'calculate ssr from linear model using .fit
lin_model.fit yhat_lin
series res_linsq = (y - yhat_lin)^2
scalar ssr_lin = @sum(res_linsq)
'log model
equation log_model.ls log(y) c @trend ar(1) ar(2)
'calculate ssr from log model using .fit
log_model.fit yhat_log
series res_logsq = (y - yhat_log)^2
scalar ssr_log = @sum(res_logsq) However, I see that when I have estimated an AR(p) model, the p first values generated by .fit is NA. This differs from the values reported in actual/fitted/residuals table for the model, which do not have missing values. Thus, the SSR calculated by Eviews (reported in the regression output) differs from what I can calculate using .fit. My questions then are:
- How are the first p values of y_hat calculated by Eviews when using an AR(p) model, that are reported if I look at actual/fitted/residuals table?
- Can I easily extract the "actual" series from the actual/fitted/residuals table? If so I could use that instead of .fit
- Alternatively, is there a way to get .fit to include predictions for the first p values that are now missing?
Thanks in advance!
