Time-Varying parameters in SSM
-
fioramanti
- Posts: 27
- Joined: Thu Feb 18, 2016 4:44 am
Time-Varying parameters in SSM
Dear Users,
I have the attached code estimating a SSM with time-invariant parameters using DLM.
I would trasform it in a time-varying parameters for the Phillips Curve as in Blanchard Cerruti and Summers (2015 - Pg19, Eq 1) https://www.imf.org/external/pubs/ft/wp ... p15230.pdf, but mantaining my specification.
Althought RATS's UG and RM mention the possibility to have time-varying parameters I can't find an explanation on how to do that.
I think I should change the way the matrix "cf" is specified, but I can't understand how.
Is there anyone that can help me?
Thanks,
Marco
I have the attached code estimating a SSM with time-invariant parameters using DLM.
I would trasform it in a time-varying parameters for the Phillips Curve as in Blanchard Cerruti and Summers (2015 - Pg19, Eq 1) https://www.imf.org/external/pubs/ft/wp ... p15230.pdf, but mantaining my specification.
Althought RATS's UG and RM mention the possibility to have time-varying parameters I can't find an explanation on how to do that.
I think I should change the way the matrix "cf" is specified, but I can't understand how.
Is there anyone that can help me?
Thanks,
Marco
- Attachments
-
- wf2016_Unc.RPF
- (1.77 KiB) Downloaded 956 times
Re: Time-Varying parameters in SSM
Someone already asked about that paper:
https://estima.com/forum/viewtopic.php?f=26&t=2606
The technical details for the extended (or non-linear) Kalman filter are in the Matheson and Stavrev article.
https://estima.com/forum/viewtopic.php?f=26&t=2606
The technical details for the extended (or non-linear) Kalman filter are in the Matheson and Stavrev article.
-
fioramanti
- Posts: 27
- Joined: Thu Feb 18, 2016 4:44 am
Re: Time-Varying parameters in SSM
Dear Tom,
Thank you for your replay but, to be honest, that doesn’t help much on how to code the extended kalman filter in RATS. Matheson and Stavrev (2013) show the “logic” of the procedure, not the code. Could you please give me some additional hints?
Marco
Thank you for your replay but, to be honest, that doesn’t help much on how to code the extended kalman filter in RATS. Matheson and Stavrev (2013) show the “logic” of the procedure, not the code. Could you please give me some additional hints?
Marco
Re: Time-Varying parameters in SSM
On a more careful reading, it looks like Matheson and Stavrev (and I assume by extension the Blanchard, et al paper) isn't technically correct. Matheson and Stavrev reference a paper on equality constrained Kalman Filtering and apply that when the states go out of bounds. That isn't how inequality constrained optimization works.
If you ignore the inequality-constrained part (which is where the technical error is), then the only non-linearity is the multiplicative interaction between the time-varying Phillips curve slope and the unemployment gap. You just have to iterate on the DLM instruction, linearizing that around the estimates from the previous pass. That affects both the C and the MU.
If you have a multiplicative term a(t)b(t) in the measurement equation, then that can be approximated by b0(t)a(t)+a0(t)b(t)-a0(t)b0(t) where a0(t) and b0(t) are the expansion points (typically the estimates from a previous Kalman filter pass). The coefficients in C are b0(t) on a(t) and a0(t) on b(t). The -a0(t)b0(t) becomes (part of) the MU. The rest of the equation is a standard time-varying coefficients regression: the C elements are the observed data.
If you ignore the inequality-constrained part (which is where the technical error is), then the only non-linearity is the multiplicative interaction between the time-varying Phillips curve slope and the unemployment gap. You just have to iterate on the DLM instruction, linearizing that around the estimates from the previous pass. That affects both the C and the MU.
If you have a multiplicative term a(t)b(t) in the measurement equation, then that can be approximated by b0(t)a(t)+a0(t)b(t)-a0(t)b0(t) where a0(t) and b0(t) are the expansion points (typically the estimates from a previous Kalman filter pass). The coefficients in C are b0(t) on a(t) and a0(t) on b(t). The -a0(t)b0(t) becomes (part of) the MU. The rest of the equation is a standard time-varying coefficients regression: the C elements are the observed data.
Re: Time-Varying parameters in SSM
I'm thinking that you would find this to be beyond difficult to get to work. As you can see from the massive number of restrictions, the underlying EC-NAIRU model needs a lot of help to get reasonable results with fixed coefficients. And if you look at Matheson and Stavrev, they use a bucketful of restrictions to get reasonable results out of the time-variation (left unconstrained, TVC models tend to produce junk results).
-
fioramanti
- Posts: 27
- Joined: Thu Feb 18, 2016 4:44 am
Re: Time-Varying parameters in SSM
Dear Tom,
Indeed it seems really difficult and yes EC-NAIRU has too many restrictions. It seems that they put as many restrictions as possible to get the results they already have in mind (as I try to show in https://goo.gl/J92oMt). This is really the point: this is the key rule governing fiscal compliance wrt the Stabilty and Growth Pact. With fixed coefficients, but relaxing some restrictions, I get very different results.
It is not a simple matter of out-of-the-real-world numbers: for example in the case of Italy a 1 pp of NAWRU means circa 6 BLN euro of Structural balance, that is room (or lack of room) for fiscal policy.
I'm stalled with the coding.
Thanks,
M
Indeed it seems really difficult and yes EC-NAIRU has too many restrictions. It seems that they put as many restrictions as possible to get the results they already have in mind (as I try to show in https://goo.gl/J92oMt). This is really the point: this is the key rule governing fiscal compliance wrt the Stabilty and Growth Pact. With fixed coefficients, but relaxing some restrictions, I get very different results.
It is not a simple matter of out-of-the-real-world numbers: for example in the case of Italy a 1 pp of NAWRU means circa 6 BLN euro of Structural balance, that is room (or lack of room) for fiscal policy.
I'm stalled with the coding.
Thanks,
M
Re: Time-Varying parameters in SSM
The problem I've seen with the GAP program examples is that the variance of the trend rate (the "mu") is forced way too high which allows (causes??) the NAWRU to rather closely track the actual unemployment rate. If the unemployment gap is (practically by construction) small, then the Phillips curve slope estimates are (1) irrelevant and (2) poorly estimated anyway. Changing those to time-varying will have little effect---it's the restrictions on the variances in the unemployment UCM that are driving everything.
-
fioramanti
- Posts: 27
- Joined: Thu Feb 18, 2016 4:44 am
Re: Time-Varying parameters in SSM
Dear Tom,
You get the main point! Actual estimates of NAWRU are not driven by the data, but by the variances bounds with the aim to get new estimate as close as possible to previous estimates (but EC officials deny). In recent years this is producing a very cyclical NAWRU. This is what I try to show in my wp. Now the next step would be to show them (but i'm sure they know, so to show the public) that a better model exists (in terms of fit) and with this model the nawru is less cyclical, then potential is higher, output gap is wider and, in the end, there is room for fiscal policy. The BCS model could be a good candidate for this goal, of course without imposing all the constraints EC imposes in its model. The script i've attached was to fine tune RATS with GAP just to see if I were able to replicate their results using a different software (GAP is a black box). Now that i'm sure that different results are not the consequences of the way the KF is initialized (as is the case for stata or eviews), I can deviate from their specification being sure that different results would be given by the model and not by some hidden string of code.
Marco
You get the main point! Actual estimates of NAWRU are not driven by the data, but by the variances bounds with the aim to get new estimate as close as possible to previous estimates (but EC officials deny). In recent years this is producing a very cyclical NAWRU. This is what I try to show in my wp. Now the next step would be to show them (but i'm sure they know, so to show the public) that a better model exists (in terms of fit) and with this model the nawru is less cyclical, then potential is higher, output gap is wider and, in the end, there is room for fiscal policy. The BCS model could be a good candidate for this goal, of course without imposing all the constraints EC imposes in its model. The script i've attached was to fine tune RATS with GAP just to see if I were able to replicate their results using a different software (GAP is a black box). Now that i'm sure that different results are not the consequences of the way the KF is initialized (as is the case for stata or eviews), I can deviate from their specification being sure that different results would be given by the model and not by some hidden string of code.
Marco
Re: Time-Varying parameters in SSM
There was an error in the GAP 4.4 program for certain settings. I'll have to look up what the specifics were. There is a very minor difference in the (maximum likelihood) diffuse calculations due to our using Durbin-Koopman and their using DeJong.
* Kalman filtering with ML. These use presample=ergodic with
* condition=2 which should give the same results as the deJong method.
* (Without CONDITION=2, the results will differ slightly because
* Koopman's method can make use of the rank one information in the 2nd
* entry prediction, while deJong's doesn't).
* Kalman filtering with ML. These use presample=ergodic with
* condition=2 which should give the same results as the deJong method.
* (Without CONDITION=2, the results will differ slightly because
* Koopman's method can make use of the rank one information in the 2nd
* entry prediction, while deJong's doesn't).
-
fioramanti
- Posts: 27
- Joined: Thu Feb 18, 2016 4:44 am
Re: Time-Varying parameters in SSM
Tom,
Are you telling me that you managed to make gap and it's excel interface and data work, take the same data and replicating their results with rats using (as a staring point I suppose) the file I posted in the latest few days?
That would be awesome!
...and how did you spot the " error in the GAP 4.4 program for certain settings"?
Are you telling me that you managed to make gap and it's excel interface and data work, take the same data and replicating their results with rats using (as a staring point I suppose) the file I posted in the latest few days?
That would be awesome!
...and how did you spot the " error in the GAP 4.4 program for certain settings"?
Re: Time-Varying parameters in SSM
Trying to reproduce the results in RATS.