# RE: st: constrained VAR

 From "David M. Drukker, Stata Corp" To statalist@hsphsun2.harvard.edu Subject RE: st: constrained VAR Date Fri, 27 Jun 2003 08:37:22 -0500

```John D. Levendis <john-levendis@uiowa.edu> wrote that he was having trouble
specifying a constraint on an exogenous variable when using -var-.

The short answer is that the space between the equation name and coefficient
name in the constraint define statement is what is causing the problem.

. constraint define 1 [Q] X1 = 0

John should type

. constraint define 1 [Q]X1 = 0

Note the lack of a space between [Q] and X1 in the second constraint define
statement.

Now for a longer answer that provides some details.

John wrote that the model of interest can be expressed as

> P = B1*P(t-1) + B2*Q(t-1) + B3*X1(t) + B4*X2(t) + e(t)
> Q = B5*P(t-1) + B6*Q(t-1) + B7*X1(t) + B8*X2(t) + e(t)

Since X2 is superfluous to the example, allow me restrict the example to the
system

P = B1*P(t-1) + B2*Q(t-1) + B3*X1(t) + e(t)
Q = B4*P(t-1) + B5*Q(t-1) + B6*X1(t) + e(t)

John wants to constrain the coefficient on X1 in the Q equation to be zero.

He wrote that

> If the Xs were endogenous variables, I could have done:
> constraint define 1 [Q] X1 = 0
> var P Q, exog(X1 X2) constraint(1)

Unfortunately, this is not quite correct.  The space between [Q] and X1
would cause the constraint define statement to specify something besides
what John had intended.  If the Xs were endogenous, John could have
specified:

constraint define 1 [Q]X1 = 0

Note that there is no space between [Q] and X1.

The same logic applies when X1 is exogenous.  If John wants to use the
syntax

constraint define # exp=exp

then there cannot be a space between an equation name and a coefficient
name when referring to a coefficient.  Here is an example using the lutkepohl
dataset used in the [TS] var manual entry.

. clear

. use http://www.stata-press.com/data/r8/lutkepohl
(Quarterly SA West German macro data, Bil DM, from Lutkepohl 1993 Table E.1)

. constraint define 1 [dlincome]dlconsumption = 0

. var dlinvestment dlincome , exog(dlconsumption)  constraint(1)
Estimating VAR coefficients

Iteration 1:   tolerance =    .009279
Iteration 2:   tolerance =  .00221815
Iteration 3:   tolerance =   .0005265
Iteration 4:   tolerance =  .00012476
Iteration 5:   tolerance =  .00002955
Iteration 6:   tolerance =  6.999e-06
Iteration 7:   tolerance =  1.658e-06
Iteration 8:   tolerance =  3.926e-07

Vector autoregression

Constraints:
( 1)  [dlincome]dlconsumption = 0
Sample:  1960q4   1982q4

--------------------------------------------------------------------------
Equation          Obs  Parms        RMSE     R-sq        chi2        P
--------------------------------------------------------------------------
dlinvestment       89      6      .04131    0.1552   16.03491   0.0067
dlincome           89      5     .011078    0.1027    10.1916   0.0373
--------------------------------------------------------------------------

Model lag order selection statistics
------------------------------------
FPE           AIC         HQIC         SBIC         LL        Det(Sigma_ml)
2.682e-07  -9.4336017   -9.2983526   -9.0980553   431.79528      2.094e-07

------------------------------------------------------------------------------
|      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
dlinvestment |
dlinvestment |
L1 |  -.2108975    .101412    -2.08   0.038    -.4096613   -.0121337
L2 |  -.1755615   .1041221    -1.69   0.092     -.379637    .0285141
dlincome     |
L1 |   .5383786   .3850028     1.40   0.162     -.216213     1.29297
L2 |   .1844466   .3982752     0.46   0.643    -.5961584    .9650515
dlconsumpt~n |   1.180586   .4456346     2.65   0.008      .307158    2.054013
_cons        |  -.0125696   .0115283    -1.09   0.276    -.0351647    .0100254
-------------+----------------------------------------------------------------
dlincome     |
dlinvestment |
L1 |   .0597466   .0271441     2.20   0.028     .0065451    .1129481
L2 |   .0563513   .0272629     2.07   0.039      .002917    .1097855
dlincome     |
L1 |   .0209461   .1017687     0.21   0.837    -.1785169     .220409
L2 |   .0833252   .1014303     0.82   0.411    -.1154745    .2821249
dlconsumpt~n |   6.09e-17   1.33e-17     4.59   0.000     3.49e-17    8.69e-17
_cons        |   .0150368   .0028704     5.24   0.000     .0094108    .0206627
------------------------------------------------------------------------------

As described in [R] constraint, there is an alternative syntax when
specifying exclusion restrictions.  The syntax

constraint define # [equation_name] coefficient_list

defines exclusion restrictions for all the coefficients named in
coefficient_list in the specified equation.  To illustrate, I repeat the
previous example using this syntax.

. constraint define 2 [dlincome] dlconsumption

. var dlinvestment dlincome , exog(dlconsumption)  constraint(2)
Estimating VAR coefficients

Iteration 1:   tolerance =    .009279
Iteration 2:   tolerance =  .00221815
Iteration 3:   tolerance =   .0005265
Iteration 4:   tolerance =  .00012476
Iteration 5:   tolerance =  .00002955
Iteration 6:   tolerance =  6.999e-06
Iteration 7:   tolerance =  1.658e-06
Iteration 8:   tolerance =  3.926e-07

Vector autoregression

Constraints:
( 1)  [dlincome]dlconsumption = 0
Sample:  1960q4   1982q4

--------------------------------------------------------------------------
Equation          Obs  Parms        RMSE     R-sq        chi2        P
--------------------------------------------------------------------------
dlinvestment       89      6      .04131    0.1552   16.03491   0.0067
dlincome           89      5     .011078    0.1027    10.1916   0.0373
--------------------------------------------------------------------------

Model lag order selection statistics
------------------------------------
FPE           AIC         HQIC         SBIC         LL        Det(Sigma_ml)
2.682e-07  -9.4336017   -9.2983526   -9.0980553   431.79528      2.094e-07

------------------------------------------------------------------------------
|      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
dlinvestment |
dlinvestment |
L1 |  -.2108975    .101412    -2.08   0.038    -.4096613   -.0121337
L2 |  -.1755615   .1041221    -1.69   0.092     -.379637    .0285141
dlincome     |
L1 |   .5383786   .3850028     1.40   0.162     -.216213     1.29297
L2 |   .1844466   .3982752     0.46   0.643    -.5961584    .9650515
dlconsumpt~n |   1.180586   .4456346     2.65   0.008      .307158    2.054013
_cons        |  -.0125696   .0115283    -1.09   0.276    -.0351647    .0100254
-------------+----------------------------------------------------------------
dlincome     |
dlinvestment |
L1 |   .0597466   .0271441     2.20   0.028     .0065451    .1129481
L2 |   .0563513   .0272629     2.07   0.039      .002917    .1097855
dlincome     |
L1 |   .0209461   .1017687     0.21   0.837    -.1785169     .220409
L2 |   .0833252   .1014303     0.82   0.411    -.1154745    .2821249
dlconsumpt~n |   6.09e-17   1.33e-17     4.59   0.000     3.49e-17    8.69e-17
_cons        |   .0150368   .0028704     5.24   0.000     .0094108    .0206627
------------------------------------------------------------------------------

I hope that this helps.

David
--ddrukker@stata.com
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```