gmm_test function

GMM Orthogonality Test

GMM Orthogonality Test

The GMM orthogonality test of Hansen (1982).

gmm_test(x, lags = 1, skewness = 0, kurtosis = 3, ...)

Arguments

  • x: a series representing the standardized residuals of some estimated model.
  • lags: the lags for the co-moment test.
  • skewness: the skewness of the estimated model residuals.
  • kurtosis: the kurtosis of the estimated model residuals.
  • ...: not currently used.

Returns

An object of class tstest.gmm which has a print and as_flextable method.

Details

For parametric models estimated with a particular distribution, the skewness and kurtosis should flow from the distributional model. See for example dskewness and dkurtosis.

Examples

library(tsgarch) library(tsdistributions) library(data.table) library(xts) data("spy") spyr <- na.omit(diff(log(spy))) spec <- garch_modelspec(spyr, model = "egarch", order = c(2,1), constant = TRUE, distribution = "jsu") mod <- estimate(spec) skewness <- dskewness("jsu", skew = coef(mod)["skew"], shape = coef(mod)["shape"]) # kurtosis is dkurtosis is the excess over the Normal (3) so we add back 3 # since the test takes the actual not excess kurtosis. kurtosis <- dkurtosis("jsu", skew = coef(mod)["skew"], shape = coef(mod)["shape"]) + 3 test <- gmm_test(residuals(mod, standardize = TRUE), lags = 2, skewness = skewness, kurtosis = kurtosis) print(test, collapse = TRUE, include.decision = TRUE)

References

\insertRef Hansen1982tstests

  • Maintainer: Alexios Galanos
  • License: GPL-2
  • Last published: 2024-10-24