1

I'm currently facing an issue with GARCH modelling in python. Came across a datascale issue, where y is poorly scaled. Would really appreciate if could get an explanation on the error and perhaps a fix to the issue. GARCH model still runs but with warning messages of no successful convergence.

Error Message

This is the data which I used for my y-values. It is taken from the residual values of an ARIMA model which i did.

Y-dataset

GARCH output:

fit output

GARCH output

*Update After setting rescale=False inequality constraints incompatible

Minimal reproducable example

import pandas_datareader.data as pdr
import numpy as np
import datetime
import arch
from statsmodels.tsa.arima.model import ARIMA


#Extract Data, create column log returns
eurusd = pdr.DataReader('DEXUSEU', 'fred', start='1/1/2010', end='31/12/2019')
eurusd.index = pd.DatetimeIndex(eurusd.index).to_period('D')
eurusd = eurusd.to_timestamp()

eurusd['LR'] = np.log(eurusd) - np.log(eurusd.shift(1))

# ARIMA model
arima_model = ARIMA(eurusd.LR.dropna(), order=(1,0,1)).fit()
print(arima_model.summary())

# GARCH model
am = arch.arch_model(arima_model.resid)
res = am.fit()
print(res.summary())

Heading

Anthony
  • 25
  • 1
  • 4
  • The warning message contains suggestions; have you tried any of them? – Warren Weckesser Sep 06 '21 at 13:40
  • It will be easier for someone to help you if you provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). – Warren Weckesser Sep 06 '21 at 13:41
  • Could you explain more on 'rescale' or what i means by y being poorly scaled. – Anthony Sep 06 '21 at 13:44
  • Apparently the [variance](https://en.wikipedia.org/wiki/Variance) of the data that you passed to the ARCH model is 8.307e-6. A suggestion in the warning is to multiply your data by 1000 before processing it with ARCH. – Warren Weckesser Sep 06 '21 at 14:04
  • Will try the following, it seems that it has solved the issue with convergence. Just curious would there be any problems with forecasting, estimation or accuracy with those errors? – Anthony Sep 06 '21 at 14:19

0 Answers0