# Meaning of output of function “ar” in R

How should I read the output of the function ar in R. For example, take this VAR model:

library(tseries)
data(USeconomic)
US.ar <- ar(cbind(GNP, M1), method="ols",
dmean=T, intercept=F)


(from the book Introductory Time Series with R by Cowpertwait)

So Us.ar produces the following output:

> US.ar

Call:
ar(x = cbind(GNP, M1), method = "ols", dmean = T, intercept = F)

$ar , , 1 GNP M1 GNP 1.27181 1.167 M1 -0.03383 1.588 , , 2 GNP M1 GNP -0.00423 -0.6942 M1 0.06354 -0.4839 , , 3 GNP M1 GNP -0.26715 -0.5103 M1 -0.02859 -0.1295$var.pred
GNP    M1
GNP 618.69 16.38
M1   16.38 23.90


and US.ar$ar gives this other representation: > US.ar$ar

, , GNP

GNP          M1
1  1.271812104 -0.03383385
2 -0.004229937  0.06353801
3 -0.267154022 -0.02858942

, , M1

GNP         M1
1  1.1674655  1.5876695
2 -0.6941813 -0.4838919
3 -0.5103451 -0.1294549


As I understand it, ,,1 refers to the order of the coefficient in the autoregression model. In the second representation, , , M1 refers to the columns, whereas GNP M1 describe rows and the numbers describe the order. I think this output is describing the following model:

$$GNP_{t} = 1.27 GNP_{t-1} + 1.167 M1_{t-1} - 0.004 GNP_{t-2} - 0.6942 M1_{t-2} - 0.2671 GNP_{t-3} - 0.5104 M1_{t-3}$$

$$M1_{t} = - 0.03 GNP_{t-1} + 1.58 M1_{t-1} + 0.063 GNP_{t-2} - 0.48M1_{t-2} - 0.02 GNP_{t-3} - 0.12 M1_{t-3}$$

Therefore, in matrix notation, this should be equal to: $$\begin{pmatrix} GNP_{t} \\ M1_{t} \\ \end{pmatrix} = \left[ \begin{pmatrix} 1.27 & 1.167 \\ -0.03 & 1.58 \\ \end{pmatrix}x + \begin{pmatrix} -0.004 & -0.6942 \\ 0.063 & -0.48 \\ \end{pmatrix}x^{2} + \begin{pmatrix} -0.267 & -0.5104 \\ -0.02 & -0.12 \\ \end{pmatrix}x^{3} \right] \begin{pmatrix} GNP_{t} \\ M1_{t} \\ \end{pmatrix}$$

However, the book says that the model is this:

As you can see, cross-terms are flipped. Is this a mistake?

The book is correct.

The following refers to the GNP equation where GNP consists of lag of GNP and M1 consists of lag of M1.

, , GNP

GNP          M1
1  1.271812104 -0.03383385
2 -0.004229937  0.06353801
3 -0.267154022 -0.02858942


$$GNP_{t} = 1.27 GNP_{t-1} -0.033 M1_{t-1} - 0.004 GNP_{t-2} + 0.063 M1_{t-2} - 0.2671 GNP_{t-3} - 0.028 M1_{t-3}$$

The following refers to the M1 equation where GNP consists of lag of GNP and M1 consists of lag of M1.

, , M1

GNP         M1
1  1.1674655  1.5876695
2 -0.6941813 -0.4838919
3 -0.5103451 -0.1294549


$$M1_{t} = - 1.167 GNP_{t-1} + 1.58 M1_{t-1} - 0.694 GNP_{t-2} - 0.48M1_{t-2} - 0.510 GNP_{t-3} - 0.12 M1_{t-3}$$

If you arrange this is matrix form, then you will be able to get the same as in the book.

• That was my first interpretation, but it provides different results than the representation based on orders (, , 1,, , 2,, , 3). See this: onlinecourses.science.psu.edu/stat510/?q=node/79. There is another example in the book that would be wrong if this interpretation is chosen. That's why I was forced to assume that , , GNP, , , M1were referring to columns instead of rows. – Robert Smith Sep 22 '13 at 16:10