gmm_test {tstests} | R Documentation |
GMM Orthogonality Test
Description
The GMM orthogonality test of Hansen (1982).
Usage
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. |
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
.
Value
An object of class “tstest.gmm” which has a print and as_flextable method.
References
Hansen,L.P. (1982). “Large sample properties of generalized method of moments estimators.” Econometrica, 50(4), 1029–1054.
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)
[Package tstests version 1.0.0 Index]