arch.univariate.base.ARCHModel.fit¶
-
ARCHModel.fit(update_freq: int =
1, disp: 'off' | 'final' | bool ='final', starting_values: ndarray[tuple[int], dtype[float64]] | Series | None =None, cov_type: 'robust' | 'classic' ='robust', show_warning: bool =True, first_obs: int | str | datetime | datetime64 | Timestamp | None =None, last_obs: int | str | datetime | datetime64 | Timestamp | None =None, tol: float | None =None, options: dict[str, Any] | None =None, backcast: float | ndarray[tuple[int], dtype[float64]] | None =None) ARCHModelResult[source]¶ Estimate model parameters.
- Parameters:¶
- update_freq: int =
1¶ Frequency of iteration updates. Output is generated every update_freq iterations. Set to 0 to disable iterative output. Must not be negative.
- disp: 'off' | 'final' | bool =
'final'¶ Either ‘final’ to print optimization result or ‘off’ to display nothing. Not case sensitive. If using a boolean, False is “off” and True is “final”. The integers 0 and 1 are accepted as booleans.
- starting_values: ndarray[tuple[int], dtype[float64]] | Series | None =
None¶ Array of starting values to use. If not provided, starting values are constructed by the model components. Must have one finite element for each parameter of the model. Starting values that do not satisfy the constraints and bounds of the model are ignored, and a StartingValueWarning is issued.
- cov_type: 'robust' | 'classic' =
'robust'¶ Estimation method of parameter covariance. Supported options are ‘robust’, which does not assume the Information Matrix Equality holds and ‘classic’ which does. In the ARCH literature, ‘robust’ corresponds to Bollerslev-Wooldridge covariance estimator. Not case sensitive. Any other value raises a ValueError.
- show_warning: bool =
True¶ Flag indicating whether convergence warnings should be shown.
- first_obs: int | str | datetime | datetime64 | Timestamp | None =
None¶ First observation to use when estimating model. Dates, strings and periods can only be used with pandas inputs that have a DatetimeIndex or a PeriodIndex. An integer must be in [-nobs, nobs], and a date must be in the index. A negative integer counts from the end, as in a slice, so that
first_obs=-100uses the last 100 observations.- last_obs: int | str | datetime | datetime64 | Timestamp | None =
None¶ Last observation to use when estimating model. An integer must be in [-nobs, nobs], and a date must be in the index. As in a slice, the observation at
last_obsis not used, and a negative integer counts from the end, so thatlast_obs=-1drops the last observation.- tol: float | None =
None¶ Tolerance for termination. Must not be negative.
- options: dict[str, Any] | None =
None¶ Options to pass to scipy.optimize.minimize. Valid entries include ‘ftol’, ‘eps’, ‘disp’, and ‘maxiter’.
- backcast: float | ndarray[tuple[int], dtype[float64]] | None =
None¶ Value to use as backcast. Should be measure \(\sigma^2_0\) since model-specific non-linear transformations are applied to value before computing the variance recursions. A float must be positive, and an array must contain finite values.
- update_freq: int =
- Returns:¶
results – Object containing model results.
- Return type:¶
- Raises:¶
RuntimeError – If the model was created without data.
TypeError – If an argument is not of the documented type, for example a float for
update_freqordisp.ValueError – If
update_freqis negative,tolis negative or not finite,backcastis not positive and finite,starting_valuesdoes not have one finite element for each parameter,first_obsorlast_obsis outside the sample,cov_typeordispis not one of the options (dispcan also be an integer other than 0 and 1), or the model has more parameters than the number of observations used to estimate it.
Notes
A ConvergenceWarning is raised if SciPy’s optimizer indicates difficulty finding the optimum.
Parameters are optimized using SLSQP.