| Title: | Quadratic GARCH-in-Mean Models for Volatility Feedback |
|---|---|
| Description: | Fits quadratic generalized autoregressive conditional heteroskedasticity-in-mean (QGARCH-M) models motivated by Campbell and Hentschel (1992). The package supports models with lambda fixed at zero, lambda restricted to a function of the remaining parameters, lambda estimated freely, and a threshold extension with state-dependent lambda. It also provides tools for starting values, estimation, forecasting, likelihood-ratio testing, moment diagnostics, and replication with the included monthly U.S. stock market dataset. |
| Authors: | Jedrzej Bialkowski [aut], Sanghyun Hong [aut, cre], Moritz Wagner [aut] |
| Maintainer: | Sanghyun Hong <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-07 20:19:01 UTC |
| Source: | https://github.com/cran/qgarch |
Extract coefficients from a qgarch model
## S3 method for class 'qgarch' coef(object, ...)## S3 method for class 'qgarch' coef(object, ...)
object |
A fitted |
... |
Additional arguments. Supports |
A named numeric vector of coefficients.
Fitted values from a qgarch model
## S3 method for class 'qgarch' fitted(object, ...)## S3 method for class 'qgarch' fitted(object, ...)
object |
A fitted |
... |
Unused. |
A numeric vector of fitted values.
Log-likelihood for a qgarch model
## S3 method for class 'qgarch' logLik(object, ...)## S3 method for class 'qgarch' logLik(object, ...)
object |
A fitted |
... |
Unused. |
An object of class "logLik".
Plot a qgarch model
## S3 method for class 'qgarch' plot(x, which = c("sigma2", "standardized"), ...)## S3 method for class 'qgarch' plot(x, which = c("sigma2", "standardized"), ...)
x |
A fitted |
which |
Which plot to show: |
... |
Additional graphical arguments passed to |
The input object, invisibly.
Forecast from a generalized qgarch(m, n) model
## S3 method for class 'qgarch' predict(object, n.ahead = 1L, ...)## S3 method for class 'qgarch' predict(object, n.ahead = 1L, ...)
object |
A fitted |
n.ahead |
Number of periods ahead to forecast. |
... |
Unused. |
A data frame with forecast horizon, conditional mean, conditional variance, and conditional standard deviation.
Print a qgarch model
## S3 method for class 'qgarch' print(x, digits = max(3L, getOption("digits") - 2L), ...)## S3 method for class 'qgarch' print(x, digits = max(3L, getOption("digits") - 2L), ...)
x |
A fitted |
digits |
Number of digits to print. |
... |
Unused. |
The input object, invisibly.
Print a qgarch summary
## S3 method for class 'summary.qgarch' print(x, digits = max(3L, getOption("digits") - 2L), ...)## S3 method for class 'summary.qgarch' print(x, digits = max(3L, getOption("digits") - 2L), ...)
x |
An object of class |
digits |
Number of digits to print. |
... |
Unused. |
The input object, invisibly.
Creates a compact but order-adaptive set of starting values for the selected qgarch model.
qgarch_default_starts( x, model = c("zero", "restricted", "free", "threshold"), arch_order = 1L, garch_order = 1L )qgarch_default_starts( x, model = c("zero", "restricted", "free", "threshold"), arch_order = 1L, garch_order = 1L )
x |
A numeric vector or one-column data frame containing the observed series. |
model |
Character string specifying the model variant. Must be one of
|
arch_order |
Positive integer giving the ARCH lag order. |
garch_order |
Positive integer giving the GARCH lag order. |
A list of named numeric vectors containing candidate starting values.
Fits QGARCH-in-mean models using nonlinear minimization of the negative log-likelihood. Four variants are supported: a zero-lambda model, a restricted-lambda model, a free-lambda model, and a threshold model with state-dependent lambda.
qgarch_fit( x, model = c("zero", "restricted", "free", "threshold"), arch_order = 1L, garch_order = 1L, threshold_indicator = NULL, start = NULL, rho = 1, steptol = 1e-10, typsize = 0.1, iterlim = 300L, print.level = 0, hessian = TRUE, vcov_type = c("auto", "sandwich", "hessian", "opg", "none") )qgarch_fit( x, model = c("zero", "restricted", "free", "threshold"), arch_order = 1L, garch_order = 1L, threshold_indicator = NULL, start = NULL, rho = 1, steptol = 1e-10, typsize = 0.1, iterlim = 300L, print.level = 0, hessian = TRUE, vcov_type = c("auto", "sandwich", "hessian", "opg", "none") )
x |
A numeric vector or one-column data frame containing the observed series. The series must contain only finite, non-missing values. |
model |
Character string specifying the model variant. Must be one of
|
arch_order |
Positive integer giving the ARCH lag order |
garch_order |
Positive integer giving the GARCH lag order |
threshold_indicator |
Optional threshold indicator used only when
|
start |
Optional starting values. May be |
rho |
Scalar used in the restricted-lambda mapping. |
steptol |
Step tolerance passed to |
typsize |
Typical size passed to |
iterlim |
Maximum number of iterations passed to |
print.level |
Print level passed to |
hessian |
Logical; should the Hessian be returned by |
vcov_type |
Character string controlling standard-error estimation.
One of |
An object of class "qgarch".
Compares two fitted qgarch models using the likelihood ratio test.
qgarch_lr_test(restricted, unrestricted, df = NULL)qgarch_lr_test(restricted, unrestricted, df = NULL)
restricted |
A fitted |
unrestricted |
A fitted |
df |
Degrees of freedom for the test. If |
A data frame with the likelihood ratio statistic, degrees of freedom,
p-value, and the model names. The returned object has class
c("qgarch_lr_test", "data.frame").
Computes the sample mean, variance, skewness, and excess kurtosis for a numeric series, along with simple standard errors.
qgarch_moments(x, scale_mean_variance = 1)qgarch_moments(x, scale_mean_variance = 1)
x |
A numeric vector or a one-column data frame containing the series. |
scale_mean_variance |
A finite scalar used to rescale the reported mean and variance and their standard errors. |
A list with elements:
Named numeric vector of moment estimates.
Named numeric vector of standard errors.
Number of usable observations.
The returned object has class "qgarch_moments".
Residuals from a qgarch model
## S3 method for class 'qgarch' residuals(object, type = c("raw", "standardized", "eta"), ...)## S3 method for class 'qgarch' residuals(object, type = c("raw", "standardized", "eta"), ...)
object |
A fitted |
type |
Type of residuals to return: |
... |
Unused. |
A numeric vector of residuals.
Summarize a qgarch model
## S3 method for class 'qgarch' summary(object, ...)## S3 method for class 'qgarch' summary(object, ...)
object |
A fitted |
... |
Unused. |
An object of class "summary.qgarch".
Monthly data used in examples and tests for the qgarch package.
us_monthlyus_monthly
A data frame with monthly observations and 3 variables:
Month of the observation.
Market excess return.
Excess return series.
Prepared by the package author.
Variance-covariance matrix for a qgarch model
## S3 method for class 'qgarch' vcov(object, ...)## S3 method for class 'qgarch' vcov(object, ...)
object |
A fitted |
... |
Unused. |
A variance-covariance matrix.