Page 1 of 1

First order approximation of DSGE and Forecasting

PostPosted: Mon Nov 28, 2011 7:34 pm
by mp0112358
Hi I have a question about the first order approx of the DSGE as outlined in the manual and on forecasting:

y(t) = ys + A*(y(t-1) - ys) + B*u(t) (*)

So, in my code i have:

- ys a 14x1 vector (there are 5 original endog variables + 9 aux vbles created by Dynare, between lags, leads and expressions involving leads). To make it consistent with A and B i have to order ys by DR order.
- A is a 14 x 8 matrix (rows in DR order, columns are state vbles in DR order)
- [y(t-1) - ys] is a 14x1 column vector in DR order
- B is 14x5 matrix (rows in DR order, columns in declaration order of the exogenous variables)

The questions/issues are:
1) Isn't eqn (*) nonconformable? Because A is a 14x8 and [y(t-1) - ys] is 14x1. Should i augment the A matrix with zeros as in A = [A zeros(14,6)], using Matlab notation?
2) If i use the 1st order approximation in eqn (*) with the parameters in A and B evaluated at posterior means, should I get the same forecasts as those in oo_.MeanForecast.Mean? I don't get exactly the same numbers which makes me think that maybe I'm doing something wrong on 1st order approximation.
3) How do i get the historical data for the 14 variables (that is the original endogenous variables and the 9 aux variables). Right now, I'm using oo_.SmoothedVariables and add their steady states. This could be another source of discrepancies.

Many thanks in advance!

Mariano

Re: First order approximation of DSGE and Forecasting

PostPosted: Wed Dec 21, 2011 4:15 pm
by SébastienVillemot
mp0112358 wrote:Hi I have a question about the first order approx of the DSGE as outlined in the manual and on forecasting:

y(t) = ys + A*(y(t-1) - ys) + B*u(t) (*)

So, in my code i have:

- ys a 14x1 vector (there are 5 original endog variables + 9 aux vbles created by Dynare, between lags, leads and expressions involving leads). To make it consistent with A and B i have to order ys by DR order.
- A is a 14 x 8 matrix (rows in DR order, columns are state vbles in DR order)
- [y(t-1) - ys] is a 14x1 column vector in DR order
- B is 14x5 matrix (rows in DR order, columns in declaration order of the exogenous variables)

The questions/issues are:
1) Isn't eqn (*) nonconformable? Because A is a 14x8 and [y(t-1) - ys] is 14x1. Should i augment the A matrix with zeros as in A = [A zeros(14,6)], using Matlab notation?


No. You need to extract purely backwards and mixed variables out of the ys vector, and put them in the right order. See the reference manual, section about "stoch_simul".

2) If i use the 1st order approximation in eqn (*) with the parameters in A and B evaluated at posterior means, should I get the same forecasts as those in oo_.MeanForecast.Mean? I don't get exactly the same numbers which makes me think that maybe I'm doing something wrong on 1st order approximation.


I think that oo_.MeanForecast is mean of forecasts drawn from posterior (which is not the same than forecast at mean of the posterior). The discrepancy can also come from the problem mentionned in previous point.

3) How do i get the historical data for the 14 variables (that is the original endogenous variables and the 9 aux variables). Right now, I'm using oo_.SmoothedVariables and add their steady states. This could be another source of discrepancies.


I think you're doing right here.

Best,