| Type: | Package |
| Title: | Quadratic GARCH-in-Mean Models for Volatility Feedback |
| Version: | 0.1.0 |
| 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. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| Depends: | R (≥ 4.1.0) |
| Imports: | MASS |
| Suggests: | testthat (≥ 3.0.0) |
| LazyData: | true |
| URL: | https://github.com/sho-125/qgarch |
| BugReports: | https://github.com/sho-125/qgarch/issues |
| Config/testthat/edition: | 3 |
| Config/roxygen2/version: | 8.0.0 |
| NeedsCompilation: | no |
| Packaged: | 2026-05-05 03:06:02 UTC; sho125 |
| Author: | Jedrzej Bialkowski [aut], Sanghyun Hong [aut, cre], Moritz Wagner [aut] |
| Maintainer: | Sanghyun Hong <sanghyun.hong@canterbury.ac.nz> |
| Repository: | CRAN |
| Date/Publication: | 2026-05-07 16:41:03 UTC |
Extract coefficients from a qgarch model
Description
Extract coefficients from a qgarch model
Usage
## S3 method for class 'qgarch'
coef(object, ...)
Arguments
object |
A fitted |
... |
Additional arguments. Supports |
Value
A named numeric vector of coefficients.
Fitted values from a qgarch model
Description
Fitted values from a qgarch model
Usage
## S3 method for class 'qgarch'
fitted(object, ...)
Arguments
object |
A fitted |
... |
Unused. |
Value
A numeric vector of fitted values.
Log-likelihood for a qgarch model
Description
Log-likelihood for a qgarch model
Usage
## S3 method for class 'qgarch'
logLik(object, ...)
Arguments
object |
A fitted |
... |
Unused. |
Value
An object of class "logLik".
Plot a qgarch model
Description
Plot a qgarch model
Usage
## S3 method for class 'qgarch'
plot(x, which = c("sigma2", "standardized"), ...)
Arguments
x |
A fitted |
which |
Which plot to show: |
... |
Additional graphical arguments passed to |
Value
The input object, invisibly.
Forecast from a generalized qgarch(m, n) model
Description
Forecast from a generalized qgarch(m, n) model
Usage
## S3 method for class 'qgarch'
predict(object, n.ahead = 1L, ...)
Arguments
object |
A fitted |
n.ahead |
Number of periods ahead to forecast. |
... |
Unused. |
Value
A data frame with forecast horizon, conditional mean, conditional variance, and conditional standard deviation.
Print a qgarch model
Description
Print a qgarch model
Usage
## S3 method for class 'qgarch'
print(x, digits = max(3L, getOption("digits") - 2L), ...)
Arguments
x |
A fitted |
digits |
Number of digits to print. |
... |
Unused. |
Value
The input object, invisibly.
Print a qgarch summary
Description
Print a qgarch summary
Usage
## S3 method for class 'summary.qgarch'
print(x, digits = max(3L, getOption("digits") - 2L), ...)
Arguments
x |
An object of class |
digits |
Number of digits to print. |
... |
Unused. |
Value
The input object, invisibly.
Default starting values for qgarch estimation
Description
Creates a compact but order-adaptive set of starting values for the selected qgarch model.
Usage
qgarch_default_starts(
x,
model = c("zero", "restricted", "free", "threshold"),
arch_order = 1L,
garch_order = 1L
)
Arguments
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. |
Value
A list of named numeric vectors containing candidate starting values.
Fit generalized qgarch(m, n) models
Description
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.
Usage
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")
)
Arguments
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 |
Value
An object of class "qgarch".
Likelihood ratio test for nested qgarch models
Description
Compares two fitted qgarch models using the likelihood ratio test.
Usage
qgarch_lr_test(restricted, unrestricted, df = NULL)
Arguments
restricted |
A fitted |
unrestricted |
A fitted |
df |
Degrees of freedom for the test. If |
Value
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").
Compute sample moments for a series
Description
Computes the sample mean, variance, skewness, and excess kurtosis for a numeric series, along with simple standard errors.
Usage
qgarch_moments(x, scale_mean_variance = 1)
Arguments
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. |
Value
A list with elements:
- estimate
Named numeric vector of moment estimates.
- std_error
Named numeric vector of standard errors.
- n
Number of usable observations.
The returned object has class "qgarch_moments".
Residuals from a qgarch model
Description
Residuals from a qgarch model
Usage
## S3 method for class 'qgarch'
residuals(object, type = c("raw", "standardized", "eta"), ...)
Arguments
object |
A fitted |
type |
Type of residuals to return: |
... |
Unused. |
Value
A numeric vector of residuals.
Summarize a qgarch model
Description
Summarize a qgarch model
Usage
## S3 method for class 'qgarch'
summary(object, ...)
Arguments
object |
A fitted |
... |
Unused. |
Value
An object of class "summary.qgarch".
Monthly U.S. data
Description
Monthly data used in examples and tests for the qgarch package.
Usage
us_monthly
Format
A data frame with monthly observations and 3 variables:
- YearMon
Month of the observation.
- Mktrf
Market excess return.
- ER
Excess return series.
Source
Prepared by the package author.
Variance-covariance matrix for a qgarch model
Description
Variance-covariance matrix for a qgarch model
Usage
## S3 method for class 'qgarch'
vcov(object, ...)
Arguments
object |
A fitted |
... |
Unused. |
Value
A variance-covariance matrix.