i10test

Paired integration and stationarity tests

Description

example

[H,PValue] = i10test(X) displays, at the command window, the results of paired integration and stationarity tests on the variables in the matrix of time series data X. Row labels in the display table are variable names and their differences. Column labels are I(1) and I(0), respectively, to indicate the null hypothesis of the test.

The function also returns the matrix of test rejection decisions H and associated p-values for the test statistics PValue.

example

DecisionTbl = i10test(Tbl) displays the results of paired integration and stationarity tests on all the variables of the table or timetable Tbl. The function also returns the table DecisionTbl containing variables for the test rejection decisions and associated p-values for the test statistics.

To select a subset of variables in Tbl to test, use the DataVariables name-value argument.

example

[___] = i10test(___,Name=Value) uses additional options specified by one or more name-value arguments, using any input-argument combination in the previous syntaxes. i10test returns the output-argument combination for the corresponding input arguments. For example, i10test(Tbl,NumDiffs=1,DataVariables=1:5) tests the first 5 variables in the input table Tbl, and tests their first difference.

Examples

collapse all

Conduct paired integration and stationarity tests on multiple time series using the default tests and settings. Input the time series data as a numeric matrix.

Load data of Canadian inflation and interest rates Data_Canada.mat, which contains the series in the matrix Data.

Conduct the default integration (adftest) and stationarity (kpsstest) tests on all time series in the data. Return the test decisions and $\mathit{p}$-values.

[H,PValue] = i10test(Data)
Test Results

I(1)    I(0)
======================
var1    0       1
0.3255  0.0100
----------------------
var2    0       1
0.2650  0.0100
----------------------
var3    0       1
0.4097  0.0100
----------------------
var4    0       1
0.6210  0.0100
----------------------
var5    0       1
0.7358  0.0100
----------------------
H = 5×2

0     1
0     1
0     1
0     1
0     1

PValue = 5×2

0.3255    0.0100
0.2650    0.0100
0.4097    0.0100
0.6210    0.0100
0.7358    0.0100

For all series, the tests fail to reject a unit root (H = 0 for I(1)), and they reject stationarity (H = 1 for I(0)). The $\mathit{p}$-values are large for adftest and very small, outside the Monte Carlo simulated tables, for kpsstest.

Conduct paired integration and stationarity tests on two time series, which are variables in a table, using default options. Return a table of results.

dates = datetime(dates,ConvertFrom="datenum");
TT = table2timetable(DataTable,RowTimes=dates);
TT.Observations = [];

Conduct the default integration and stationarity tests on all the variables. Return the table of test decisions and $\mathit{p}$-values.

DecisionTbl = i10test(TT)
Test Results

I(1)    I(0)
======================
INF_C   0       1
0.3255  0.0100
----------------------
INF_G   0       1
0.2650  0.0100
----------------------
INT_S   0       1
0.4097  0.0100
----------------------
INT_M   0       1
0.6210  0.0100
----------------------
INT_L   0       1
0.7358  0.0100
----------------------
DecisionTbl=5×4 table
I1    I0      P1        P0
__    __    _______    ____

INF_C    0     1     0.32546    0.01
INF_G    0     1     0.26503    0.01
INT_S    0     1      0.4097    0.01
INT_M    0     1       0.621    0.01
INT_L    0     1      0.7358    0.01

DecisionTbl is a table of test results. The rows correspond to variables in the input timetable TT, and the columns correspond to rejection decisions and corresponding $\mathit{p}$-values.

By default, i10test conducts integration and stationarity tests between all pairs of variables in the input table. To select a subset of variables from an input table, set the DataVariables option.

Conduct paired integration and stationarity tests on two time series and their differences. Specify integration and stationary test options.

Load the Nelson-Plosser data, which contains data in the table DataTable.

Consider conducting augmented Dickey-Fuller tests to assess integration and KPSS stationarity tests to assess stationarity. Create scalar structures that specify integration and stationarity test options in cell vectors.

IParams.names = {'Lags' 'Model'};   % Names of augmented Dickey-Fuller test options
IParams.vals = {1 'ts'};            % Values of augmented Dickey-Fuller test options

SParams.names = {'Trend'};  % Names of KPSS test options
SParams.vals = {true};      % Values of KPSS test options

Conduct the integration and stationarity tests on the real gross national product (GNPR) and the consumer price index (CPI) series, and their first differences. Specify the integration and stationary test options and turn off the command window display table.

DecisionTbl = i10test(DataTable,DataVariables=["GNPR" "CPI"], ...
STest="kpss",SParams=SParams)
DecisionTbl=4×4 table
I1    I0       P1           P0
__    __    _________    ________

GNPR      0     1       0.87598        0.01
D1GNPR    1     0     0.0054215         0.1
CPI       0     1       0.97987        0.01
D1CPI     1     0         0.001    0.056788

DecisionTbl is a table of test results. Rows correspond to variables in the input table DataTable.

• The variable I1 contains the decisions for testing the null hypothesis that the raw series contains a unit root. A value of 0 fails to reject the null hypothesis (GNPR and CPI) and a value of 1 rejects the null hypothesis in favor of a stationary series (D1GNPR and D1CPI). The variable P1 contains the $\mathit{p}$-value for the test.

• The variable I0 contains the decisions for testing the null hypothesis that the differenced series contains a unit root. A value of 0 fails to reject the null hypothesis (D1GNPR and D1CPI) and a value of 1 rejects the null hypothesis in favor of a stationary, differenced series (GNPR and CPI). The variable P0 contains the $\mathit{p}$-value for the test.

At the specified settings, the test results suggest that both series have one degree of integration.

Input Arguments

collapse all

Time series data, specified as a numObs-by-numVars numeric matrix. Each column of X corresponds to a variable, and each row corresponds to an observation.

Data Types: double

Time series data, specified as a table or timetable with numObs rows. Each row of Tbl is an observation.

Specify numVars variables to include in the diagnostics computations by using the DataVariables argument. The selected variables must be numeric.

Note

For each test, i10test removes missing observations, represented by NaN values, from the series being tested.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: i10test(Tbl,NumDiffs=1,DataVariables=1:5) tests the first 5 variables in the input table Tbl, and tests their first difference.

Variable names used in the display, specified as a string vector or cell vector of strings of a length numVars. VarNames(j) specifies the name to use for variable X(:,j) or DataVariables(j).

• If the input time series data is the matrix X, the default is {'var1','var2',...}.

• If the input time series data is the table or timetable Tbl, the default is Tbl.Properties.VariableNames.

Example: VarNames=["Const" "AGE" "BBD"]

Data Types: char | cell | string

Number of differences of each input variable to test, specified as a nonnegative integer.

To each input variable, i10test applies differences of order 0 through NumDiffs, and conducts paired integration and stationarity tests on each resulting series (a total of 2*numVars(NumDiffs + 1) tests).

Example: 'numDiffs',2

Data Types: double

Integration test to conduct, specified as a value in this table.

ValueDescription
"pp"Phillips-Perron test, as conducted by pptest

Example: ITest="pp"

Data Types: char | string

Integration test parameters, specified as a scalar structure.

IParams has fields names and vals with the following values:

• IParams.names is a cell vector of valid name-value argument names for the integration test specified by ITest. i10test ignores variable selection arguments of the integration test; use the DataVariables name-value argument instead.

• IParams.vals is a cell vector with the same length as IParams.names containing corresponding values for the names in IParams.names. Values must specify one test.

i10test uses default values for unspecified integration-test options. The default value for IParams is an empty structure, which means i10test uses test defaults.

Example: i10test(Tbl,ITest="pp",IParams=struct('names',{{'Model' 'Test' 'Alpha'}},'vals',{{'ts' 't2' 0.01}})) conducts the default stationary test and the Phillips-Perron test for integration with a drift term in both hypotheses and a deterministic time trend in the alternative model, uses the modified unstudentized test statistic, and sets the significant level for each test to 0.01.

Data Types: struct

Stationarity test to conduct, specified as a value in this table.

ValueDescription
"kpss"KPSS test, as conducted by kpsstest
"lmc"Leybourne-McCabe test, as conducted by lmctest

Example: STest="lmc"

Data Types: char | string

Stationarity test parameters, specified as a scalar structure.

SParams has fields names and vals with the following values:

• SParams.names is a cell vector of valid name-value argument names for the stationarity test specified by STest. i10test ignores variable selection arguments of the stationarity test; use the DataVariables name-value argument instead.

• SParams.vals is a cell vector with the same length as SParams.names containing corresponding values for the names in SParams.names. Values must specify one test.

i10test uses default values for unspecified stationarity-test options. The default value for SParams is an empty structure, which means i10test uses defaults.

Example: i10test(Tbl,STest="lmc",IParams=struct('names',{{'Lags' 'Trend' 'Alpha'}},'vals',{{1 false 0.01}})) conducts the default integration test and the Leybourne-McCabe stationarity test, at 0.01 level of significance, including one lagged response in the structural model and excluding a deterministic time trend term.

Data Types: struct

Flag for a command window display of results, specified as a value in this table.

ValueDescription
"on"i10test displays all outputs in tabular form to the command window. Row labels are input variable names and their differences. Columns labels indicate the null hypothesis of the tests: I(1) for the integration tests and I(0) for the stationarity tests.
"off"i10test does not display the results to the command window.

The value of Display applies to all tests.

Example: Display="off"

Data Types: char | string

Variables in Tbl for which i10test conducts the tests, specified as a string vector or cell vector of character vectors containing variable names in Tbl.Properties.VariableNames, or an integer or logical vector representing the indices of names. The selected variables must be numeric.

Example: DataVariables=["GDP" "CPI"]

Example: DataVariables=[true true false false] or DataVariables=[1 2] selects the first and second table variables.

Data Types: double | logical | char | cell | string

Output Arguments

collapse all

Test decisions, returned as a numVars*(numDiffs + 1)-by-2 logical matrix. i10test returns H when you supply the input X.

• Values of 1 indicate rejection of the null hypothesis in favor of the alternative. Null and alternative hypotheses depend on the test and options; see the appropriate reference page for more details.

• Values of 0 indicate failure to reject the null hypothesis.

Rows of H correspond, in order, to ${x}_{1},\Delta {x}_{1},{\Delta }^{2}{x}_{1},\dots ,{\Delta }^{D}{x}_{1},{x}_{2},\Delta {x}_{2},{\Delta }^{2}{x}_{2},\dots ,{\Delta }^{D}{x}_{2},\dots$, where Δ is the differencing operator and D is the specified number of differences.

Columns of H correspond to the null hypothesis of integration, I(1), and the null hypothesis of stationarity, I(0), respectively.

Test statistic p-values, returned as a numVars*(numDiffs + 1)-by-2 matrix with the same size and arrangement as H. i10test returns PValue when you supply the input X.

Test summary, returned as a table with variables for outputs H (I1 and I0) and PValue (P1 and P0). Rows correspond to variables specified by DataVariables and labeled by VarNames, and their corresponding differences, where Djname is the label for variable name with order j difference.

i10test returns DecisionTbl when you supply the input Tbl.

Tips

• Kwiatkowski, Phillips, Schmidt, and Shin [1], and other references, suggest paired integration and stationarity tests as a method for mutual confirmation of individual test results. However, different integration test results can disagree on the same set of data, different stationarity test results can disagree, and stationarity tests can fail to confirm integration tests. Still, Amano and van Norden [2], Burke[3], and other references, perform Monte Carlo studies that suggest that paired testing is generally more reliable than using either type of test alone.

References

[1] Kwiatkowski, D., P. C. B. Phillips, P. Schmidt, and Y. Shin. “Testing the Null Hypothesis of Stationarity against the Alternative of a Unit Root.” Journal of Econometrics. Vol. 54, 1992, pp. 159–178.

[2] Amano, R. A., and S. van Norden. "Unit Root Tests and the Burden of Proof." Bank of Canada. Working paper 92–7, 1992.

[3] Burke, S. P. "Confirmatory Data Analysis: The Joint Application of Stationarity and Unit Root Tests." University of Reading, UK. Discussion paper 20, 1994.

Version History

Introduced in R2012a

expand all