Warnings and Exceptions¶
The warnings that the package issues are subclasses of Warning that can be
used to filter them using the warnings module. Most are defined in
arch.utility.exceptions.
import warnings
from arch.utility.exceptions import DataScaleWarning
# Do not warn about the scale of the data
warnings.filterwarnings("ignore", category=DataScaleWarning)
The warning about convergence can also be turned off in a single call using
show_warning=False in fit(). The warning
about the scale of the data is not issued when rescale is set when the model is
created.
Univariate Volatility Models¶
- exception arch.utility.exceptions.ConvergenceWarning[source]¶
Issued by
fit()when the optimizer does not report that it has converged, for example because the maximum number of iterations was reached. The message contains the return code of the optimizer and its message. The estimates should not be used without checking them, and it may help to rescale the data, to provide differentstarting_valuesor to increase the number of iterations usingoptions.
- exception arch.utility.exceptions.DataScaleWarning[source]¶
Issued when a model is created using data with a variance that is outside of the range 0.1 to 10,000, which can make the optimization difficult, and
rescaleis not set. The message gives the recommended scale. Setrescale=Trueto rescale the data automatically, which is reported in the results, orrescale=Falseto estimate the model using the data as given.
- exception arch.utility.exceptions.StartingValueWarning[source]¶
Issued by
fit()when thestarting_valuesare not valid for the model, for example because they violate the bounds or the constraints. They are ignored, and the default starting values are used.
- exception arch.utility.exceptions.InitialValueWarning[source]¶
Issued when simulating data, for example using the
simulatemethod of a model, with volatility parameters that are not consistent with a stationary process, so that the unconditional variance is not defined. The initial value of the variance is set to the intercept of the volatility process.
- exception arch.utility.exceptions.ValueWarning[source]¶
Issued when simulating data using
FIGARCHorFIAPARCHwith a value ofbetathat is 1 or larger, so that the long-run variance is not defined. The intercept is used in its place. Subclass ofUserWarning.
Unit Root Tests and Cointegration¶
- exception arch.utility.exceptions.InvalidLengthWarning[source]¶
Issued by
VarianceRatiowhenoverlapisFalseand the number of observations does not allow the data to be divided into an exact number of blocks oflags. The final observations are dropped, and the message says how many.
- exception arch.unitroot.cointegration.CriticalValueWarning[source]¶
Issued by
phillips_ouliaris()when the sample size is smaller than the smallest sample size that was used to construct the tables of critical values, which are approximations. Interpret the results with caution. Subclass ofRuntimeWarning.
- exception arch.utility.exceptions.InfeasibleTestException[source]¶
Raised by the unit root tests when the regression of the test cannot be estimated, for example because the maximum lag length is too large for the number of observations or the series is constant. Reduce
max_lagsor providelags. Subclass ofRuntimeError.
Bootstrapping¶
- exception arch.utility.exceptions.StudentizationError[source]¶
Raised by
conf_intwithmethod="studentized"when the standard error that is estimated by the nested bootstrap is numerically 0 in a replication, for example because the statistic has no variability when the data are resampled. Subclass ofRuntimeError.
Other Warnings¶
- exception arch.utility.exceptions.PerformanceWarning[source]¶
Issued when a function that is compiled using Numba is run without compilation because Numba is not installed, which is much slower. The compiled extensions that are included in the binary releases of the package are used when they are available, and in that case the warning is not issued. Subclass of
UserWarning.