Description Usage Arguments Details Value Author(s) See Also Examples
These functions conduct the linearity tests against the alternative of a logistic smooth transition nonlinear component.
1 2 3 | LinTest(use)
WCB_LinTest(use, iB = 100, parallel = F, cpus = 4)
|
use |
an object of the class PSTR, created by |
iB |
specify the number of repetitions in the bootstrap procedure. By default, it is 100. |
parallel |
a boolean value showing if the parallel computation is applied. |
cpus |
number of cores used in the parallel computation. The value will be ignored if |
LinTest
implements the linearity tests.
WCB_LinTest
implements the wild bootstrap (WB) and the wild cluster bootstrap (WCB) linearity tests.
The functions need the return value (an object of the class PSTR) from the NewPSTR
. They copy the object, reuse its contents to produce the linearity test results, and then return a new object of the class PSTR. The user can choose to save the return value to a new object or simply to overwrite the object returned from NewPSTR
. See the example below.
The functions conduct two kinds of linearity tests.
The first kind of tests does the linearity tests based on each potential transition variable specified in the argument tvars
when the user calls the NewPSTR
function. For each potential transition variable, the function conducts linearity tests for numbers of switches from 1 up to im
. The linearity tests has the null hypothesis
H_0^i: β_{i} = β_{i-1} = β_{i-2} = ... = β_{1} = 0
for i = 1, ..., m, where m is the maximal number of switches im
.
The second kind does the linearity tests for selecting the number of switches based on each potential transition variable. The linearity tests for selecting the number of switches has the null hypothesis
H_0^i: β_{i} = 0 | β_{i+1} = β_{i+2} = ... = β_{m} = 0
for i = 1, ..., m, where m is the maximal number of switches im
.
The results of the linearity tests include four kinds of tests
χ^2-version Linearity test: the linearity LM test with asymptotically χ^2 distribution under the null hypothesis of linearity.
F-version Linearity test: the linearity LM test with asymptotically F distribution under the null hypothesis of linearity. The finite sample actual size is supposed to be improved.
χ^2-version HAC Linearity test: the linearity LM test with asymptotically χ^2 distribution under the null hypothesis of linearity, which is heteroskedasticity and autocorrelation consistent.
F-version HAC Linearity test: the linearity LM test with asymptotically F distribution under the null hypothesis of linearity, which is heteroskedasticity and autocorrelation consistent. The finite sample actual size is supposed to be improved.
The wild bootstrap (WB) tests are heteroskedasticity robust, while the wild cluster bootstrap (WCB) ones are both cluster-dependency and heteroskedasticity robust. Cluster-dependency implies that there can be dependency (autocorrelation) within individual, but no correlation across individuals. The WB and WCB tests may take quite a long time to run which depends on the model specification and the number of repetitions iB
. It is strongly recommended to use super-computation server with many cores to run the code instead of a personal computer. The user may first try a small number of repetitions iB
and estimate the time consumed for a larger number of iB
.
The two functions never change the existing values in the input PSTR object. They add more values (attributes) into the input object and return.
a new object of the class PSTR containing the results from the linearity tests.
The object is a list containing the components made in NewPSTR
and the following new components:
test |
a list of the linearity test results. The length is the number of potential transition variables specified when creating the object of the class PSTR by calling |
sqtest |
a list of the linearity test results for selecting number of switches. It has the same length as |
wcb_test |
a list of the linearity test results. The length is the number of potential transition variables specified when creating the object of the class PSTR by calling |
wcb_sqtest |
a list of the linearity test results for selecting number of switches. It has the same length as |
Yukai Yang, yukai.yang@statistik.uu.se
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | pstr = NewPSTR(Hansen99, dep='inva', indep=4:20, indep_k=c('vala','debta','cfa','sales'),
tvars=c('vala'), iT=14) # create a new PSTR object
pstr = LinTest(pstr)
print(pstr, "tests")
# Don't forget to attach the package for the parallel computation.
library(snowfall)
# you should not run this on personal computer!
# pstr = WCB_LinTest(use=pstr, iB=5000, parallel=TRUE, cpus=50)
# a light version for checking on your personal computer.
pstr = WCB_LinTest(use=pstr, iB=4, parallel=TRUE, cpus=2)
print(pstr, "tests")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.