|
Examples / GLOBALVAR.RPRJ |
GLOBALVAR.RPRJ provides a (very) simple example of a "global VAR" as described in Pesaran, Schuermann and Weiner(2004). Note that what they describe would be the output from a team of researchers with a great deal of effort required to collect data from multiple countries and regions. What we show here is how to use RATS to deal with the technical issues of such a model.
The idea behind the global VAR is to come up with a method for combining time series models for a number of countries, where a full VAR would be infeasible. To restrict the size of individual equations, the "other" country variables are reduced to a single weighted sum with weights that are specific to each country. Their recommendation is to use weights based upon bilateral trade. In a one-lag form, this is:
\begin{equation} {x_{i,t}} = {a_{0i}} + {a_{1i}}t + {\Phi _i}{x_{i,t - 1}} + {\Lambda _{i0}}x_{i,t}^* + {\Lambda _{i1}}x_{i,t - 1}^* + {\varepsilon _{i,t}} \end{equation}
where \({x_{i,t}}\) is the data for country \(i\) at time \(t\) and \(x_{i,t}^*\) is the (country \(i\)-specific) weighted average of the other countries' data. Note that this is a (1,1) ARDL model using the current values of \(x_{i,t}^*\) as explanatory variables. They assume that this can be treated as weakly exogenous, which, as they point out, might be reasonable for smaller economies. If there is a concern about this, the model can be done using lags only, which will produce shift some of the explanatory power into the correlations among the \({\varepsilon _{i,t}}\). The presence of the current values of \(x_{i,t}^*\) on the right side means that the overall model needs to be solved simultaneously, but the RATS forecasting instructions (such as FORECAST and IMPULSE) are designed to handle that when they detect it.
In the paper \(x_i\) is a vector of variables (somewhere between four and six). In this example, we will use just one. The larger model requires the same techniques, just on a larger scale.
The data are quarterly GDP values for six major economies, which are transformed to 100 log(x):
open data ekintl.xls
calendar(q) 1957
data(format=xls,org=columns) 1957:1 1989:3 usagnp gbrgdp deugnp fragdp itagdp jpngnp
*
dofor s = usagnp gbrgdp deugnp fragdp itagdp jpngnp
set(scratch) s = 100.0*log(s{0})
end dofor s
The weights need to be obtained from some other source. This is written with the weights for a country in a column, so the first column is US, the second is GBR, etc. The (2,1) element means that Great Britain accounted for 7.91% of US trade.
compute n=6
dec rect weights(n,n)
input weights
0.0000 0.1889 0.1233 0.0995 0.0967 0.3528
0.0791 0.0000 0.1164 0.1211 0.1020 0.0384
0.0809 0.1825 0.0000 0.2121 0.2371 0.0601
0.0434 0.1260 0.1408 0.0000 0.1729 0.0250
0.0304 0.0765 0.1135 0.1247 0.0000 0.0163
0.2019 0.0525 0.0524 0.0329 0.0296 0.0000
This sets up the VECTOR[SERIES] to allow for doing the work in a systematic fashion. GDP(i) has the data itself, TWGDP(i) will be the trade-weighted * series corresponding to series i, GDPRESID(i) will be \({\varepsilon _{i,t}}\). There are also two VECT[EQUATION], one which will be the identities linking the actual data to the TWGDP series, the other the estimated equations.
dec vect[series] gdp(n)
set gdp(1) = usagnp
set gdp(2) = gbrgdp
set gdp(3) = deugnp
set gdp(4) = fragdp
set gdp(5) = itagdp
set gdp(6) = jpngnp
*
dec vect[series] twgdp(n) gdpresid(n)
dec vect[equation] twgdpeq(n) gdpeq(n)
For each country, this creates the trade-weighted sum of the other countries' data (into the series TWGDP(i)) and the corresponding identity which defines TWGDP(i).
do i=1,n
set twgdp(i) = %dot(%xcol(weights,i),%xt(gdp,t))
equation(identity,coeffs=%xcol(weights,i)) twgdpeq(i) twgdp(i)
# gdp
end do i
This estimates the ARDL models for each series using one own lag and current and one lag of its trade-weighted series, defining GDPEQ(i) as its equation and GDPRESID(i) as its residuals.
set trend = t
do i=1,n
linreg(define=gdpeq(i)) gdp(i) / gdpresid(i)
# constant trend gdp(i){1} twgdp(i){0 1}
end do i
This computes the covariance matrix of the residuals. Note that, if the number of dependent variables in the model gets rather large, this step could be a problem since the covariance matrix will not be well-estimated if the number of equations is a substantial fraction of the number of data points. However, this is only necessary for doing impulse responses or simulations, and not for just doing point forecasts.
vcv
# gdpresid
This create the overall model combining the ARDL's with the definitions for the TWGDP series:
group(vcv=%sigma) globalvar gdpeq twgdpeq
When you do any forecasting instruction with the GLOBALVAR model, RATS will use the information in the TWDGPEQ identities to substitute out for the original GDP data. For instance, this does a variance decomposition:
errors(steps=24,model=globalvar)
Copyright © 2026 Thomas A. Doan