x: a series representing the standardized residuals of some estimated model.
scores: the log likelihood score matrix. The estfun method if exported by a package for a model will return this matrix.
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.
Returns
An object of class tstest.nyblom which has a print and as_flextable method.
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.
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)