garch
Fit a configurable volatility model from the GARCH family to a series.
The mean model, volatility process, lag orders, power, and innovation distribution
are all configurable. The estimated conditional volatility series is returned; the
fitted parameters and information criteria are attached to OBBject.extra. Best
applied to a return series.
Examples
from openbb import obb
obb.econometrics.garch(column='close', data=[{'date': '2023-01-02', 'open': 110.0, 'high': 120.0, 'low': 100.0, 'close': 115.0, 'volume': 10000.0}, {'date': '2023-01-03', 'open': 165.0, 'high': 180.0, 'low': 150.0, 'close': 172.5, 'volume': 15000.0}, {'date': '2023-01-04', 'open': 146.67, 'high': 160.0, 'low': 133.33, 'close': 153.33, 'volume': 13333.33}, {'date': '2023-01-05', 'open': 137.5, 'high': 150.0, 'low': 125.0, 'close': 143.75, 'volume': 12500.0}, {'date': '2023-01-06', 'open': 132.0, 'high': 144.0, 'low': 120.0, 'close': 138.0, 'volume': 12000.0}])
Parameters
- standard
data: Data | DataFrame | Series | dict | list | list[DataFrame] | list[Data] | list[Series] | ndarray
Input dataset.
column: str
Column to model. Best applied to a return series.
x_columns: list[str]
Exogenous regressor columns for the mean model (used by the 'LS', 'ARX', and 'HARX' mean models).
mean: str
Default: Constant
Mean model: 'Constant' (constant mean), 'Zero' (zero mean), 'LS' (least squares), 'AR'/'ARX' (autoregressive, 'ARX' adds exogenous regressors), 'HAR'/'HARX' (heterogeneous autoregressive).
lags: int
Default: 0
Lag order of the 'AR', 'ARX', 'HAR', and 'HARX' mean models.
vol: str
Default: GARCH
Volatility process: 'GARCH', 'ARCH', 'EGARCH' (exponential GARCH, captures leverage), 'FIGARCH' (fractionally integrated, long memory), 'APARCH' (asymmetric power ARCH), 'HARCH' (heterogeneous ARCH).
p: int
Default: 1
Order of the symmetric ARCH (innovation) term.
o: int
Default: 0
Order of the asymmetric (leverage) term.
q: int
Default: 1
Order of the lagged volatility (GARCH) term.
power: float
Default: 2.0
Power applied to the conditional volatility (2.0 is standard GARCH; other values give power-GARCH and APARCH variants).
distribution: str
Default: normal
Distribution of the model innovations: 'normal' (Gaussian), 't' (Student's t, fat tails), 'skewt' (skewed Student's t), or 'ged' (generalized error distribution).
Returns
results: list[GarchData]
Serializable results.
provider: str
Provider name.
warnings: Optional[list[Warning_]]
List of warnings.
chart: Optional[Chart]
Chart object.
extra: dict[str, Any]
Extra info.
Data
- standard
date: date | datetime | int | str
Observation date (integer position when the input has no date).
conditional_volatility: float
Estimated conditional volatility at the observation.