arch.univariate.base.ARCHModelResult.hedgehog_plot¶
-
ARCHModelResult.hedgehog_plot(params: ndarray[tuple[int], dtype[float64]] | Series | None =
None, horizon: int =10, step: int =10, start: int | str | datetime | datetime64 | Timestamp | None =None, plot_type: 'volatility' | 'mean' ='volatility', method: 'analytic' | 'simulation' | 'bootstrap' ='analytic', simulations: int =1000) Figure¶ Plot forecasts from estimated model.
- Parameters:¶
- params: ndarray[tuple[int], dtype[float64]] | Series | None =
None¶ Alternative parameters to use. If not provided, the parameters computed by fitting the model are used. Must be 1-d and identical in shape to the parameters computed by fitting the model.
- horizon: int =
10¶ Number of steps to forecast. Must be positive.
- step: int =
10¶ Number of forecasts to skip between spines. Must be positive.
- start: int | str | datetime | datetime64 | Timestamp | None =
None¶ An integer, datetime or str indicating the first observation to produce the forecast for. Datetimes can only be used with pandas inputs that have a datetime index. Strings must be convertible to a date time, such as in ‘1945-01-01’. If not provided, the start is set to the earliest forecastable date. An integer must be in [-nobs, nobs], and a date must be in the index. A negative integer counts from the end, as in Python indexing, so that
start=-1is the last observation.- plot_type: 'volatility' | 'mean' =
'volatility'¶ Quantity to plot, the forecast volatility or the forecast mean. Not case sensitive.
- method: 'analytic' | 'simulation' | 'bootstrap' =
'analytic'¶ Method to use when producing the forecast. The default is analytic. The method only affects the variance forecast generation. Not all volatility models support all methods. In particular, volatility models that do not evolve in squares such as EGARCH or TARCH do not support the ‘analytic’ method for horizons > 1. For these models, hedgehog_plot raises a ValueError unless horizon is 1 or method is ‘simulation’ or ‘bootstrap’. Not case sensitive.
- simulations: int =
1000¶ Number of simulations to run when computing the forecast using either simulation or bootstrap. Must be positive.
- params: ndarray[tuple[int], dtype[float64]] | Series | None =
- Returns:¶
fig – Handle to the figure.
- Return type:¶
- Raises:¶
TypeError – If
horizon,steporsimulationsis not an integer, orstartis not an integer or a date.ValueError – If
horizon,steporsimulationsis less than 1,paramsdoes not have one finite element for each parameter of the model,startis outside the sample, orplot_typeormethodis not one of the options.
Examples
>>> import pandas as pd >>> from arch import arch_model >>> am = arch_model(None,mean='har',lags=[1,5,22],vol='constant') >>> sim_data = am.simulate([0.1,0.4,0.3,0.2,1.0], 250) >>> sim_data.index = pd.date_range('2000-01-01',periods=250) >>> am = arch_model(sim_data['data'],mean='har',lags=[1,5,22], vol='constant') >>> res = am.fit() >>> fig = res.hedgehog_plot(plot_type='mean')