This repository houses the materials to install and use the GAUSS quantile cointegration code by Jin Seo Cho.
GAUSS is an easy-to-use data analysis, mathematical and statistical environment based on the powerful, fast and efficient GAUSS Matrix Programming Language. GAUSS is a complete analysis environment with the built-in tools you need for estimation, forecasting, simulation, visualization and more.
The GAUSS QARDL library is a collection of GAUSS codes developed by Jin Seo Cho. The raw codes provided by Jin Seo Jo have been modified to:
- Make use of GAUSS structures.
- Use the internal quantileFit procedure.
- Include new comments and explanations in the example files.
- Use up-to-date graphing tools in the example.
Note: The QARDL library no longer requires the QREG library. It uses the internal quantileFit procedure instead.
GAUSS 20+ The GAUSS QARDL library can be installed and updated directly in GAUSS using the GAUSS package manager.
GAUSS 19+ The GAUSS QARDL library can be easily installed using the GAUSS Application Installer, as shown below:
-
Download the zipped folder
qardl_1.0.0.zip
from the QARDL Library Release page. -
Select Tools > Install Application from the main GAUSS menu.
-
Follow the installer prompts, making sure to navigate to the downloaded
qardl_1.0.0.zip
. -
Before using the functions created by
qardl
you will need to load the newly createdqardl
library. This can be done in a number of ways:
- Navigate to the Library Tool Window and click the small wrench located next to the
qardl
library. SelectLoad Library
.
- Enter
library qardl
in the Program Input/output Window. - Put the line
library qardl;
at the beginning of your program files.
Note: I have provided the individual files found in
qardl_1.0.0.zip
for examination and review. However, installation should always be done using theqardl_1.0.0.zip
from the release page and the GAUSS Application Installer.
These are the obtained QARDL orders obtained by the information criterion.
- The
demo.e
program estimates ap
order of 2 and aq
order of 1.
Estimated p order
=========================================================
2.0000000
=========================================================
Estimated q order
=========================================================
1.0000000
-
These are the long-run parameters given from the lowest percentile. In the
demo.e
program there are two explanatory variables and three quantiles: 0.25, 0.50 and 0.75. The following results are printed for β. -
These are stored in the
qardlOut
structure in theqardlOut.bigBt
element.
=========================================================
Long-run parameter estimate (Beta)
=========================================================
6.6645846
6.6668972
6.6659552
6.6666716
6.6652370
6.6663398
- The first two values, 6.6645846 and 6.6668972, are the long-run parameters of the first and second parameters, respectively, at the 0.25 percentile.
- The next two estimates, 6.6659552 and 6.6666716, are the long-run parameters of the first and second parameters, respectively, at the 0.50 percentile.
- The final two estimates, 6.6652370 and 6.6663398, are the long-run parameters of the first and second parameters, respectively, at the 0.75 percentile.
- This is the estimated covariance of the long-run parameters.
- These are stored in the
qardlOut
structure in theqardlOut.bigbt_cov
element.
The demo.e
program prints the following 6x6 covariance matrix:
=========================================================
Covariance matrix estimate of long-run parameter (Beta)
=========================================================
107.147 -17.451 58.427 -9.516 39.498 -6.433
-17.451 15.212 -9.516 8.295 -6.433 5.608
58.427 -9.516 95.579 -15.567 64.614 -10.524
-9.516 8.295 -15.567 13.570 -10.524 9.174
39.498 -6.433 64.614 -10.524 101.923 -16.601
-6.433 5.608 -10.524 9.174 -16.601 14.471
-
These are the short-run parameters given from the lowest percentile first.
-
These are stored in the
qardlOut
structure in theqardlOut.phi
element. -
The
demo.e
program estimates an autoregressive order (p) of 2 and has three percentiles (0.25, 0.50, and 0.75). This results in 6 short-run parameter estimates. It prints the following results:
=========================================================
Short-run parameter estimate (Phi)
=========================================================
0.25537159
-0.0043015969
0.26163588
-0.0069863046
0.26073101
-0.0063757138
- The first two values (0.25537159 and -0.0043015969) are the short-run parameters of the first and second lagged dependent variables, respectively at the percentile of 0.25.
- The next two estimates (0.26163588 and -0.0069863046) are the short-run parameters of the first and second lagged dependent variables, respectively at the percentile of 0.50.
- The final two estimates (0.26073101 and -0.0063757138) are the short-run parameters of the first and second lagged dependent variables, respectively at the percentile of 0.75.
-
This is the estimated covariance of the short-run parameters.
-
These are stored in the
qardlOut
structure in theqardlOut.phi_cov
element. -
The
demo.e
program estimates the following covariance for Φ :
=========================================================
Covariance matrix estimate of short-run parameter (Phi)
=========================================================
0.238 -0.130 0.129 -0.070 0.087 -0.047
-0.130 0.083 -0.070 0.045 -0.047 0.030
0.129 -0.070 0.211 -0.115 0.142 -0.077
-0.070 0.045 -0.115 0.074 -0.077 0.050
0.087 -0.047 0.142 -0.077 0.225 -0.122
-0.047 0.030 -0.077 0.050 -0.122 0.079
-
These are the short-run parameters given from the lowest percentile.
-
These are stored in the
qardlOut
structure in theqardlOut.gamma
element. -
The
demo.e
program has 2 variables and three percentiles (0.25, 0.50, and 0.75). This results in 6 short-run parameter estimates. It prints the following results:
=========================================================
Short-run parameter estimate (Gamma)
=========================================================
4.991
4.993
4.968
4.969
4.972
4.973
- The first two values (4.9913074 and 4.9930394) are the short-run parameters of the first and second variables, respectively at the percentile of 0.25.
- The next two estimates (4.9684725 and 4.9690065) are the short-run parameters of the first and second explanatory variables, respectively at the percentile of 0.50.
- The final two estimates (4.9698987 and 4.9707210) are the short-run parameters of the first and second explanatory variables, respectively at the percentile of 0.75.
-
This is the estimated covariance of the short-run γ estimates.
-
This is stored in the
qardlOut
structure in theqardlOut.gamma_cov
element. -
The
demo.e
program estimates the following covariance for γ:
=========================================================
Covariance matrix estimate of short-run parameter (Gamma)
=========================================================
2.774 2.775 1.506 1.506 1.017 1.017
2.775 2.776 1.506 1.506 1.017 1.017
1.506 1.506 2.454 2.454 1.659 1.659
1.506 1.506 2.454 2.455 1.659 1.659
1.017 1.017 1.659 1.659 2.618 2.619
1.017 1.017 1.659 1.659 2.619 2.619
The QARDl library provides the functions for performing Wald tests. The wtestlrb
, wtestlrp
, and wtestlrg
procedures. The procedures perform Wald tests for β, φ, and γ, respectively. Each test returns the test statistic and it's corresponding p-value.
Each Wald test procedure requires 5 inputs to summarize the estimated parameters, the desired tests, and the data.
Input | Description |
---|---|
coeff | The β, φ or γ parameter estimates stored in qardlOut.beta , qardlOut.phi , or qardlOut.gamma elements, respectively. |
cov | The estimated parameter covariance, stored in qardlOut.beta_cov , qardlOut.phi_cov , or qardlOut.gamma_cov , respectively. |
bigR | The R restriction matrix in the null hypothesis. |
smlr | The r restriction matrix in the null hypthesis. |
data | The dataset used to estimate the coefficients. |
The Wald tests in the QARDL library test the null hypothesis:
against the alternative
As an example, consider the Wald test of β that is performed in the demo.e
program. This test looks at the null hypothesis:
To do this we set :
bigR = { 1 0 -1 0 0 0, 0 0 1 0 -1 0};
smlr = {0, 0};
The demo.e
program prints the following results for the Wald tests:
=========================================================
Wald test (Beta) and its p-value
=========================================================
2.220 0.330
=========================================================
Wald test (Phi) and its p-value
=========================================================
2.061 0.357
=========================================================
Wald test (Gamma) and its p-value
=========================================================
2.356 0.308
=========================================================
These p-values suggest that we cannot reject the null hypothesis and there is not evidence for asymmetries in β1.
The rollingQARDL
procedure computes the QARDL regression for a for a rolling fixed window. The window is fixed at 10% of the time series length.
The rollingQARDL
procedure requires the same inputs as the qardl
procedure and one additional input, the waldTestRestrictions
structure. The waldTestRestrictions
structure contains 6 members:
Member | Description |
---|---|
waldR.bigR_gamma | Matrix, R restriction matrix in the null hypothesis for the test for γ. |
waldR.smlr_gamma | Matrix, r restriction matrix in the null hypothesis for the test for γ. |
waldR.bigR_phi | The R matrix in the null hypothesis for the test for φ. |
waldR.smlr_phi | The r restriction matrix in the null hypothesis for the test for φ. |
waldR.bigR_beta | The R matrix in the null hypothesis for the test for β. |
waldR.smlr_beta | The r restriction matrix in the null hypothesis for the test for β. |
The rollingQARDL
procedure has one output, the rollingQARDLOut
output structure. The rollingqardlOut
structure has 6 elements. In each element, the estimates for separate quantiles (τ) are stored in individual columns, while each row corresponds to the separate estimation window.
Member | Description |
---|---|
rqaOut.bigbt | An array of beta estimates which contains the estimates for each of the independent variables on a separate plane. |
rqaOut.bigbt_se | An array of standard error estimates which contains the se estimates for each of the independent variables on a separate plane. . |
rqaOut.phi | An array of phi estimates which contains the estimates for each lagged independent variable on a separate plane. |
rqaOut.phi_se | An array of standard error estimates which contains the se estimates for each lagged independent variable on a separate plane. |
rqaOut.gamma | An array of gamma estimates which contains the estimates for each of the independent variables on a separate plane. |
rqaOut.gamma_se | An array of standard error estimates which contains the se estimates for each of the independent variables on a separate plane. |
More about the GAUSS QARDL library can be found in the blog, The Quantile Autoregressive-Distributed Lag Parameter Estimation and Interpretation in GAUSS.