tavera wrote:Recently, someone posted a Rats program which permits to replicate the basic results of Giorgio Primiceri, (2005), "Time Varying Structural Vector Autoregressions and Monetary Policy," Review of Economic Studies, 72, 821-852.
I have tried to use this program to analyse the transmission mechanims among monthly prices for three agricultural products (wheat, corn and soybean). However, the program beaks down systematically with these data series and I get the following message :
## EQ4. Equation %MODELEQN(VARMOD Has At Least One Undefined or NA Coefficient
The Error Occurred At Location 612, Line 27 of loop/block
How can I find where the error is ?
Copies of the program , the data base and the procedure are attached to this mail.
Thanks in adavance
You need to clean up your set up code, as you have quite a bit of date information that was copied from the original program that doesn't match yours. For instance, in the following, you're setting endsmpl based upon the 1981:4 start point (which is the CALENDAR at work at that point) rather than the 1976:1 that you actually want.
- Code: Select all
comp styr = 1981
cal(m) styr:4
comp stsmpl = styr:4
comp endsmpl = 2011:1 ;* "endsmpl" is the last observation period.
That all should go.
Also, there are some settings for IMPDATES (the dates at which the impulse responses are computed) later in the program file that should be brought up into the set up code, and replaced with values that are appropriate for your data set. (I've done that here, but you'll also have to delete the old ones in the program file).
- Code: Select all
********************************
******************************** reading in Koop's data
********************************
OPEN DATA montlypricecornwheatsojadeb81.RAT
CALENDAR(M) 1976
ALL 2021:12
DATA(FORMAT=RATS) 1976:01 2011:01 SOYBEAN CORN WHEAT PETROL
comp endsmpl = 2011:1 ;* "endsmpl" is the last observation period.
close
comp nstep = 16 ;* number of impulse response steps
comp [vec[int]] impdates = ||1990:1,2000:1,2010:1||
*dofor i = pigdp
* set(scratch) i stsmpl+1 endsmpl = 400.*log(i{0}/i{1})
*end do i
** for storing variable names, allocate label vector and order position of real variable
dec vec[string] varlabels(nvar)
dec vec[ser] y(nvar)
comp k = 0
dofor i = wheat corn soybean
comp k = k+1
set y(k) = i{0}
comp varlabels(k) = %l(i)
end do i
********************************
******************************** setting data sample, and weighting energy inflation
********************************
comp prenobs = 60
comp stpt = 1987:1
comp endpt = endsmpl