Questions and discussions on Vector Autoregressions

to every teacher:
i'm a beginner,and i had not known about historical decomposition,such an example of 10.5 in rats 7.0 User's Guide.What does three lines stand for each other?
Second,the attachment is a paper about pass-through exchange historical decomposition,i don't konw how caculate the numbers of "historical decompositiono of CPI" and so on. thank you
Attachments
pass-through exchange.pdf
pass-through exchange
YWZHENG

Posts: 7
Joined: Thu Aug 04, 2011 8:02 am

YWZHENG wrote:such an example of 10.5 in rats 7.0 User's Guide.What does three lines stand for each other?

Sorry, I'm not sure what you are asking. Can you explain your question in more detail?

Thanks,
Tom Maycock
Estima
moderator

Posts: 306
Joined: Thu Oct 19, 2006 4:33 pm

an content of 10.7 in rats 7.0 User's Guide. page 372 .
the gragh show the effect of interest rate on canadian GDP
What does three lines stand for each other?
YWZHENG

Posts: 7
Joined: Thu Aug 04, 2011 8:02 am

and how caculate the historical decomposition of CPI in page 20 of pass-through exchange.pdf.
thank you
YWZHENG

Posts: 7
Joined: Thu Aug 04, 2011 8:02 am

With respect to your question, I believe this is largely explained in the text above the question, and becomes more obvious if you just run the entire example. The solid line is the actual GDP. The dotted line is the base forecast. The dashed line is the effect of (in this case) the interest rate shock.

Regards,
Tom Maycock
Estima
moderator

Posts: 306
Joined: Thu Oct 19, 2006 4:33 pm

YWZHENG wrote:and how caculate the historical decomposition of CPI in page 20 of pass-through exchange.pdf.
thank you

The table would appear to be a decomposition of the change in the import price between 1995:4 and 1998:4. Given data through 1995:4, the projected change in U.S. import prices is .7, the actual change was -3.8. The difference between the two (-4.4 as they did the calculations) can be written as the sum of the cumulated effects of the six shocks during the period 1996:1 to 1998:4. The authors are grouping those six shocks into three sets of two, so the sums of the pairs are the left three columns.

The example in the RATS UG uses the ADD option, which is useful for graphing. For doing the calculation in the paper, it's better to use HISTORY without ADD. For the model in the UG, that would be:

history(model=canmodel,results=history,from=hstart,to=hend)

For variable J in the model (whose actual values are in series Y), and for any time period T+h (where T is the base period for the forecasts), the HISTORY series will satisfy (by construction)

HISTORY(1,J)(T+h)+HISTORY(2,J)(T+h)+...+HISTORY(7,J)(T+h)=Y(T+h)

The calculation in the paper subtracts the base observed value Y(T) from both sides to give:

(HISTORY(1,J)(T+h)-Y(T))+HISTORY(2,J)(T+h)+...+HISTORY(7,J)(T+h)=Y(T+h)-Y(T)

The first term on the left is the forecast changed; the right side is the actual change. The other summands on the left are grouped by twos and added together.
TomDoan

Posts: 2722
Joined: Wed Nov 01, 2006 5:36 pm

thank you for moderator and TomDoan. I'm sorry for my behavior.
First,in page 372 of rats 7.0 UG,what's the relationship between each other? The solid line( actual GDP)= the base forecast(dotted line)+the effect of (in this case) the interest rate shock(The dashed line)? but the values of those are nearly.
Second,After I run the history.prg, I click the "data menu","show series window" and will show the list of series including history(1,1),history(2,1)and so on.What does they mean? history(1,1)is the base forecast,and the history(2,1)is the first shock? the values of history(j,1)are nearly.j=1,2,3,4,5,6.
Third,how caculate the catual GDP(in this case),base forecast and each shock by rats program such as pass-through exchange.pdf? I don't understand.

Thank you
YWZHENG

Posts: 7
Joined: Thu Aug 04, 2011 8:02 am

YWZHENG wrote:thank you for moderator and TomDoan. I'm sorry for my behavior.
First,in page 372 of rats 7.0 UG,what's the relationship between each other? The solid line( actual GDP)= the base forecast(dotted line)+the effect of (in this case) the interest rate shock(The dashed line)? but the values of those are nearly.

As described in the long post above, the actual is the sum of the forecast plus the accumulated effects of all six shocks. The dashed line is the forecast plus the accumulated effect of just the interest rate shock. Because the effects of any of the shocks can be both positive and negative, it's possible for one shock to account for more than 100% of the difference between actual and forecast.

YWZHENG wrote:Second,After I run the history.prg, I click the "data menu","show series window" and will show the list of series including history(1,1),history(2,1)and so on.What does they mean? history(1,1)is the base forecast,and the history(2,1)is the first shock? the values of history(j,1)are nearly.j=1,2,3,4,5,6.

HISTORY(1,1) is the forecast for the first series; HISTORY(2,1) is the accumulated effect of the first shock to the first series, ... , HISTORY(N+1,1) is the accumulated effect of shock N to the first series.

YWZHENG wrote:Third,how caculate the catual GDP(in this case),base forecast and each shock by rats program such as pass-through exchange.pdf? I don't understand.

I believe I explained that in detail before.
TomDoan

Posts: 2722
Joined: Wed Nov 01, 2006 5:36 pm

as you described in post above,HISTORY(1,1) is the forecast for the first series; HISTORY(2,1) is the accumulated effect of the first shock to the first series, ... , HISTORY(N+1,1) is the accumulated effect of shock N to the first series.

First, as described in post above, the acual values of valiable j =HISTORY(1,j)+HISTORY(2,j)+...+HISTORY(7,j)=Y(T+h) ? j=1,2,3,4,5,6 (the are total 6 valiables)
++++++and HISTORY(1,1) is the forecast for the first series(is the base foecast of GDP of example of US or project as table 7 of pass-through exchange.pdf)?
++++I can find the the value of HISTORY(1,J) but not the HISTORY(1,J)(T+h) in winrats(history.prg),are there equal ?
++++and what's the Y(T) ? in case of pass-throughe exchange, Y(T)is the value of data of 1995:4 or 2003:1 in history.prg (US) ?

Second, As described in the long post above, the actual is the sum of the forecast plus the accumulated effects of all six shocks.The dotted line is forecast plus the accumulated effect of just the interest rate shock.
My question is : the actual abstract forecase (The dotted line)is other five shocks to first valiable ? "the actual is the sum of the forecast plus the accumulated effects of all six shocks" is the same as " the actual the forecast plus the accumulated effects of all six shocks "?

Third, The moderator considered that "The solid line is the actual GDP. The dotted line is the base forecast. The dashed line is the effect of (in this case) the interest rate shock" is different from yours.What' your opinion about the dashed line ?
How should I understand about " We can see the almost the entirely difference bewteen actual GDP(the solid line) and base forsecast can be contribuated to the interest rate shocks " as described on the page of 372 of the winrats 7.0 UG by graph ?

Thank you very much
YWZHENG

Posts: 7
Joined: Thu Aug 04, 2011 8:02 am

As you decribed above, HISTORY(1,1) is the forecast for the first series; HISTORY(2,1) is the accumulated effect of the first shock to the first series, ... , HISTORY(N+1,1) is the accumulated effect of shock N to the first series.

But I find that the average value of HISTORY(1,1)=(forecast for the first series) and all of the HISTORY(N+1,1) are about 14 in history.prg in winrats 7.0.
I think there should be noticeable difference between HISTORY(1,1) and HISTORY(N+1,1),so as HISTORY(N+1,1) each other,but there are nearly. I think thre are maybe misunderstanding.

HISTORY(1,J)(T+h)+HISTORY(2,J)(T+h)+...+HISTORY(7,J)(T+h)= 7*14= ? = Y(T+h)
YWZHENG

Posts: 7
Joined: Thu Aug 04, 2011 8:02 am

YWZHENG wrote:Third, The moderator considered that "The solid line is the actual GDP. The dotted line is the base forecast. The dashed line is the effect of (in this case) the interest rate shock" is different from yours.What' your opinion about the dashed line ?
How should I understand about " We can see the almost the entirely difference bewteen actual GDP(the solid line) and base forsecast can be contribuated to the interest rate shocks " as described on the page of 372 of the winrats 7.0 UG by graph ?

Thank you very much

I used dotted where I meant dashed (which I've now corrected).
TomDoan

Posts: 2722
Joined: Wed Nov 01, 2006 5:36 pm

YWZHENG wrote:As you decribed above, HISTORY(1,1) is the forecast for the first series; HISTORY(2,1) is the accumulated effect of the first shock to the first series, ... , HISTORY(N+1,1) is the accumulated effect of shock N to the first series.

But I find that the average value of HISTORY(1,1)=(forecast for the first series) and all of the HISTORY(N+1,1) are about 14 in history.prg in winrats 7.0.
I think there should be noticeable difference between HISTORY(1,1) and HISTORY(N+1,1),so as HISTORY(N+1,1) each other,but there are nearly. I think thre are maybe misunderstanding.

HISTORY(1,J)(T+h)+HISTORY(2,J)(T+h)+...+HISTORY(7,J)(T+h)= 7*14= ? = Y(T+h)

As I said above, the example in the RATS manual uses the ADD option which adds the base forecast to all the shock effects. That makes it easier to use in the types of graphs in the manual, but they no longer satisfy the identity since the base forecast would be in the sum seven times.

If you're having trouble understanding this, I would suggest that you take a much smaller model, do HISTORY without the ADD option, and play with the numbers a bit. I just posted to the forum the replication for the Quah-Vahey EJ 1995 paper (http://www.estima.com/forum/viewtopic.php?f=8&t=1156) where the main calculation is an example of historical decomposition. There's also a forum post which includes a link to a more complete description of historical decomposion and related topics: http://www.estima.com/forum/viewtopic.php?f=4&t=655
TomDoan

Posts: 2722
Joined: Wed Nov 01, 2006 5:36 pm

Thank you very much. Your meaning is that the formula will be identified if substract ADD option ? I try it and find the values of history(N+1,1)be changed largerly.
and the example of winrats 7.0 US (on the pages of 372) decribed solid line is actural(GDP) ,the dotted line is forecast(GDP) and the dashed line is the forecast plus first shock to GDP ?

It's so kind of you
YWZHENG

Posts: 7
Joined: Thu Aug 04, 2011 8:02 am

Hello,

I am estimating a 6 variable VAR and I was interested in carrying out the historical decomposition procedure. Upon reading the user guide. I came up with the following procedure after setting up and estimating the VAR.

Code: Select all
`****************************************************************SET UP/ESTIMATE VAR SYSTEM***************************************************************compute neqn = 6compute nlags = 2compute nsteps = 12compute ndraws = 10000system(model=canvar)variables OILP CAN_CPI_INF CAN_GDEF_INF CAN_WAG_INF CAN_OUTPUT CAN_URlags 1 to nlagsdet constantend(system)estimate(noprint,resids=varresidscan)***********************************************************************HISTORICAL DECOMPOSITION**********************************************************************compute hstart = 1970:01compute hend  = 2010:04compute modelsize=%modelsize(canvar)dec vect[int] depvar(modelsize)dec vect[labels] varlabels(modelsize)ewise varlabels(i)=%modellabel(canvar,i)compute depvar=%modeldepvars(canvar)*estimate(noprint,noftests,resids=resids)history(model=canvar,add,results=history,from=hstart,to=hend)do j=1,6   spgraph(hfields=2,vfields=3,window=varlabels(j),\$     header="Historical Decomposition of "+varlabels(j))   do i=1,6      graph(header="Effect of "+varlabels(i)) 3      # depvar(j) hstart-4 hend      # history(1,j)      # history(1+i,j)   end do j   spgraph(done)`

The problem I have upon obtaining the output is I would like to obtain the effect of shocks in one variable in the variations in other variables as a standalone as opposed to the present output which is the historical decomposition of all the series to one another. Put simply I want to isolate the historical decomposition of a shock to one variable in all the others. In my case that of an oil shock on all the other series.

Thanks
WALLE

Posts: 14
Joined: Thu Jul 21, 2011 12:24 pm

WALLE wrote:Hello,

I am estimating a 6 variable VAR and I was interested in carrying out the historical decomposition procedure. Upon reading the user guide. I came up with the following procedure after setting up and estimating the VAR.

Code: Select all
`****************************************************************SET UP/ESTIMATE VAR SYSTEM***************************************************************compute neqn = 6compute nlags = 2compute nsteps = 12compute ndraws = 10000system(model=canvar)variables OILP CAN_CPI_INF CAN_GDEF_INF CAN_WAG_INF CAN_OUTPUT CAN_URlags 1 to nlagsdet constantend(system)estimate(noprint,resids=varresidscan)***********************************************************************HISTORICAL DECOMPOSITION**********************************************************************compute hstart = 1970:01compute hend  = 2010:04compute modelsize=%modelsize(canvar)dec vect[int] depvar(modelsize)dec vect[labels] varlabels(modelsize)ewise varlabels(i)=%modellabel(canvar,i)compute depvar=%modeldepvars(canvar)*estimate(noprint,noftests,resids=resids)history(model=canvar,add,results=history,from=hstart,to=hend)do j=1,6   spgraph(hfields=2,vfields=3,window=varlabels(j),\$     header="Historical Decomposition of "+varlabels(j))   do i=1,6      graph(header="Effect of "+varlabels(i)) 3      # depvar(j) hstart-4 hend      # history(1,j)      # history(1+i,j)   end do j   spgraph(done)`

The problem I have upon obtaining the output is I would like to obtain the effect of shocks in one variable in the variations in other variables as a standalone as opposed to the present output which is the historical decomposition of all the series to one another. Put simply I want to isolate the historical decomposition of a shock to one variable in all the others. In my case that of an oil shock on all the other series.

Thanks

This reverses the order of the nested loops at the end so the graphs are grouped by shock rather than by target variable. If you want just one set of shocks, you can run the outer do over just one value (such as do i=3,3)

Code: Select all
`do i=1,6   spgraph(hfields=2,vfields=3,window=varlabels(i),\$      header="Effect of "+varlabels(i))   do j=1,6      graph(header=varlabels(j)) 3      # depvar(j) hstart-4 hend      # history(1,j)      # history(1+i,j)   end do j   spgraph(done)end do i`
TomDoan

Posts: 2722
Joined: Wed Nov 01, 2006 5:36 pm

Next