| EvalTest | R Documentation |
EvalTest provides post-estimation evaluation tests for an estimated PSTR model.
It supports two null hypotheses:
No time variation in parameters (labelled "time-varying").
No remaining nonlinearity/heterogeneity given a candidate transition variable (labelled "heterogeneity").
EvalTest(use, type = c("time-varying", "heterogeneity"), vq = NULL)
WCB_TVTest(use, iB = 100, parallel = FALSE, cpus = 4)
WCB_HETest(use, vq, iB = 100, parallel = FALSE, cpus = 4)
use |
An object of class |
type |
Character vector. Which evaluation tests to run in |
vq |
Numeric vector. Candidate transition variable used by the no remaining nonlinearity
test. Required if |
iB |
Integer. Number of bootstrap replications. Default is |
parallel |
Logical. Whether to use parallel computation (via the snowfall backend). |
cpus |
Integer. Number of CPU cores used if |
Wild bootstrap (WB) and wild cluster bootstrap (WCB) versions are available via
WCB_TVTest (parameter constancy) and WCB_HETest (no remaining nonlinearity).
Two equivalent interfaces are available for each test:
Wrapper function, for example EvalTest(use = obj, ...).
R6 method, for example obj$EvalTest(...).
Each wrapper calls the corresponding R6 method and returns use invisibly.
The bootstrap variants are computationally intensive. WB is robust to heteroskedasticity,
while WCB is additionally robust to within-individual dependence (cluster dependence).
Parallel execution can be enabled via parallel and cpus.
Invisibly returns use with evaluation results added.
tvA list of parameter-constancy (time-varying) test results, one element per m.
htA list of no remaining nonlinearity (heterogeneity) test results, one element per m.
wcb_tvA numeric matrix of WB/WCB p-values for parameter-constancy tests (one row per m).
wcb_htA numeric matrix of WB/WCB p-values for no remaining nonlinearity tests (one row per m).
The individual list elements in tv and ht contain LM-type test statistics and
p-values (including HAC variants), consistent with the output from LinTest.
NewPSTR, LinTest, WCB_LinTest,
EstPSTR.
pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20,
indep_k = c("vala","debta","cfa","sales"),
tvars = c("vala"), iT = 14)
# estimate first
pstr <- EstPSTR(use = pstr, im = 1, iq = 1, useDelta = TRUE, par = c(.63, 0), method = "CG")
# evaluation tests
pstr <- EvalTest(
use = pstr,
type = c("time-varying","heterogeneity"),
vq = as.matrix(Hansen99[,'vala'])[,1]
)
print(pstr, mode = "evaluation")
# bootstrap variants (requires snowfall)
library(snowfall)
pstr <- WCB_TVTest(
use = pstr, iB = 4,
parallel = TRUE, cpus = 2)
pstr <- WCB_HETest(
use = pstr,
vq = as.matrix(Hansen99[,'vala'])[,1],
iB = 4, parallel = TRUE, cpus = 2)
print(pstr, mode = "evaluation")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.