Class Garch11
java.lang.Object
com.quantfinlib.volatility.Garch11
GARCH(1,1) volatility model (Bollerslev 1986, J. Econometrics 31, 307-327):
h_t = ω + α r_{t-1}² + β h_{t-1} on demeaned returns.
Estimation is full maximum likelihood over (ω, α, β) and, for
Innovation.STUDENT_T, the degrees of freedom ν. The admissible
region ω > 0, α, β ≥ 0, α + β < 1 is mapped onto R³ by
ω = e^{u₀}, α = p·s, β = p·(1−s) with
p = logistic(u₁), s = logistic(u₂), and the negative
log-likelihood is minimised by Nelder-Mead from three starting points.
The recursion starts at h₀ = sample variance of the demeaned
returns (the usual backcast). Standard errors come from the observed
information (numerical Hessian); robust QMLE standard errors from the
Bollerslev-Wooldridge (1992) sandwich, which stay valid when the
innovation is not Gaussian. Both are NaN when the estimate sits on the
boundary and the information matrix is singular.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fitted model with its uncertainty.static final record -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]conditionalVariances(double[] returns, Garch11.Params params) Conditional variance series under the fitted parameters, seeded at the sample variance of the demeaned returns (the same backcast the fit uses).static Garch11.Fitestimate(double[] returns, Innovation innovation) Maximum-likelihood fit with standard errors.static Garch11.Paramsfit(double[] returns) Gaussian maximum-likelihood fit; seeestimate(double[], Innovation).static doubleforecastVariance(double[] returns, Garch11.Params params, int horizon) k-step-ahead variance forecast:h_{T+k} = σ̄² + (α+β)^{k-1} (h_{T+1} - σ̄²)— mean-reverts to the unconditional variance at the persistence rate.
-
Method Details
-
fit
Gaussian maximum-likelihood fit; seeestimate(double[], Innovation). -
estimate
Maximum-likelihood fit with standard errors.- Parameters:
returns- at least 100 finite returns; the sample mean is removed
-
conditionalVariances
Conditional variance series under the fitted parameters, seeded at the sample variance of the demeaned returns (the same backcast the fit uses). -
forecastVariance
k-step-ahead variance forecast:h_{T+k} = σ̄² + (α+β)^{k-1} (h_{T+1} - σ̄²)— mean-reverts to the unconditional variance at the persistence rate.
-