### Introduction

The QARDL model has grown increasingly popular in time series analysis. It is a convenient model for addressing autocorrelation, disentangling long-term and short-term relationships, and addressing asymmetric relationships.

In today's blog, we look at the basics of the QARDL model including:

- The intuition behind the QARDL model.
- How to estimate the QARDL model in GAUSS.
- How to interpret the QARDL results.

## What is the QARDL model?

The quantile autoregressive distributed lag (QARDL) model combines two important time series analysis tools, quantile regression and autoregressive distributed lag (ARDL) models.

### ARDL Models

The autoregressive distributed lag model uses two components to explain the behavior of a dependent variable:

- Lags of the dependent variable (
*the autoregressive component*). - Current and lagged values of independent explanatory variables (
*the distributed lag component*).

ARDL models are often expressed in relation to the number of lags, ARDL(p, q) where:

- $p$ is the number of lags of the dependent variable.
- $q$ is the number of lags of the independent variables.

Mathematically we represent the ARDL model as: $$\begin{align} Y_t = &\beta_0 + \beta_1 y_{t-1} + \ldots + \beta_k y_{t-p} +\\ &\alpha_0 x_t + \alpha_1 x_{t-1} + \alpha_2 x_{t-2} + \ldots + \alpha_q x_{t-q} + \epsilon_t \end{align}$$

### Quantile Regression

It is easiest to understand quantile regression thinking of it in the context of standard linear regression.

When we perform standard linear regression, we can think of this as fitting a line that splits the data such that half of the data falls on either side of the line. This is also known as *mean regression*.

Quantile linear regression fits a line that splits the data such that a specified quantile of the data lies below the line and the remainder of the data lies above the line.

### QARDL Regression

The QARDL model applies an ARDL model across specified quantiles of data. It uses a weighted sum of squared errors based on the specified quantiles, $\tau$, such that

$$ \tau \sum_{y_i \gt \hat{y_i}} | y_i - \hat{y_i} |\ +\ (1 - \tau)\sum_{y_i \lt \hat{y_i}} | y_i - \hat{y_i} | $$

## Example Applications of QARDL |
|||
---|---|---|---|

Example question | Field | Description | |

How do exchange rates respond to economic policy uncertainty? | International macroeconomics | The study uses QARDL to address extreme values while modeling Russian currency fluctuations in relationship to macroeconomic indicators. | |

How does the COVID-19 pandemic affect tourism in China? | Economics | This study uses a QARDL model to examine the relationship between daily Chinese tourism and three explanatory variables: COVID-19 intensity, the real effective exchange rate, and oil prices. | |

What is the long-run relationship between US financial credit markets and risk factors? | Finance | This study uses a QARDL model to examine both the short-run and long-run impact of the Federal Funds Rate, VIX index, and crude oil prices on credit risk in U.S financial credit markets. | |

How does healthcare expenditure impact health outcomes? | Health policy | This study employs the QARDL model to allow for asymmetries across quantiles in the effects of healthcare expenditure on life expectancy, death rate, and mortality. |

## When Should I Use the QARDL Model?

The QARDL model is a good fit for your data if you:

- Are interested in determining both long-run and short-run dynamics.
- Believe that there are asymmetries in effects across different quantiles of your data. For example, you may believe that high health expenditures are related to health outcomes differently than low health expenditures.
- Are using time series data which may be susceptible to auto-correlation.

It is also important to note that one of the key advantages of the QARDL model is that it can be used for data that is stationary, non-stationary, or a mixture of the two.

## How Do I Estimate The QARDL Model In GAUSS?

GAUSS provides an easy-to-use QARDL estimation tool. This tool can be found in QARDL library. This library is free for all GAUSS users.

### The QARDL Library

The **QARDL** library is a collection of code developed by Jin Seo Cho. The raw code provided by Jin Seo Jo has been modified to make use of new GAUSS features that make installation and use easier.

Some of these updates include:

- Use of the internal quantileFit procedure.
- Inclusion of new comments and explanations in the example files.
- Up-to-date graphing tools in the example.
- Use of GAUSS structures.

**QARDL**library is free and can be installed directly from within GAUSS using the Package Manager.

### Setting Up The Data

The `qardl`

function accepts data in a matrix form. Your data should be set up such that:

- The first column contains the dependent data.
- The remaining $k$ columns contain the independent data.

As an example, we will use a quarterly dataset of S&P 500 real prices, real dividends, and real earnings spanning from 1871Q1 to 2021Q2. The data is constructed from Robert Shiller's (2005) dataset.

For our model, we will use real dividends as the dependent variable and real earnings as the independent variable. The first step is to load our variables.

```
// Load Shiller dataset
fname = "shiller_stocks_qt.csv";
shiller_stocks_qt = loadd(fname, "real_dividend + real_earnings");
```

### Determining the Number of Lags

The **QARDL** library includes the `pqorder`

procedure that computes the optimal lags for both the dependent and independent variables using the BIC.

The `pqorder`

procedure requires three inputs:

- data
- Matrix, the data matrix with dependent data in the first column and independent data in the remaining columns.
- pmax
- Scalar, the maximum number of lags for the dependent data.
- qmax
- Scalar, the maximum number of lags for the independent data.

```
// Max lags
pmax = 8;
qmax = 8;
// Determine optimal lags
{ p_opt, q_opt } = pqorder(shiller_stocks_qt, pmax, qmax);
```

### Estimating the QARDL Model

Next, we will use the `qardl`

procedure to compute both the long-run and short-run QARDL relationships. The `qardl`

procedure requires four inputs:

- data
- Matrix, the data matrix with dependent data in the first column and independent data in the remaining columns.
- p_opt
- Scalar, the lags of the dependent data used in the QARDL model.
- q_opt
- Scalar, the lags of the independent data used in the QARDL model.
- tau
- Vector, the quantiles to estimate the model across.

The `qardl`

function returns the estimation results in a `qardlOut`

structure. We will discuss the members stored in the `qardlOut`

structure in the next section. All we need to know right now is that in order to store our results we must first declare a `qardlOut`

structure:

```
// Declare 'q_out' to be a qardlOut structure to hold the estimation results
struct qardlOut q_out;
```

We can now specify our percentiles, call the `qardl`

procedure and return our output to the `q_out`

structure:

```
// Percentiles for estimation
tau = { 0.25, 0.5, 0.75 };
// Parameter estimation
q_out = qardl(shiller_stocks_qt, p_opt, q_opt, tau);
```

## Interpreting the QARDL Model Results

The `qardlOut`

structure `q_out`

stores six different results:

- q_out.bigbt
- Matrix, long-run parameter.
- q_out.bigbt_cov
- Matrix, covariance of the long-run parameter.
- q_out.phi
- Matrix, short-run parameter for the autoregressive terms of the
*dependent variable*. - q_out.phi_cov
- Matrix, covariance of the short-run parameter for the autoregressive terms of the
*dependent variable*. - q_out.gamma
- Matrix, the cumulative short-run parameter for the distributed lag terms of the
*independent variables*. - q_out.gamma_cov
- Matrix, covariance of the short-run parameter for the distributed lag terms of the
*independent variables*.

### Long-run Parameter Estimates (β)

The `q_out.bigBt`

vector contains estimates for the long-run parameters at each of our specified percentiles. This vector:

- Contains an estimate for each explanatory variable at each percentile.
- Stores the parameters in order that the percentiles are specified.
- Lists all parameters for a given percentile together.

For example, if we had a model with:

- The quantiles 0.15, 0.5 and 0.85.
- Dependent variables,
`X1`

and`X2`

. - A
`q_out.bigBt`

vector with the values: 0.6948, 0.0035, 0.9807, 0.3111, 0.0532, 0.7038.

we could interpret it as shown in the table below.

Element Number | Parameter Value | Quantile Level | Independent Variable |
---|---|---|---|

1 | 0.6948 | 0.15 | X1 |

2 | 0.0035 | 0.15 | X2 |

3 | 0.9807 | 0.5 | X1 |

4 | 0.3111 | 0.5 | X2 |

5 | 0.0532 | 0.85 | X1 |

6 | 0.7038 | 0.85 | X2 |

Let's look at the `q_out.bigBt`

vector in our example:

```
>> print q_out.bigbt
0.422
0.433
0.481
```

In our case, we have one explanatory variable and three quantiles so our`q_out.bigBt`

vector is a 3 x 1 vector.

### Short-run Parameter Estimates (Φ)

The `q_out.phi`

vector contains the short-run parameters for the autoregressive terms of the *dependent variable*. This vector:

- Contains one coefficient for each autoregressive order ($p$) at each percentile.
- Stores the parameters in the order that the percentiles are specified.
- Lists all parameters for a given percentile together.

This time, we will use the result vector from our example to demonstrate.

- The quantiles 0.25, 0.5 and 0.75.
- Independent variable,
`real_dividend`

. - The results stored in our
`q_out.bigBt`

vector with the values: 1.352, -0.186, -0.192, 1.281, -0.130, -0.184, 1.276, -0.149, -0.159.

The table below shows how to interpret the parameter vector stored in `q_out.phi`

.

Element Number | Parameter Value | Quantile Level | Lag |
---|---|---|---|

1 | 1.352 | 0.25 | $\text{real_dividend}_{t-1}$ |

2 | -0.186 | 0.25 | $\text{real_dividend}_{t-2}$ |

3 | -0.192 | 0.25 | $\text{real_dividend}_{t-3}$ |

4 | 1.281 | 0.5 | $\text{real_dividend}_{t-1}$ |

5 | -0.130 | 0.5 | $\text{real_dividend}_{t-2}$ |

6 | -0.184 | 0.5 | $\text{real_dividend}_{t-3}$ |

7 | 1.276 | 0.75 | $\text{real_dividend}_{t-1}$ |

8 | -0.149 | 0.75 | $\text{real_dividend}_{t-2}$ |

9 | -0.159 | 0.75 | $\text{real_dividend}_{t-3}$ |

From these results we see that:

- The short-run impact of the first lag of the real dividends is positive and of larger magnitude than other lags at all percentiles.
- The short-run impacts of the second and third lags of real dividends are negative and small.
- The short-run impacts of all lags are relatively consistent across the 0.25, 0.5, and 0.75 percentiles.

### Short-run Parameter Estimates (γ)

The `q_out.gamma`

vector contains the cumulative short-run parameters for the distributed lag terms of the *independent variables*. This vector:

- Contains one coefficient for each independent variable at each of our three percentiles (0.25, 0.50, and 0.75). This coefficient represents the cumulative sum of the short-run impacts across all distributed $q$ lags.
- Stores the parameters in the order that the percentiles are specified.

```
>> print q_out.gamma
0.011
0.015
0.015
```

### Conclusion

Today's blog provides an introduction to the basics of the QARDL model. We examine:

- The intuition behind the QARDL model.
- How to estimate the QARDL model in GAUSS.
- How to interpret the QARDL results.

Eric has been working to build, distribute, and strengthen the GAUSS universe since 2012. He is an economist skilled in data analysis and software development. He has earned a B.A. and MSc in economics and engineering and has over 15 years of combined industry and academic experience in data analysis and research.

zmighriDear Eric

What about the estimation and diagnostic of QARDL-ECM?

EricPost authorHello,

Thank you for your comment. I am planning on writing a blog covering the estimation and diagnostic of QARDL-ECM in the future. In the meantime, I suggest reviewing the Jin Seo Cho, Tae-Hwan Kim, and Yongcheol Shin (2015) paper, "Quantile Cointegration in the Autoregressive

Distributed-Lag Modelling Framework".

limanliHello Eric,

Thank you for this nice demonstration.

I wonder if QARDL Library support rolling window method.

EricPost authorHello,

Yes, the QARDL library does support the rolling window method!

Eric