Laubach and Williams RESTAT 2003

Use this forum for posting example programs or short bits of sample code.

Re: Laubach and Williams RESTAT 2003

Unread postby lali62 » Mon Jun 05, 2017 3:57 pm

Ok. I just wanted to know if the gap estimated from stage 2 should be used in stage 3 estimation. Currently stage1 gap is being used in stage 3 estimations. I do not have access to the gauss code, so wanted to confirm
if this is correct.
lali62
 
Posts: 21
Joined: Wed Mar 22, 2017 7:04 pm

Re: Laubach and Williams RESTAT 2003

Unread postby TomDoan » Tue Jun 06, 2017 11:01 am

It's "used" in the 3rd stage to get guess values for the parameters, nothing more.
TomDoan
 
Posts: 7231
Joined: Wed Nov 01, 2006 5:36 pm

Re: Laubach and Williams RESTAT 2003

Unread postby asmith05 » Tue Jun 13, 2017 10:53 am

Hi Tom,
When I look at the smoothed state estimates from this code they look quite reasonable; however, the filtered output is incredibly volatile for the first few quarters of the sample before settling down.

Is this a problem unique to this model (For example, from what I understand, Laubach and Williams use a different method for initializing the states than the presample=ergodic option in RATS)?

Or, is this a common issue in non-stationary SS models? In other words, is there a reason in such models to discount the first few periods of filtered state estimates when the SS model is non-stationary (even if one uses the ergodic method in RATS to initialize the model)? Should we instead focus on the smoothed estimates in this case?

Also, a clarifying question from your 2010 technical paper on SS initialization with non-stationary dynamics: Is RATS automatically using the conditional likelihood (i.e. dropping the first few observations when forming the likleihood) in non-stationary models such as Laubach and Williams? If so, how does it determine how many to drop?

Thanks for any input!
asmith05
 
Posts: 15
Joined: Thu Mar 24, 2011 8:33 pm

Re: Laubach and Williams RESTAT 2003

Unread postby TomDoan » Tue Jun 13, 2017 11:41 am

asmith05 wrote:Hi Tom,
When I look at the smoothed state estimates from this code they look quite reasonable; however, the filtered output is incredibly volatile for the first few quarters of the sample before settling down.

Is this a problem unique to this model (For example, from what I understand, Laubach and Williams use a different method for initializing the states than the presample=ergodic option in RATS)?

Or, is this a common issue in non-stationary SS models? In other words, is there a reason in such models to discount the first few periods of filtered state estimates when the SS model is non-stationary (even if one uses the ergodic method in RATS to initialize the model)? Should we instead focus on the smoothed estimates in this case?


Almost any dynamic model will have really iffy estimates of the states in the first few periods of the Kalman filter. However, that's particularly acute in a model with unit roots in the states (the three models have 1, 2 and 3 unit roots, respectively) since there is no pre-sample mean for those. Theoretically, the two observables is enough to at least estimate the two unit roots in model #2, but since those two states are the potential GDP trend and its rate of growth, it doesn't seem likely that the model will be able to tease out the latter from just one value of GDP plus one value of inflation.

asmith05 wrote:Also, a clarifying question from your 2010 technical paper on SS initialization with non-stationary dynamics: Is RATS automatically using the conditional likelihood (i.e. dropping the first few observations when forming the likleihood) in non-stationary models such as Laubach and Williams? If so, how does it determine how many to drop?


You can use the condition option if you want (which is recommended if the number of unit roots might not be known a priori, if, for instance, you have a freely estimated AR component). However, by default, as soon as it has enough information to have a finite component to the predictive density (even if it's not full rank), it will use it in computing the log likelihood. For instance, in model 3, with 3 unit roots, the first observation will be skipped in the likelihood calculation, but the second will have a rank one component (3 unit roots - 2 prior observables) and the third observation will be fully included.
TomDoan
 
Posts: 7231
Joined: Wed Nov 01, 2006 5:36 pm

Laubach & Williams (2003)

Unread postby hardmann » Fri May 03, 2019 9:37 am

Dear Dr. Doan:

I had read the discussion about LW(2003) in the forum. However, I have three questions.

1, ystar is a potential growth state varible, gap=y - ystar. In measurement equation, gap should be used to stead of ystar. Maybe (y - ystar)?
2, I had confused the usage of %eqnxvector(stage2eq,t), such as:

equation stage2eq *
# logrgdp{1 2} exanterr{1 2} pceinflation{1} pi3{2} pi5{5} pioilgap{1} piimpgap{0} constant

frml regf = ||a1,a2,a3/2,a3/2,0,0,0,0,0,a4|b3,0,0,0,b1,b2,1-b1-b2,b4,b5,0||

frml muf = regf*%eqnxvector(stage2eq,t)

I had also read the explanation from State space model course 2ed (%EQNXVECTOR function p16-17), and manuals. Could you give me a illustration in detail.

3, In pure trend-cycles decomposition, both trend and cycle should be specified as states, in general, cycles is AR(2) structure. In the paper,however, cycle or gap is derived by trend, which should be modeled explicitly. Is it right or suitable?


Best regards
hardmann
hardmann
 
Posts: 159
Joined: Sat Feb 26, 2011 10:49 pm

Re: Laubach & Williams (2003)

Unread postby TomDoan » Tue May 07, 2019 6:47 am

hardmann wrote:Dear Dr. Doan:

I had read the discussion about LW(2003) in the forum. However, I have three questions.

1, ystar is a potential growth state varible, gap=y - ystar. In measurement equation, gap should be used to stead of ystar. Maybe (y - ystar)?


gap itself isn't directly observable. The measurement equation has Y as the dependent variable, and 1 x YSTAR as part of the C'X(t).

hardmann wrote: 2, I had confused the usage of %eqnxvector(stage2eq,t), such as:

equation stage2eq *
# logrgdp{1 2} exanterr{1 2} pceinflation{1} pi3{2} pi5{5} pioilgap{1} piimpgap{0} constant

frml regf = ||a1,a2,a3/2,a3/2,0,0,0,0,0,a4|b3,0,0,0,b1,b2,1-b1-b2,b4,b5,0||

frml muf = regf*%eqnxvector(stage2eq,t)


The MU is to handle any observable variables in the gap regression function. The C part handles any part of that that is due to the states. So, for instance, you have a1*gap(t-1)+a2*gap(t-2). gap is y (observable) - ystar (state). The a1*y{1} goes into the MU, the -a1*ystar{1} (which is state 2---ystar{0} is state 1) into C.

hardmann wrote:3, In pure trend-cycles decomposition, both trend and cycle should be specified as states, in general, cycles is AR(2) structure. In the paper,however, cycle or gap is derived by trend, which should be modeled explicitly. Is it right or suitable?


The whole point of this is that the gap (i.e. the "cycle") is modeled based upon its economic effects rather than just pure time series effects. Now, the L&W model has a number of problems, not least of which is that even fairly modest changes to the data produce a completely different decomposition. As is typical of models like this, the likelihood is very flat across a wide range of different decompositions, so the output depends heavily on the parameters that are fixed by the user.
TomDoan
 
Posts: 7231
Joined: Wed Nov 01, 2006 5:36 pm

Re: Laubach and Williams RESTAT 2003

Unread postby hardmann » Sun Nov 03, 2019 8:58 am

Dear Tom:

I had noticed that the code of Rats mentioned "Potential GDP is I(2), (I(1) drifting growth rate) " in second stage. I do unitroot test for logrgdp, result is I(1). It may be misspecify. In perron & Wada(2009), the paper states that in trend-cycle decompostions, the
local trend model, eg, the trend rate with random walk is generaliazed trend function, but the feature is not supported by the data. So they introduce trend as random walk with drift, then drift as intercept with a break.
I try this specification, I dont assure it.

Hardmann
hardmann
 
Posts: 159
Joined: Sat Feb 26, 2011 10:49 pm

Re: Laubach and Williams RESTAT 2003

Unread postby hardmann » Sun Jul 19, 2020 4:27 am

Dear Tom:

Could we estimate the natural rate of interest in monthly frequency?
I guess that we use monthly r, inflation, and quarterly rGDP to jointly estimate r* with Extended Kalman Filter.

Best Regard
Hardmann
hardmann
 
Posts: 159
Joined: Sat Feb 26, 2011 10:49 pm

Re: Laubach and Williams RESTAT 2003

Unread postby TomDoan » Fri Nov 27, 2020 12:03 pm

hardmann wrote:Dear Tom:

Could we estimate the natural rate of interest in monthly frequency?
I guess that we use monthly r, inflation, and quarterly rGDP to jointly estimate r* with Extended Kalman Filter.

Best Regard
Hardmann


The LW model is rather fragile as it is, so I'm not sure how well it would work to extend it to monthly. However, yes. You would first need to see if anything about the dynamics of the model needs to change to adapt it to a monthly frequency, and the quarterly real GDP numbers would require a non-linear measurement equation since the non-logged RGDP would add up across the months of a quarter, while the model is producing predictions for monthly log RGDP.
TomDoan
 
Posts: 7231
Joined: Wed Nov 01, 2006 5:36 pm

Re: Laubach and Williams RESTAT 2003

Unread postby hardmann » Tue Jan 04, 2022 11:00 am

Dear Tom:

I had learned the Winrats codes for LW2003, and found a little different specifiguations or codes from their paper. However, the final results has no effectively different.

In LW2003, in their inflation equation, they uses the 4-month avergae PI(t-5,8), I guess the winrats codes should be:

filter(type=lagging,span=4) pceinflation / pi5

In replication codes for LW2003:
filter(type=lagging,span=5) pceinflation / pi5

Should it be 4 rather than 5?

Best Regard
Hardmann
hardmann
 
Posts: 159
Joined: Sat Feb 26, 2011 10:49 pm

Re: Laubach and Williams RESTAT 2003

Unread postby hardmann » Sat Jan 15, 2022 1:16 am

Dear Tom:

could we use altertive pi3 as follows:

dec frml[series[real]] avgpi3
frml avgpi3 = (pceinflation{1}+pceinflation+pceinflation{-1})/3.0

However, it does not run. It seems that the type of avgpi3 is wrong. How to correct it?

Thanks.
Hardmann
hardmann
 
Posts: 159
Joined: Sat Feb 26, 2011 10:49 pm

Re: Laubach and Williams RESTAT 2003

Unread postby TomDoan » Mon Jan 17, 2022 3:29 pm

Why would that be a FRML[SERIES[REAL]]? That looks like a garden-variety FRML.
TomDoan
 
Posts: 7231
Joined: Wed Nov 01, 2006 5:36 pm

Previous

Return to Examples and Sample Code

Who is online

Users browsing this forum: No registered users and 2 guests