archette
Let's build arch-like models from scratch.
This includes model specification, maximum likelihood estimation, etc.
The current implementation is to use numpy for array manipulations, scipy for optimization of objectives,
and numba for acceleration.
TODO: reduce dependency to jax alone, with optimization done by hand (gradient descent and the likes) in place of the high level API of scipy.optimize.
API Reference
archette.garch.GARCH
GARCH(1,1) model
Source code in archette/garch.py
vs
cached
property
conditional variance based on the fit parameters. Must call the fit method first before accessing this property
| RETURNS | DESCRIPTION |
|---|---|
ndarray
|
estimated conditional variance at each time point |
std_resids
cached
property
standardized residual based on the fit parameters. Must call the fit method first before accessing this property
| RETURNS | DESCRIPTION |
|---|---|
ndarray
|
estimated standardized residual at each time point |
fit
fit a GARCH(1,1) model with MLE (assuming Gaussian noise)
| PARAMETER | DESCRIPTION |
|---|---|
y
|
observed time series
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
GARCH
|
self |
Source code in archette/garch.py
nll
negative log likelihood of the series at the given params
| PARAMETER | DESCRIPTION |
|---|---|
params
|
[omega, alpha, beta]
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
negative log likelihood |
Source code in archette/garch.py
forecast_vs
forecast conditional variance in the horizon (future)
| PARAMETER | DESCRIPTION |
|---|---|
horizon
|
forecast horizon
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ndarray
|
forecasted conditional variance |
Source code in archette/garch.py
simulate
simulate paths from the fitted model
| PARAMETER | DESCRIPTION |
|---|---|
horizon
|
path length
TYPE:
|
method
|
"bootstrap" or "simulate" (generate new noise)
TYPE:
|
n_rep
|
number of repetitions
TYPE:
|
seed
|
random seed
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ndarray
|
simulated paths |