problems with dsgesmoother

As Dynare 4 is now the main version, this forum is now closed. Please, post
on the Dynare Help forum
Forum rules
As Dynare 4 is the current Dynare version, there forum is now close. Post new question in the Dynare Help Forum.

problems with dsgesmoother

Postby catamik » Fri Nov 14, 2008 12:10 pm

Dear Michel,

we are working with a simple RBC model, taking it to data, i.e. replicating the work in the fs2000ns.mod example. We get the following error:

Code: Select all
??? Error using ==> mtimes
Inner matrix dimensions must agree.

Error in ==> DsgeSmoother at 297
                  decomp(jnk,:,:,i) = QT*squeeze(decomp(jnk,:,:,i));

Error in ==> prior_posterior_statistics at 154
      [alphahat,etahat,epsilonhat,alphatilde,SteadyState,trend_coeff,aK] = ...

Error in ==> dynare_estimation at 949
    prior_posterior_statistics('posterior',data,gend);

Error in ==> hansen_stoch_exog_estim at 138
dynare_estimation(var_list_);

Error in ==> dynare at 102
evalin('base',fname) ;


We investigate further the problem; we substitute the command
Code: Select all
decomp(jnk,:,:,i) = QT*squeeze(decomp(jnk,:,:,i))
with
Code: Select all
decomp(jnk,:,:,i) = QT*squeeze(decomp(jnk,:,:,i))'
in the dsgesmoother file code (line 297); Then computation finishes without errors and we get reasonable output.

Otherwise, to run fs2000ns.mod we have to work with the unmodified file.

As we don't know the effects of correction, we would like to know if there's something wrong in our model. For this purpose we attach the files.

hansen_stoch_exog_estim_steadystate.m
hansen_stoch_exog_estim.mod
fsdat.m


Bests

Michele
You do not have the required permissions to view the files attached to this post.
catamik
 
Posts: 2
Joined: Fri Nov 14, 2008 11:15 am

Re: problems with dsgesmoother

Postby MichelJuillard » Sun Nov 16, 2008 2:12 pm

Dear Michele,

I have been unable to reproduce the problem because I can't run the model until the end.

1) You can't estimate a model with var_exo_det
2) Even after making a a parameter equal to 0, I can't obtain a mode good enough to start the Metropolis iterations

By the way, which version of Dynare are you using?

Kind regards,

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Re: problems with dsgesmoother

Postby catamik » Mon Nov 17, 2008 10:08 am

Thanks for the reply, Michel.

We are using Dynare 4.0.2 on a linux machine (Matlab 7.2).

2) Even after making a a parameter equal to 0, I can't obtain a mode good enough to start the Metropolis iterations.


we have modified the files (attachment), as you said. If it is right, we go through the end of computation without errors on the metropolis algorithm (even if we run the command modified as described in our first post). We have simply calibrated the parameters a = 0.
hansen_stoch_exog_estim.mod

hansen_stoch_exog_estim_steadystate.m


1) You can't estimate a model with var_exo_det


We are using a var_exo_det as an attempt to introduce an exogeneous variable in the model. We would like to take this opportunity to ask you the right way to introduce it automatically (external file). We had used the shock_file option of the "shock" command, getting an error. Can you kindly suggest us a properly approach?

Many Thanks, again,

Michele
You do not have the required permissions to view the files attached to this post.
catamik
 
Posts: 2
Joined: Fri Nov 14, 2008 11:15 am

Re: problems with dsgesmoother

Postby reluginbuhl » Fri Mar 20, 2009 3:25 pm

Hi,
I seem to be having a similar problem with the Kalman filter/smoothing algorithm (I think). Here is the error message the most recent version of Dynare 4 gives me:

??? Error using ==> mtimes
Inner matrix dimensions must agree.

Error in ==> DsgeSmoother at 322
decomp(jnk,:,:,i) = QT*squeeze(decomp(jnk,:,:,i));

Error in ==> dynare_estimation_1 at 995
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,d,decomp] = DsgeSmoother(xparam1,gend,data,data_index,missing_value);

Error in ==> dynare_estimation at 57
dynare_estimation_1(var_list,varargin{:});

Error in ==> RBC_schat at 175
dynare_estimation(var_list_);

Error in ==> dynare at 102
evalin('base',fname) ;

This error occurs after the MH algorithm has run and the posterior graphs have been displayed by Dynare, but before the smoothed data are plotted. THIS IS AN VERY SIMPLE DSGE MODEL BASED ON THE RBC model from the user manual!! I have only changed the path for the technological progress to be non-stationary.
You do not have the required permissions to view the files attached to this post.
Last edited by reluginbuhl on Fri Mar 20, 2009 3:38 pm, edited 1 time in total.
reluginbuhl
 
Posts: 53
Joined: Wed Mar 04, 2009 2:41 pm

Re: problems with dsgesmoother

Postby reluginbuhl » Fri Mar 20, 2009 3:35 pm

Should anyone want to see the code for the simulation of the data, it is in the attached file RBC_simul_analyticSS.m. After running this mod file, the following commands must also be run in Matlab:

A=y;
A(1)=dA(1);
for i=2:1003;
A(i)=dA(i)*A(i-1);
end;
for i=1:1003;
Y_obs(i)=y(i)*A(i);
end;
oo_.endo_simul(10,:)=Y_obs;
datatomfile('simRBCgrow',[]);

I then throw away all other variables in simRBCgrow.m expect Y_obs to make the file smaller.

ps I was unable to attach more than 3 files. So I have added this extra message to upload these files as well.
You do not have the required permissions to view the files attached to this post.
reluginbuhl
 
Posts: 53
Joined: Wed Mar 04, 2009 2:41 pm


Return to Dynare version 4

Who is online

Users browsing this forum: No registered users and 1 guest