Filardo JBES 1994 Time-Varying MS Model
Filardo JBES 1994 Time-Varying MS Model
filardojbes1994.zip is a program and data file for (somewhat) replicating the time-varying Hamilton-type switching model from Filardo(1994), "Business Cycle Phases and Their Transitional Dynamics", JBES, vol 12, no 3, 299-308. This uses a reproduction of the data set provided by Kim and Nelson---the data from the JBES web site seems not to provide the published results.
Detailed description
Detailed description
Re: Filardo JBES 1994 Time-Varying MS Model
Dear Tom,
I have one last question. Filardo estimate is based on one independent variable on the time-varying probabilities. However, I have two independent variables. Do you have any suggestions how to adjust the code for the addressing the impact of two variables?
Many thanks
Faek
I have one last question. Filardo estimate is based on one independent variable on the time-varying probabilities. However, I have two independent variables. Do you have any suggestions how to adjust the code for the addressing the impact of two variables?
Many thanks
Faek
Re: Filardo JBES 1994 Time-Varying MS Model
The example already has that. This does two lags rather than one on the indicator variable so it has two explanatory variables:
equation p1eq *
# constant xli{1 2}
equation p2eq *
# constant xli{1 2}
There's no reason the indicators need to be lags of one variable---they can be two unrelated variables.
equation p1eq *
# constant xli{1 2}
equation p2eq *
# constant xli{1 2}
There's no reason the indicators need to be lags of one variable---they can be two unrelated variables.
Re: Filardo JBES 1994 Time-Varying MS Model
Dear Tom,
Sorry to bother you again. Applying Filardo code on my own data, the code works perfectly for some cases (countries) and I got proper estimation for TVP,however, in some other cases, I always get this message when estimating TVP:
[## MAT13. Store into Out-of-Range Matrix or Series Element
The Error Occurred At Location 539, Line 31 of MSVARTVPEMESTIMA]
I have adjusted the initial values which is I thought because of that, but I get the same message. I am not sure why? I do appreciate any hints from you.
Many thanks
Faek
Sorry to bother you again. Applying Filardo code on my own data, the code works perfectly for some cases (countries) and I got proper estimation for TVP,however, in some other cases, I always get this message when estimating TVP:
[## MAT13. Store into Out-of-Range Matrix or Series Element
The Error Occurred At Location 539, Line 31 of MSVARTVPEMESTIMA]
I have adjusted the initial values which is I thought because of that, but I get the same message. I am not sure why? I do appreciate any hints from you.
Many thanks
Faek
Re: Filardo JBES 1994 Time-Varying MS Model
You would have to post the code and data for a case that fails.
Re: Filardo JBES 1994 Time-Varying MS Model
Dear Tom,
Thank you very much. I really appreciate your effort with me. I have attached the data and the code now.
Many thanks
Faek
Thank you very much. I really appreciate your effort with me. I have attached the data and the code now.
Many thanks
Faek
Re: Filardo JBES 1994 Time-Varying MS Model
You have an autoregression with 0 lags. This wasn't written for that.
Re: Filardo JBES 1994 Time-Varying MS Model
Dear Tom,
Yes, I set it to zero. however, I have tried setting the lags to 4 or any other number of lags apart from zero, it give me the same message and problem.
Many thanks
Faek
Yes, I set it to zero. however, I have tried setting the lags to 4 or any other number of lags apart from zero, it give me the same message and problem.
Many thanks
Faek
Re: Filardo JBES 1994 Time-Varying MS Model
The model with multiple lags doesn't work very well (one of the states becomes absorbing) but it certainly estimates. You probably can't successfully estimate the model with both mean and variance switching.
Re: Filardo JBES 1994 Time-Varying MS Model
Dear Tom,
I really appreciate your kindness and patience. Actually, I have tried a range of possibilities. I have tried to estimate it for just switching in the mean (without variance) and with only one variable affecting the TVP, I always get the same problem.
Many thanks
Faek
I really appreciate your kindness and patience. Actually, I have tried a range of possibilities. I have tried to estimate it for just switching in the mean (without variance) and with only one variable affecting the TVP, I always get the same problem.
Many thanks
Faek
Re: Filardo JBES 1994 Time-Varying MS Model
The message that you reported should only come up when you estimate with zero lags. If it works with some series and not with others, then it sounds like it's not the program, but the data. The potential problem with estimating a model with switching means and variances by EM is described on page UG-365 of the RATS version 8 User's Guide, and in greater detail in the Structural Breaks and Switching Models course materials. EM doesn't always get stuck on one of the infinite spikes, but it can.
Re: Filardo JBES 1994 Time-Varying MS Model
Dear Tom,
I hope that you are well. The code plots NBER recessions vs the probability of slow growth state. I would like to plot the graphs of the estimated time varying probabilities only, however, I could not sort it out. Any hints are very much appreciated.
Many thanks
Faek
I hope that you are well. The code plots NBER recessions vs the probability of slow growth state. I would like to plot the graphs of the estimated time varying probabilities only, however, I could not sort it out. Any hints are very much appreciated.
Many thanks
Faek
Re: Filardo JBES 1994 Time-Varying MS Model
Take the SHADE option out(?) I'm not sure what you mean other than that.FaeK wrote:Dear Tom,
I hope that you are well. The code plots NBER recessions vs the probability of slow growth state. I would like to plot the graphs of the estimated time varying probabilities only, however, I could not sort it out. Any hints are very much appreciated.
Many thanks
Faek
Re: Filardo JBES 1994 Time-Varying MS Model
Dear Tom,
Thank you. I want to save and plot p1eq and p2eq which are the time varying probabilities. Could you provide any hints for this?
Thank you so much
Faek
Thank you. I want to save and plot p1eq and p2eq which are the time varying probabilities. Could you provide any hints for this?
Thank you so much
Faek
Re: Filardo JBES 1994 Time-Varying MS Model
p1eq and p2eq compute the logistic indexes, not the probabilities. The graph is already showing the time-varying probability---pdown is the probability of the recession, 1-pdown would be the probability of a non-recession.
Last bumped by TomDoan on Sat Mar 01, 2025 4:26 am.