jmaih / RISE_toolbox

Solution and estimation of Markov Switching Rational Expectations / DSGE Models
BSD 3-Clause "New" or "Revised" License
103 stars 77 forks source link

How to do forecasting? #17

Closed gerreth closed 8 years ago

gerreth commented 8 years ago

Dear Junior,

I have a question considering forecasting with an estimated dsge model. Simply doing 'forecast(model)' does not seem to work. What’s the right way to do this?

I guess I have to work on the usual forecasting problem first, but maybe already a follow up question, is it possible to use information on a mixed frequency when doing the forecast? For example, use information of an indicator (which determines the transition probabilities) which is available on a monthly basis to do the forecasting in an otherwise quarterly model?

Thank you in advance Gerret

jmaih commented 8 years ago

Dear Gerreth,

sorry for the slight delay. Forecasting is one of the most delicate features of RISE as many choices have to be made depending on the precise settings of your problem. Many questions have to be answered and they will influence the type of options you have to pass to RISE for it to behave the way you expect:

  1. Do you have a constant-parameter model or a regime-switching model?
  2. Is your model solved at first-order of approximation or at higher order?
  3. Do you want to do a forecast with or without shock uncertainty?
  4. Do you want to do an unconditional forecast or a conditional forecast? If you start talking about conditional forecasts, then another set of choices opens up... you can condition on shocks, on endogenous variables, on regimes, you can choose whether the events are anticipated or not, etc.

In any case, there are two functions for doing forecast in RISE. One is precisely the one you tried "forecast" and another one is "simulate". In fact, whatever you do from forecast goes through simulate. You will need, among other things,

help dsge/forecast

to see what your options are and let us know about the progress you make.

Cheers,

Junior

gerreth commented 8 years ago

Hello,

no problem for the slight delay, I really appreciate it that you take the time to answer the questions here, besides providing this toolbox itself.

Regarding your questions to my problem:

  1. I would like to compare a version with constant parameters to a version with regime-switching parameters. The transition probabilities are governed by an exogenous indicator variable.
  2. I use a linearized version of the FRBNY DSGE model (Smets and Wouters + BGG type financial frictions), so I only consider a first-order approximation.
  3. With shock uncertainty
  4. Maybe I will start with an unconditional forecast. In general I would like to exploit the fact, that the indicator variable (determining the transition probabilities) can be observed on a higher frequency (monthly) compared to the other observables.

I think I have problems with providing the database correctly. When I inspect the initial conditions of my variables (inside the @rise_generic/simulate file), the observables are set to their correct values (coming from the dataset used for the estimation). All other endogenous variables are 0. Is there a convenient way to set the initial conditions correctly? Changing the forecast horizon, start point and switching the shock uncertainty on/off works as intended as it seems.

Best Regards Gerret

jmaih commented 8 years ago

The first thing to do then is to look at the historical database problem.

  1. RISE needs historical data for all state variables in the model. One way to find out which variables RISE needs is to run
get(m,'endo_list(state)')

Unfortunately perhaps, many of those variables will be unobserved and if that the database you provide does not include data for those variables, RISE will use the steady state values. Actually is the other way around, i.e. RISE initializes all the variables in the state vector at their steady state values. It then uses the information provided in the database to overwrite these values.

2) One way to get initial conditions for the observable variables is to run the filter on the observables. In that way you get some initial conditions you can use.

Best, Junior

gerreth commented 8 years ago

Dear Junior,

I managed to set the initial conditions in the case of a constant parameter model. However, in the case of a model with parameter switching I do get filtered variables for each regime. Which values do I set here as initial conditions?

Best Gerret

jmaih commented 8 years ago

Hi Gerreth,

This is the type of choices I was hinting you would have to make. For the observed variables, the smoothed variables are the same. But for the other variables the values will most likely be different from one regime to another. You have two choices, depending on what you believe in:

  1. If you know what regime prevails at the beginning of the forecasting period, you would like to set the initial conditions to reflect that particular regime. For instance, if you have a zero-lower bound regime and believe the economy is in the zero-lower bound then it is probably a good idea to set the initial conditions to be those of the zlb.
  2. If instead you are unsure what regime the economy is in, you could consider using the "expected values", which you can also find in the same structure where the all the filters, updates and smoothed variables are stored.

Let us know if this helps,

Cheers,

Junior

gerreth commented 8 years ago

This perfectly makes sense to me. I have somehow overlooked the expected values completely, but thought of doing the same thing. I will have to work on this, so many thanks for solving my problems up to now!