nyblom_test {tstests} | R Documentation |
Nyblom-Hansen Parameter Constancy Test
Description
The parameter constancy test of Nyblom (1989).
Usage
nyblom_test(
x,
scores = NULL,
parameter_names = colnames(scores),
parameter_symbols = NULL,
...
)
Arguments
x |
a series representing the standardized residuals of some estimated model. |
scores |
the log likelihood score matrix. The |
parameter_names |
optional character vector of the parameter names. Usually read off the column names of the score matrix. |
parameter_symbols |
an optional character vector of the latex names of the parameters which can be used when printing using the flextable format. |
... |
not currently used. |
Details
The p-values for the test statistic are based on a pre-computed density, by simulation using equation 3.3 of Nyblom (1989), with up to 40 parameters and saved as an internal data object within the package. A kernel density is used to fit the 10,000 samples of the distribution before extracting the p-values. The original simulation generated more than 100,000 data points but these were compressed to quantiles at intervals of 0.001 in order to keep the package size under 5MB.
Value
An object of class “tstest.nyblom” which has a print and as_flextable method.
References
Nyblom,J. (1989). “Testing for the constancy of parameters over time.” Journal of the American Statistical Association, 84(405), 223–230.
Examples
library(tsgarch)
library(xts)
data("spy")
spyr <- na.omit(diff(log(spy)))
spec <- garch_modelspec(spyr[1:1200], model = "garch", order = c(1,1),
constant = TRUE, distribution = "norm")
mod <- estimate(spec)
test <- nyblom_test(residuals(mod, standardize = TRUE), scores = estfun(mod),
parameter_names = names(coef(mod)),
parameter_symbols = mod$parmatrix[estimate == 1]$symbol)
print(test)