Laubach and Williams (2003) replication question
Laubach and Williams (2003) replication question
Hi,
I have been trying to update the Laubach Williams natural rate (ReStat 2003) replication program, but am running into a problem from the get-go.
I have run the model1 file that comes with the software and that works fine. However, when I simply update the data, the program produces garbage. The program runs and there is no error message that I can see.
The changes I have made to the original model1 file are as follows:
1) I am using an excel file for the data rather than a RATS data file. The data source is Laubach and Williams, who publish their input data and results in an Excel file on the internet. My input file is saved as an Excel 97-2003 file.
2) I have deleted the reference at the top of the programme to the loghours variable, as I am not interested in this part of the replication.
3) I have deleted the section of the programme where z(t) follows an AR(2) process. This is because I am just looking to replicate the central estimate that they publish publicly.
4) I have changed the original 2002 date at the start to 2016
Other than that, I have not altered a thing. As I say, the program runs and it produces output, but something is going very wrong and I can’t for the life of me see what’s going on.
I attach the program file, the Excel data file that I used and the graphics file which shows the output I get.
Very grateful for any assistance with this.
Best regards,
Rupert
I have been trying to update the Laubach Williams natural rate (ReStat 2003) replication program, but am running into a problem from the get-go.
I have run the model1 file that comes with the software and that works fine. However, when I simply update the data, the program produces garbage. The program runs and there is no error message that I can see.
The changes I have made to the original model1 file are as follows:
1) I am using an excel file for the data rather than a RATS data file. The data source is Laubach and Williams, who publish their input data and results in an Excel file on the internet. My input file is saved as an Excel 97-2003 file.
2) I have deleted the reference at the top of the programme to the loghours variable, as I am not interested in this part of the replication.
3) I have deleted the section of the programme where z(t) follows an AR(2) process. This is because I am just looking to replicate the central estimate that they publish publicly.
4) I have changed the original 2002 date at the start to 2016
Other than that, I have not altered a thing. As I say, the program runs and it produces output, but something is going very wrong and I can’t for the life of me see what’s going on.
I attach the program file, the Excel data file that I used and the graphics file which shows the output I get.
Very grateful for any assistance with this.
Best regards,
Rupert
- Attachments
-
- Output.RGF
- Chart of the outputs generated
- (5 KiB) Downloaded 898 times
-
- LW_Input.xls
- Input data file
- (58.5 KiB) Downloaded 755 times
-
- Model1_LW_Orig_Data.RPF
- Program file
- (6.79 KiB) Downloaded 931 times
Re: Laubach and Williams (2003) replication question
There's an error in the graph labeling---the middle graph should be the (annualized) trend growth rate in GDP. Did you create the expected inflation series? (It's not on the LW spreadsheet). The series on your spreadsheet is substantially more variable than the one in the original paper for the range they have in common.
Re: Laubach and Williams (2003) replication question
The DATA instruction is getting the data misaligned---you don't want that TOP=2 option. And your inflation expectations series is misaligned (by a data point) relative to the inflation data.
This is a revised version of the model1 program which fixes the graph labeling and includes a loop to generate the inflation expectations. It doesn't exactly reproduce the results on the original data file, but appears to be close enough that it probably has the correct procedure.
It should be noted, however, that the LW spreadsheet looks wrong. The gap at the height of the great recession is only -1.5, much smaller than the much milder recession in 1991-2. When I correct everything, I get more like -6.
This is a revised version of the model1 program which fixes the graph labeling and includes a loop to generate the inflation expectations. It doesn't exactly reproduce the results on the original data file, but appears to be close enough that it probably has the correct procedure.
It should be noted, however, that the LW spreadsheet looks wrong. The gap at the height of the great recession is only -1.5, much smaller than the much milder recession in 1991-2. When I correct everything, I get more like -6.
Re: Laubach and Williams (2003) replication question
Hi Tom,
Thanks very much for replying so quickly. On the inflation expectations front, I used a rolling regression (AR(3) I think) with a 10 year rolling window of inflation on its own lags, as this is what I understood from page 23 of the LW paper is what they used. Regression program I used attached. Having seen your program, I have a feeling I have missed a step, which is why I get the added variability.
I don't quite understand what you mean when you say that my inflation expectations series is misaligned by one data point. Could you expand on that please?
On the output gap errors, you may be right. Figure 8 near the end of the updated LW paper from (2015) has an output gap of -4% - although I can't tell whether that is generated from the filtered or smoothed estimates. Link: www.frbsf.org/economic-research/files/wp2015-16.pdf
Many thanks again for the help.
Best regards,
Rupert
Thanks very much for replying so quickly. On the inflation expectations front, I used a rolling regression (AR(3) I think) with a 10 year rolling window of inflation on its own lags, as this is what I understood from page 23 of the LW paper is what they used. Regression program I used attached. Having seen your program, I have a feeling I have missed a step, which is why I get the added variability.
I don't quite understand what you mean when you say that my inflation expectations series is misaligned by one data point. Could you expand on that please?
On the output gap errors, you may be right. Figure 8 near the end of the updated LW paper from (2015) has an output gap of -4% - although I can't tell whether that is generated from the filtered or smoothed estimates. Link: www.frbsf.org/economic-research/files/wp2015-16.pdf
Many thanks again for the help.
Best regards,
Rupert
- Attachments
-
- Exp_inf.xls
- Program
- (35.5 KiB) Downloaded 698 times
-
- Exp_inf_rollreg.RPF
- Input data
- (13.99 KiB) Downloaded 895 times
Re: Laubach and Williams (2003) replication question
Hi Tom,
Bad news unfortunately. I have put my input data into the program you uploaded and it is churning out a wrong result again. This time I do get an error message during the second stage of the estimation:
DLM - Estimation by BFGS
NO CONVERGENCE IN 138 ITERATIONS
LAST CRITERION WAS 0.0000000
ESTIMATION POSSIBLY HAS STALLED OR MACHINE ROUNDOFF IS MAKING FURTHER PROGRESS DIFFICULT
TRY HIGHER SUBITERATIONS LIMIT, TIGHTER CVCRIT, DIFFERENT SETTING FOR EXACTLINE OR ALPHA ON NLPAR
RESTARTING ESTIMATION FROM LAST ESTIMATES OR DIFFERENT INITIAL GUESSES MIGHT ALSO WORK
I'm wondering if I'm doing something wrong at the data input step? I took the top=2 bit out as per your last message, but I'm worried that I need to be doing something else here. It makes no sense to me that your program ran perfectly again for the original data file you have in your replication files (the one that runs to 2002) and then the second I put in my data, all of which is taken directly from LW (apart from the inflation expectations estimate), the whole thing blows up. Unless I am doing something wrong at this step.
Grateful for any help.
Best regards,
Rupert
Bad news unfortunately. I have put my input data into the program you uploaded and it is churning out a wrong result again. This time I do get an error message during the second stage of the estimation:
DLM - Estimation by BFGS
NO CONVERGENCE IN 138 ITERATIONS
LAST CRITERION WAS 0.0000000
ESTIMATION POSSIBLY HAS STALLED OR MACHINE ROUNDOFF IS MAKING FURTHER PROGRESS DIFFICULT
TRY HIGHER SUBITERATIONS LIMIT, TIGHTER CVCRIT, DIFFERENT SETTING FOR EXACTLINE OR ALPHA ON NLPAR
RESTARTING ESTIMATION FROM LAST ESTIMATES OR DIFFERENT INITIAL GUESSES MIGHT ALSO WORK
I'm wondering if I'm doing something wrong at the data input step? I took the top=2 bit out as per your last message, but I'm worried that I need to be doing something else here. It makes no sense to me that your program ran perfectly again for the original data file you have in your replication files (the one that runs to 2002) and then the second I put in my data, all of which is taken directly from LW (apart from the inflation expectations estimate), the whole thing blows up. Unless I am doing something wrong at this step.
Grateful for any help.
Best regards,
Rupert
- Attachments
-
- model1_NEW_Test.RPF
- Your new base program using same input data as before
- (24.45 KiB) Downloaded 886 times
Re: Laubach and Williams (2003) replication question
I'm not that surprised. The replication file was based upon their Gauss programs for the published paper which had certain things hard-coded in (the two pegged lambdas in particular) that were clearly estimated in a separate step. Those very likely will have changed (perhaps substantially) in re-estimating the whole model using an extra 15 years of data, particularly since they come from backing out a value from the most extreme break in the data set, which most likely would now be in 2008 or thereabouts.
Re: Laubach and Williams (2003) replication question
Hi Tom,
That's a fair thought, but just on the lambda front, the LW public spreadsheet (http://www.frbsf.org/economic-research/ ... mates.xlsx) contains the updated values of the lambdas on the third worksheet and they both fall well within the high & low boundaries set in the original paper (https://www.federalreserve.gov/pubs/fed ... 156pap.pdf). So I'm not convinced that's necessarily changed that much, despite the big swing in 2008. Also, I'm a bit of an optimist, so I like to think it's still doable!
Can I take it then that the problem is not with my data step? Also, I didn't quite understand what you meant by my expectations series being misaligned. It didn't seem to be when I looked at my Excel file. Could you clarify?
Best regards,
Rupert
That's a fair thought, but just on the lambda front, the LW public spreadsheet (http://www.frbsf.org/economic-research/ ... mates.xlsx) contains the updated values of the lambdas on the third worksheet and they both fall well within the high & low boundaries set in the original paper (https://www.federalreserve.gov/pubs/fed ... 156pap.pdf). So I'm not convinced that's necessarily changed that much, despite the big swing in 2008. Also, I'm a bit of an optimist, so I like to think it's still doable!
Can I take it then that the problem is not with my data step? Also, I didn't quite understand what you meant by my expectations series being misaligned. It didn't seem to be when I looked at my Excel file. Could you clarify?
Best regards,
Rupert
Re: Laubach and Williams (2003) replication question
Hi Tom,
Sorry to bother again, but was hoping you could help me with something? In parallel to my efforts on the US, I'm also trying to adapt the replication code for some other countries, as in HLW (2016), which I have attached. I have hit one small snag on the first stage of the estimation process, which I suspect is something to do with how I have set up the DLM procedure. The good news is that the parameters and variances I have are not a million miles away from those reported on page 19 for a1 a2 and b3, g sigma 1 sigma 2 and sigma 4. However, as can be seen from the attached charts, there is an inexplicable monster jump in the trend growth rate in the first quarter for which I have run the DLM procedure. Can you see from my program where I have made my error?
Grateful for any help with this.
Best regards,
Rupert
Sorry to bother again, but was hoping you could help me with something? In parallel to my efforts on the US, I'm also trying to adapt the replication code for some other countries, as in HLW (2016), which I have attached. I have hit one small snag on the first stage of the estimation process, which I suspect is something to do with how I have set up the DLM procedure. The good news is that the parameters and variances I have are not a million miles away from those reported on page 19 for a1 a2 and b3, g sigma 1 sigma 2 and sigma 4. However, as can be seen from the attached charts, there is an inexplicable monster jump in the trend growth rate in the first quarter for which I have run the DLM procedure. Can you see from my program where I have made my error?
Grateful for any help with this.
Best regards,
Rupert
- Attachments
-
- HLW_2016.pdf
- HLW 2016 paper
- (456.81 KiB) Downloaded 692 times
-
- EA_Est_Data_3.xls
- Input data used
- (48.5 KiB) Downloaded 750 times
-
- EA_Stage_1_Error_Charts.RGF
- Charts showing the problem
- (2.76 KiB) Downloaded 880 times
-
- LW_EA_Stage1_Board.RPF
- Program file
- (7.99 KiB) Downloaded 885 times
Re: Laubach and Williams (2003) replication question
Do the graphs only from 1975:1 on---those are the only ones that the model itself is computing. As written, it's also graphing the pre-sample values.
Re: Laubach and Williams (2003) replication question
Hi Tom,
Thanks very much for the advice, that makes much more sense to me now. Frustratingly this has thrown up one more oddity as follows. The trend growth rate stage 1 output I get for the Euro Area is very volatile, whereas the equivalent for the US has a constant growth rate (this is after the first DLM command has been run). But I see no reason why that should be as the program code for both is identical (all I have done in the EA case is drop the oil and energy inflation variables from the Phillips curve). I was expecting the Euro Area model to give me a trend growth rate with a similarly very low variance as a result. Sorry to keep asking for favours, but could you have a quick look at the two programs and see if there is anything different in the code? As you will see, the parameters for the IS, Phillips, trend growth and dystar equations for the EA are very much in the same ball-park as the US estimates. Further, I have set the formula matrices in the same way in both.
Any help greatly appreciated.
Best regards,
Rupert
Thanks very much for the advice, that makes much more sense to me now. Frustratingly this has thrown up one more oddity as follows. The trend growth rate stage 1 output I get for the Euro Area is very volatile, whereas the equivalent for the US has a constant growth rate (this is after the first DLM command has been run). But I see no reason why that should be as the program code for both is identical (all I have done in the EA case is drop the oil and energy inflation variables from the Phillips curve). I was expecting the Euro Area model to give me a trend growth rate with a similarly very low variance as a result. Sorry to keep asking for favours, but could you have a quick look at the two programs and see if there is anything different in the code? As you will see, the parameters for the IS, Phillips, trend growth and dystar equations for the EA are very much in the same ball-park as the US estimates. Further, I have set the formula matrices in the same way in both.
Any help greatly appreciated.
Best regards,
Rupert
- Attachments
-
- EA_Board_Post_TD_Exch.XLSX
- US and EA trend growth outputs
- (40.37 KiB) Downloaded 792 times
-
- EA_Est_Data_3.xls
- Euro Area input data
- (48.5 KiB) Downloaded 693 times
-
- LW_EA_Stage1_Board.RPF
- EA stage 1 program
- (7.99 KiB) Downloaded 879 times
-
- LW_Input_1.xls
- US input data
- (53 KiB) Downloaded 723 times
-
- Stage_1_Updated_Data.RPF
- US stage 1 with up to date input data
- (9.17 KiB) Downloaded 901 times
Re: Laubach and Williams (2003) replication question
This isn't out of the original program and isn't going to work.
set grate = ystar-ystar{1}
YSTAR is only defined (by the DLM instruction) from the estimation start on so this is picking up the presample calculation of YSTAR for the lag at the first data point. Instead, use
set grate %regstart() %regend() = xstates(t)(1)-xstates(t)(2)
which uses the state that the model defines to be the lagged value of ystar. (Though, by construction, this will just be fixed at the estimated value of g through the whole range).
Note also, that you still have several graphs that are graphing over a range which includes the presample calculations. If you tell the program to graph YSTAR without an explicit range, it will graph everything that it has for that.
set grate = ystar-ystar{1}
YSTAR is only defined (by the DLM instruction) from the estimation start on so this is picking up the presample calculation of YSTAR for the lag at the first data point. Instead, use
set grate %regstart() %regend() = xstates(t)(1)-xstates(t)(2)
which uses the state that the model defines to be the lagged value of ystar. (Though, by construction, this will just be fixed at the estimated value of g through the whole range).
Note also, that you still have several graphs that are graphing over a range which includes the presample calculations. If you tell the program to graph YSTAR without an explicit range, it will graph everything that it has for that.
Re: Laubach and Williams (2003) replication question
Hi Tom,
Thanks for this and for the tip about the charts. I've amended the line defining the trend growth rate, but I am still having the issue with the volatility of the trend growth estimate. This is most evident in the output for the DLM step, which for the EA has similar parameter estimates as for the US stage 1 program (programs attached), but with one major difference. For some reason the estimate of sigma 4 in the EA case is 0.3, which is huge, especially considering that sigma 4 in the US case is estimated at -0.000001419. As you say above, the DLM for step 1 should be holding the trend growth rate constant, but it is clear from the charts and the parameter output that it is not doing so in the EA estimation. Given that the output for all of the previous steps looks the same (except the Philips curve equation, which does not have the energy or import price components), as does the basic input code (e.g. the formula matrices for zf and sig4 are identically specified in both programs), the estimate of the variance of sigma 4 in the EA case should look like that in the US case and doesn't.
I'd be very grateful for any advice as to what is going on.
Best regards,
Rupert
Thanks for this and for the tip about the charts. I've amended the line defining the trend growth rate, but I am still having the issue with the volatility of the trend growth estimate. This is most evident in the output for the DLM step, which for the EA has similar parameter estimates as for the US stage 1 program (programs attached), but with one major difference. For some reason the estimate of sigma 4 in the EA case is 0.3, which is huge, especially considering that sigma 4 in the US case is estimated at -0.000001419. As you say above, the DLM for step 1 should be holding the trend growth rate constant, but it is clear from the charts and the parameter output that it is not doing so in the EA estimation. Given that the output for all of the previous steps looks the same (except the Philips curve equation, which does not have the energy or import price components), as does the basic input code (e.g. the formula matrices for zf and sig4 are identically specified in both programs), the estimate of the variance of sigma 4 in the EA case should look like that in the US case and doesn't.
I'd be very grateful for any advice as to what is going on.
Best regards,
Rupert
- Attachments
-
- Stage_1_Updated_Data.RPF
- US stage 1 for comparison (note the sigma 4 estimate in the DLM step output)
- (9.17 KiB) Downloaded 873 times
-
- LW_EA_Stage1_Board.RPF
- EA stage 1 (same input data as before) amended grate line
- (8.03 KiB) Downloaded 892 times
Re: Laubach and Williams (2003) replication question
Check your data. It either doesn't start where you think it does, or doesn't end where you think it does.
Re: Laubach and Williams (2003) replication question
Hi Tom,
Many thanks for the advice. So I have checked my input data for the EA program using both the original Excel file (annotated version attached to which I have added in column headings and dates) and also using the table print option in RATS itself at various stages of the process (also attached). As far as I can see, all of the input and output variables start and end where they should. The DLM step in the program is declared as starting in 1975:1, which as you can see coincides with the first observation for the expected inflation variable (second data table in the program output). Also, all of the variables end at the same time, in 2016:3.
So it doesn't look like an issue of start dates and end dates. Grateful for any other thoughts as to where the DLM step I'm executing might be skipping a beat on the estimate of sigma4.
Thanks again for your patience and help with this.
Best regards,
Rupert
Many thanks for the advice. So I have checked my input data for the EA program using both the original Excel file (annotated version attached to which I have added in column headings and dates) and also using the table print option in RATS itself at various stages of the process (also attached). As far as I can see, all of the input and output variables start and end where they should. The DLM step in the program is declared as starting in 1975:1, which as you can see coincides with the first observation for the expected inflation variable (second data table in the program output). Also, all of the variables end at the same time, in 2016:3.
So it doesn't look like an issue of start dates and end dates. Grateful for any other thoughts as to where the DLM step I'm executing might be skipping a beat on the estimate of sigma4.
Thanks again for your patience and help with this.
Best regards,
Rupert
- Attachments
-
- EA_Est_Data_3_With_Notes.xls
- This is not the actual data file used as that has no headers or dates. This is the annotated version with headers and dates.
- (63.5 KiB) Downloaded 733 times
-
- LW_EA_Data_Print.RPF
- The program with 3 data tables included. As far as the program goes, the data is starting and ending in the right quarter both before and after the DLM step
- (117.14 KiB) Downloaded 843 times
Re: Laubach and Williams (2003) replication question
The program that was causing problems says that the data start in 1948:1 and end in 2016:3:
but it only has data through 2002:4 if it starts in 1948:1. It looks like the start period on the data instruction is wrong. (There are also other instructions which are dated too early for your data set).
I would really strongly advise you not to chop the dates and labels out of the file. Just use a RIGHT option to get rid of the notes on the margin on the original data file.
Code: Select all
open data "C:\Users\Public\Documents\Estima\WinRATS Std 9.1\PaperReplicationExamples\Laubach Williams RESTAT 2003\US Tests\LW_input_1.xls"
calendar(q) 1948:1
data(format=xls,nolabels,org=columns) 1948:01 2016:03 logrgdp $
pceinflation expinflation oilinflation impinflation shortrate
I would really strongly advise you not to chop the dates and labels out of the file. Just use a RIGHT option to get rid of the notes on the margin on the original data file.