HI all,
I am trying to find the residuals of the following ARMA (1,1): ILLi,t =α0,i +α1,i ILLi,t−1+α2,iεi,t−1+εi,t,
ILL is an illiquidity measure.
The parameters required estimated via MLE using a 12-month rolling sample.
My main motive here is to get the residuals.
Been trying this code but this isn't helping;
local rolling_window 24
forvalues i = `rolling_window' / `=_N' {
local start_obs = `=_N' - `i' + 1
local end_obs = `=_N' - `i' + `rolling_window'
arima ILL[`start_obs'/`end_obs'], arima(1,0,1) noconstant
predict fitted_values[`start_obs'/`end_obs'], xb
gen residuals[`start_obs'/`end_obs'] = ILL[`start_obs'/`end_obs'] - fitted_values[`start_obs'/`end_obs']
}
The above isn't working
have also tries asreg:
bys ID : asreg ILL L.ILL L.Residuals, wind( mofd 12)
but it is returning this error "factor variables and time-series operators not allowed"
Please can anyone help me in this.
Thanks
I am trying to find the residuals of the following ARMA (1,1): ILLi,t =α0,i +α1,i ILLi,t−1+α2,iεi,t−1+εi,t,
ILL is an illiquidity measure.
The parameters required estimated via MLE using a 12-month rolling sample.
My main motive here is to get the residuals.
Been trying this code but this isn't helping;
local rolling_window 24
forvalues i = `rolling_window' / `=_N' {
local start_obs = `=_N' - `i' + 1
local end_obs = `=_N' - `i' + `rolling_window'
arima ILL[`start_obs'/`end_obs'], arima(1,0,1) noconstant
predict fitted_values[`start_obs'/`end_obs'], xb
gen residuals[`start_obs'/`end_obs'] = ILL[`start_obs'/`end_obs'] - fitted_values[`start_obs'/`end_obs']
}
The above isn't working
have also tries asreg:
bys ID : asreg ILL L.ILL L.Residuals, wind( mofd 12)
but it is returning this error "factor variables and time-series operators not allowed"
Please can anyone help me in this.
Thanks
Comment