4
$\begingroup$

When it comes to predicting timeseries with ARMA-GARCH, the conditonal mean is modeled using an ARMA process and the conditional variance with a GARCH process.

I've seen tutorials predicting returns as follows:

from arch import arch_model
from statsmodels.tsa.arima_model import ARIMA

returns = ...
arima_model_fitted = ARIMA(returns, order=(3, 0, 2)).fit(method='mle', trend='nc')
p_ = arima_model_fitted.order[0]
o_ = arima_model_fitted.order[1]
q_ = arima_model_fitted.order[2]
archm = arch_model(arima_model_fitted.resid, p=p_, o=o_, q=q_, dist='StudentsT')
arch_model_fitted = archm.fit()

next_return = arch_model_fitted.forecast(horizon=1).mean['h.1'].iloc[-1]

What I think is peculiar is that the fitted GARCH model is used to predict the next return. Doesn't this predict the residual instead of the return?

I would predict the next return as follows:

mu_pred = arima_model_fitted.forecast()[0]
et_pred = arch_model_fitted.forecast(horizon=1).mean['h.1'].iloc[-1]

# yt = mu + et
next_return = mu_pred + et_pred

I am, however, unsure that this is correct.

$\endgroup$
5
  • $\begingroup$ Where did you see this tutorial? Link it if you can.. I would agree with you 100% $\endgroup$
    – Fr1
    Commented Aug 8, 2019 at 14:04
  • 1
    $\begingroup$ It is correct if they write the coded version of next_return=mu_pred+sqrt(Garch)*t_student_innov in which case they would simulate (not predict!) the next return.. but if et_pred is the garch/arch forecasted conditional variance as it seems to be, then the forecast is wrong here.. even if from here I cannot see what “mean[‘h.1’].iloc[-1]” tries to retrieve, that could be key.. $\endgroup$
    – Fr1
    Commented Aug 8, 2019 at 14:08
  • $\begingroup$ From arch.readthedocs.io/en/latest/univariate/…: there's three elements in a ARCHModelForecast. Mean (forecast values cond. mean of the process) , Variance(forecast values cond. var of the process) and Residual Variance (forecast values cond. mean of the residuals). Which I believe still makes the tutorial wrong? $\endgroup$
    – xrdty
    Commented Aug 8, 2019 at 14:36
  • 1
    $\begingroup$ Ok I have seen the docs thanks for linking, yes it was as expected, so it seems like this tutorial is faulty in the last line because et_pred is the best prediction for the squared residuals at time t+1 (y-mu_pred)^2 given the current info set at time t.. so it does not predict y $\endgroup$
    – Fr1
    Commented Aug 8, 2019 at 14:44
  • $\begingroup$ Thanks for your time @Fr1 ! $\endgroup$
    – xrdty
    Commented Aug 8, 2019 at 15:04

1 Answer 1

1
$\begingroup$

You are right, but the proposed method is correct. Residuals is what your first model was not able to capture from the original signal. In this case you re trying to get this residual part by a model with takes into account the conditional heteroskedasticity of the signal. The library not only estimate the parameters for the variance, but also the parametr for the mean of the series, which can be follow a costant, an AR process or other. In this case, it estimates a costant.

In summary you have captures the mean behaviour of the series using an ARIMA model, then you try to estimate what is leaft with the GARCH model, which in this case you assume to be a costant, which is forecasted taking into account that the series is not statioanry in variance.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.