awt_quant.forecast.garch_forecast

GARCH Model Optimization and Volatility Forecasting.

This module finds the best GARCH-like model for a given time series, fits it, and visualizes its conditional volatility.

Classes:
  • GARCHOptimizer: Handles GARCH model selection, fitting, and volatility forecasting.

Usage:

garch = GARCHOptimizer(series, dates_train, ticker) best_model = garch.fit() fig = garch.plot_volatility() fig.show()

Module Contents

class awt_quant.forecast.garch_forecast.GARCHOptimizer(series, dates_train, ticker, plot_vol=True)[source]

A class to find and optimize a GARCH-like model for a given time series.

series[source]

Time series data of asset returns.

Type:

pd.Series

dates_train[source]

Corresponding date index for the series.

Type:

pd.Series

ticker[source]

Stock ticker symbol.

Type:

str

plot_vol[source]

Whether to plot the volatility.

Type:

bool

best_model[source]

The best identified GARCH model.

Type:

str

best_p[source]

Optimal p lag order.

Type:

int

best_q[source]

Optimal q lag order.

Type:

int

fitted_model[source]

The fitted GARCH model.

Type:

arch.univariate.base.ARCHModelResult

series[source]
dates_train[source]
ticker[source]
plot_vol = True[source]
best_model = None[source]
best_p = None[source]
best_q = None[source]
fitted_model = None[source]
fit()[source]

Finds the best GARCH model using Bayesian Information Criterion (BIC).

Returns:

The fitted optimal GARCH model.

Return type:

arch.univariate.base.ARCHModelResult

plot_volatility()[source]

Plots the conditional volatility of the fitted GARCH model.

Returns:

A Plotly figure displaying the volatility plot.

Return type:

plotly.graph_objects.Figure

forecast(horizon=10)[source]

Generates a volatility forecast for the next horizon periods.

Parameters:

horizon (int) – Number of future periods to forecast.

Returns:

A DataFrame with the forecasted conditional variances.

Return type:

pd.DataFrame