Description Usage Arguments Details Value Author(s) See Also Examples
These functions conduct the evaluation tests against two alternatives: 1. the parameters are timevarying and 2. there is remaining nonlinearity (remaining heterogeneity).
1 2 3 4 5  EvalTest(use, type = c("timevarying", "heterogeneity"), vq = NULL)
WCB_TVTest(use, iB = 100, parallel = F, cpus = 4)
WCB_HETest(use, vq, iB = 100, parallel = F, cpus = 4)

use 
an object of the class PSTR, created by 
type 
a character vector specifying the types of the evaluation tests to be conducted. The value can be taken either or both of 
vq 
a vector of a new transition variable for the no remaining nonlinearity test. 
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 
EvalTest
implements the evaluation tests.
WCB_TVTest
implements the wild bootstrap (WB) and the wild cluster bootstrap (WCB) evaluation test of no timevarying parameters.
WCB_HETest
implements the wild bootstrap (WB) and the wild cluster bootstrap (WCB) evaluation test of no remaining nonlinearity (no remaining heterogeneity).
The functions need the return value (an object of the class PSTR) from the EstPSTR
. Note that the PSTR model should be estimated before conducting the evaluation tests. They copy the object, reuse its contents, especially the estimates, to produce the evaluation 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 EstPSTR
. See the example below.
The functions conduct two kinds of evaluation tests. The first kind of tests does the timevarying evaluation tests. The second kind of tests does the no remaining nonlinearity (no remaining heterogeneity) evaluation tests based on the vector of a new transition variable that the user input in the arguments.
The results of the evaluation tests include four kinds of tests
χ^2version LM test: the LM test with asymptotically χ^2 distribution under the null hypothesis.
Fversion LM test: the LM test with asymptotically F distribution under the null hypothesis. The finite sample actual size is supposed to be improved.
χ^2version HAC test: the HAC LM test with asymptotically χ^2 distribution under the null hypothesis, which is heteroskedasticity and autocorrelation consistent.
Fversion HAC test: the HAC LM test with asymptotically F distribution under the null hypothesis, which is heteroskedasticity and autocorrelation consistent. The finite sample actual size is supposed to be improved.
The wild bootstrap (WB) evaluation tests are heteroskedasticity robust, while the wild cluster bootstrap (WCB) ones are both clusterdependency and heteroskedasticity robust. Clusterdependency 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 supercomputation 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 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 evaluation tests.
The return object from EvalTest
contains the following new components:
tv 
a list of the timevarying evaluation tests. The length of the list is the maximal number of switches. Each element of the list corresponds to the timevarying evaluation test results based on different number of switches. 
ht 
a list of the no remaining nonlinearity (no remaining heterogeneity) evaluation tests. The length of the list is the maximal number of switches. Each element of the list corresponds to the timevarying evaluation test results based on different number of switches. The input vector of a new transition variable is used to compute the tests. 
The return object from WCB_TVTest
contains the following new component:
wcb_tv 
a matrix containing the results from the WB and WCB timevarying tests. Each row of the matrix contains the pvalue of the WB and WCB tests. 
The return object from WCB_HETest
contains the following new component:
wcb_ht 
a matrix containing the results from the WB and WCB no remaining nonlinearity (heterogeneity) tests. Each row of the matrix contains the pvalue of the WB and WCB tests. 
Yukai Yang, yukai.yang@statistik.uu.se
NewPSTR
, LinTest
, WCB_LinTest
and EstPSTR
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  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
# Estimate the model first
pstr = EstPSTR(use=pstr, im=1, iq=1, useDelta=TRUE, par=c(.63,0), method='CG')
# Then you can evaluate the model
pstr = EvalTest(use=pstr, vq=pstr$mQ[,1])
print(pstr, "eval")
# You can do the wild bootstrap and wild cluster bootstrap
library(snowfall)
pstr = WCB_TVTest(use=pstr, iB=4, parallel=TRUE, cpus=2)
# pstr$mQ[,1] is the transition variable stored in the object
# You can also try other transition variables.
pstr = WCB_HETest(use=pstr, vq=pstr$mQ[,1], iB=4, parallel=TRUE, cpus=2)
print(pstr, "eval")
# Don't forget to change the values of iB and cpus during experiments.

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.