Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fix Required: Cant perform this Rolling Regression, MLE, folows ARMA(1,1), asreg

    HI all,

    I am trying to find the residuals of the following ARMA (1,1): ILLi,t0,i1,i ILLi,t−12,iεi,t−1i,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
    Last edited by SM Muzammil; 31 Jan 2024, 19:49. Reason: asreg, rolling regression, MLE

  • #2
    Not an economist or econometrician so I can’t help further them to point out you’re rolling regression loop is not remotely valid Stata syntax. I don’t know where you got it from but it looks like the kind of crud from a GPT type model.

    asreg is from SSC as you are asked to explain in the FAQ. I also don’t use this so I can’t comment on whether this is how it should work.

    Comment

    Working...
    X