Measuring comovement wit VAR forecast errors

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.

Measuring comovement wit VAR forecast errors

Postby turkhanali » Thu Mar 18, 2010 9:25 pm

Dear All,
I am trying to write RATS code to implement Secion 3 and Section 4 of Paper by Wouter Haan and Steven Sumner (2004), 'The comovement between real activity and Price in the G7', European Economic Review 48: 1333-1347. In which they measured the comovement between price and output using the correlation coeffient of forecast errors from vector autoregressive (VAR) system at different forecast horizons as proposed by DEn Haan (2000). As my my understanding, they implemented using RATS code. my questions is does any have such kind code to calculate the cross correlations coefficient and come out with graph such as figure 1 shown the above mentioned paper. Is it possible to do graph as figure 1 using RATS, having different symbol to indicate the significance of the correlations coefficents.
Thanks in advance.
turkhanali
 
Posts: 16
Joined: Fri Jul 17, 2009 1:47 am

Re: Measuring comovement wit VAR forecast errors

Postby TomDoan » Fri Mar 19, 2010 4:39 pm

For either GRAPH or SCATTER, if you want to take a series and graph part of its range in one symbol/color/pattern and part of it in another, use %IF to NA out the desired ranges out of copies of the series. For instance, this does an x-y scatter using one symbol for the data through 1973:1 and another for after that:

Code: Select all
set logp1973 = %if(t<=1973:1,logp,%na)
set logp1974 = %if(t>1973:1,logp,%na)
scatter(patterns,klabels=||"1953-1973","1974-2004"||,key=upleft) 2
# loggp logp1973
# loggp logp1974


The result looks like:

splitstyles.pdf
(9.37 KiB) Downloaded 153 times


Note that you don't graph the original logp, but the two copies with different NA-ranges. This particular case could also be done with

Code: Select all
scatter(patterns,klabels=||"1953-1973","1974-2004"||,key=upleft) 2
# loggp logp * 1973:1
# loggp logp 1974:1 *


but that only works when the ranges are consecutive sets of entries.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Measuring comovement wit VAR forecast errors

Postby turkhanali » Mon Mar 22, 2010 3:19 am

Thanks for Tom Doan for your information.

I am wondering is there any fast way to come out with the similar results with multiple looping procedure. I have read the paper and text book of Hamilton I am still confused to comw up with some workable code. Anyone could help on this? Thank you in advance. :cry:
turkhanali
 
Posts: 16
Joined: Fri Jul 17, 2009 1:47 am

Re: Measuring comovement wit VAR forecast errors

Postby TomDoan » Mon Mar 22, 2010 3:20 pm

A modernized version of the original RATS code is now available at:

http://www.estima.com/forum/viewtopic.php?f=4&t=642
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm


Return to Help With Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron