ARMA-GARCH, overwrite loglike in SARIMAX?

40 views
Skip to first unread message

josef...@gmail.com

unread,
Jan 5, 2017, 11:20:56 AM1/5/17
to pystatsmodels
but also to robust estimation for tsa

The main question (mainly for Chad):
Can we overwrite the loglikelihood function to e.g. include weights or use a different distribution like t?


I thought about this in the context of estimation that is robust to outliers or heavy-tailed innovation distributions, but variance weights could also be used to get a more efficient estimator in cases of heteroscedasticity like ARMA-GARCH or SARIMAX-GARCH.
(The weights enhancement discussion uses GLM as focus model, and I have not looked at tsa yet.)

Based on a brief search, it looks like loglike/loglikeobs is defined deep inside the cython code for the kalman filter and statespace models.

If the statespace models or kalman filter just calculate the residuals or innovations, then it should be possible to compute the loglike in vectorized form for the optimization, and this shouldn't be much slower than the current cython code.

which was an early experiment of mine (before kalman filters in statsmodels) to just overwrite the loglike from normal to t distribution.


(I haven't looked at GARCH in 6 to 8 years, AFAIR.)

Josef






Chad Fulton

unread,
Jan 6, 2017, 9:31:15 AM1/6/17
to Statsmodels Mailing List
To the narrow question of whether the loglikelihood can be overridden in state space models: yes, it definitely can. As you say, the residuals and their covariance are available after a call to filter, so a vectorized computation is possible.

To the larger point, I haven't spent much time on GARCH or heavy tails, so I don't know very much.

It would be nice to even pull the loglikelihood computation out of the Cython in the base case, although some of the reason it is in there is to allow for low-memory filtering (where we do not store the output matrices).

josef...@gmail.com

unread,
Jan 6, 2017, 10:13:33 AM1/6/17
to pystatsmodels
If the cython internal loglikelihood calculation can be turned off or avoided when overwriting the loglike and related methods, then it would not be necessary to pull the loglikelihood computation out of cython, so the low memory option can still be used.

Heavy-tails are not so common in macroeconomics, but, AFAIK, are a "stylized fact" of finance data, even if people still use the normality assumption
(One of my favorite stories when I was still doing/teaching some finance https://www.wired.com/2009/02/wp-quant/ which however refers to tail dependence not only to directly to heavy tails.)

A kind of TSARIMAX might be a relatively simple but useful test case, because the basic version would just overwrite the loglike. For fixed degrees of freedom it doesn't have an additional parameter to estimate, and t(3) or t(5) would be a good way to downweight large residuals that can have an effect on parameter estimates like outliers in small samples even though they are part of the distribution.

(Using t distribution for multivariate endog might be more difficult because we also have to adjust covariance computations which might be more directly in the kalman filter, I never checked.)

Josef




Reply all
Reply to author
Forward
0 new messages