Tests for models with different thresholds, using bootstrap method.
Threshold_Test(formula = NULL, formula_cv = NULL, data, index=NULL, Th = 1, q,
timeFE = FALSE, bt = 100,NoY = FALSE, y1 = NULL, iterations = 2000, sro = 0.1,
r0x = NULL, r1x = NULL, parallel=TRUE, seed = NULL,...)
A list with class "htest" containing the following components:
the value of the F-statistic.
the degrees of freedom for the F-statistic.
the p-value for the test.
the specified hypothesized value of the null hypothesis.
a character string describing the alternative hypothesis.
a character string indicating what type of test was performed.
a character string giving the name(s) of the data.
the critical value of the statistic (5% significance level).
a vector of statistics from bootstrap.
formula of the covariates with threshold effects; If a setting is not provided, defaults (no covariates with threshold effects) will be used. Defaults to `NULL`.
formula of the covariates without threshold effects; If a setting is not provided, defaults (no covariates without threshold effects) will be used. Defaults to `NULL`.
data frame of the observed data.
variable names of individuals and period; If a setting is not provided, defaults (the first variables in data will be as "id", while the second will be "year") will be used.Defaults to `NULL`.
threshold variable.
logicals. If TRUE the time fixed effects will be allowed. Defaults to `FALSE`.
the number of bootstrap; If a setting is not provided, defaults (bt = 100) will be used. Defaults to `100`.
logicals. If TRUE the lags of dependent variables will be without threshold effects. Defaults to `FALSE`.
lags of dependent variables; If a setting is not provided, defaults (the first-order lag) will be used. Defaults to `NULL`.
MCMC iterations (50% used for burnining). Defaults to `2000`.
regime (subsample) proportion; If a setting is not provided, defaults (10%) will be used. Defaults to `0.1`.
lower bound of threshold parameter space; If a setting is not provided, defaults (15% quantile of threshold variable) will be used.
upper bound of threshold parameter space; If a setting is not provided, defaults (85% quantile of threshold variable) will be used.
logicals. If TRUE test will run in parallel for saving time. Defaults to `TRUE`.
set seeds to guarantee the replication the test (see set.seed);
additional arguments to be passed to the settings of MCMC (see BayesianTools::applySettingsDefault)
number of thresholds; Defaults to `1`.
Hujie Bai
Threshold_Test
can run the Test for multiple thresholds (Th
is H1).
The statistic is
$$F_s=\frac{S\left(\hat{\gamma}_{s-1}\right)-S\left(\hat{\gamma}_s\right)}{S\left(\hat{\gamma}_s\right) / N(T-1)},$$
where \(s\) is the number of thresholds in H1, \(S\left(\hat{\gamma}_{s-1}\right)=-\ln L\left(\hat{\gamma}_{s-1}\right)\) and \(S\left(\hat{\gamma}_s\right)=-\ln L\left(\left(\hat{\gamma}_{s-1}^{\prime}, \hat{\gamma}_s\right)^{\prime}\right)\).
And the p-value is computed by bootstrap method (see Ramírez-Rondán, 2020).
Take the two threshold model as example.
User must set Th
= 1 firstly to reject the null hypothesis of no threshold effects;
Then he should set Th
= 2 to reject the null hypothesis of only one threshold;
Lastly, set Th
= 3 to accept the null hypothesis of two thresholds.
In other words, p-values of the first test (Th
= 1) and the second test (Th
= 1) should be less than significant level while the third test (Th
= 3) is not.
Threshold_Test
contains all augments in DPTS
, but with three new augments: bt
, parallel
and seed
.
bt
is the number of bootstrap (by default is 100);
parallel
can allow user to run test in parallel to save time;
seed
is used to guarantee the replication of tests.
It is worthy noting that the test shrinks to the so-called threshold existence test when Th
= 1.
Ramírez-Rondán, N. R. (2020). Maximum likelihood estimation of dynamic panel threshold models. Econometric Reviews, 39(3), 260-276.
# \donttest{
### Examples elapsed time > 15s
#data(d1)
# H0: no threshold effects (no threshold)
#test0 <- Threshold_Test(y~x,y~z,data = d1, index = c('id','year'), q = d1$q, Th = 1,
#bt = 50, iterations = 500)
#test0
# H0: one threshold
#test1 <- Threshold_Test(y~x,y~z,data = d1, index = c('id','year'), q = d1$q, Th = 2,
#bt = 50, iterations = 500)
#test1
# H0: two threshold
#test2 <- Threshold_Test(y~x,y~z,data = d1, index = c('id','year'), q = d1$q, Th = 3,
#bt = 50, iterations = 500)
#test2
# }
Run the code above in your browser using DataLab