Static Simulation

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Static Simulation

Postby adamshap » Tue Aug 01, 2006 8:28 pm

Is there a way to run a static simulation in Dynare? That is, run a simulation while providing the model with specific data for specific variables?

Thank you,

Adam Shapiro
adamshap
 

Postby MichelJuillard » Wed Aug 02, 2006 6:57 am

Dear Adam,

can you give more details about what you want to do and maybe the algebra going with it. Thanks

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

Postby adamshap » Wed Aug 02, 2006 2:15 pm

Specifically, I would like to simulate a model using the exogenous shocks obtained from bayesian estimation.

From your manual it looks like this can be achieved by saving the shocks from the "results.mat" file from the estimation and then use the option "shocks_file =results.mat" in the simul(....) command.

I believe that there are two ways of simulating the model at this point:

(1) Dynamic simulation: The model is "fully" simulated in that all state variables are taken from the result of the model's simulation last period. (I believe this is what Dynare does by default)

(2) Static simulation: Certain state variables each period are taken from data. The state variables for which there is no data available are then simulated.

I am wondering if Dynare is able to perform the Static Simulation.

In my case I am working with the following model:

model;
pistar(0)= (Wt(0)*(alph*0.5*(pi_up+pi_low)+(1-alph)*pdot(0))+ (1 - Wt(0))*pdot(0));
Wt(0) = (.32125*atan(40*(pdot(0)-pi_up))-.32125*atan(40*(pdot(0)-pi_low))+1);
pdot(0) = (prho*pdot(-1)+b1*pdot(+1)+ csi*ygap(0) + pdot_(0));
rff(0) = (rlag*rff(-1) + (1-rlag)*(rhobar + pdot(0)+ api*(pdot(0) - pistar(0))+ ay*ygap(0)) + rff_(0));
ygap(0) =(yl1*ygap(-1)- yl2*ygap(-2)+ yf*ygap(+1)- yrho*(rho(-1) - rhobar) + ygap_(0));
rff(0) = pdot(+1) + (rho(0) - (1.0/dur)*(rho(+1) - rho(0)));
end;

I do have data for the following endogenous variables: pdot, ygap, and rff
I do not have data for the endogenous variables: Wt, pistar, and rho
The exogenous shocks are rff_, pdot_, and ygap_

Thanks again,

Adam Shapiro
adamshap
 

Postby admin » Wed Aug 02, 2006 8:07 pm

Dear Adam,

I will post an example on how to do it, but it will take me a little while. I have already a long list of promised examples ...

Kind regards

Michel
admin
 

Postby adamshap » Thu Aug 03, 2006 2:16 pm

Ok.

Thank you Michel
adamshap
 

Postby MichelJuillard » Thu Aug 10, 2006 1:35 pm

Here is an example. The model is in example5.mod and the shock values in example5_shocks.txt

Tell me if it helps

Best

Michel
Attachments
example5_shocks.txt
(3.32 KiB) Downloaded 364 times
example5.mod
(1.53 KiB) Downloaded 648 times
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Postby adamshap » Fri Aug 11, 2006 7:42 pm

Thank you for the example Michel. However, I think this example is not doing exactly what I am trying to do.

What I am trying to do is simulate a couple variables for which there exist no data. In other words, use the model to back-out "hidden" variables that exist in the model, but not in any data source.

To do this, I am taking the following approach -- which does not seem to be working for some reason.

1) Estimate the model to obtain the parameters and exogenous shocks. The exogenous shocks are saved in the oo_ file.

2) I then simulate model, in a deterministic context, with the shocks saved from the estimation in the oo_ file. I save them in a file called datafile.mat. I have been doing this with the shocks(shocks_file = datafile.mat) command. For example:

shocks(shocks_file = datafile);
var pdot_;
periods 1;
values 0;
var rff_;
periods 1;
values 0;
var ygap_;
periods 1;
values 0;
end;

For those variables for which I have data, the simulation should give me back a time series that looks like the data that I put into the estimation process. It is not doing so. Instead, much of the simulated time-sereis I am getting back (i.e. what I get when I use the rplot command at the end of the simulation) looks quite different from the data. Other times it resembles the data, but is not quite there.

Perhaps you could help explain why the approach I have taken is not working correctly in Dynare.

In order to better simulate the hidden variables, I was wondering if I could put the data directly into the simulation, just like I put the shocks into the simulation -- this would be the static simulation. This would not involve solving the model for policy functions as is shown in your example, but rather use the model to map out the variables for which there is no data. Is there a command to simulate the model with some of the endogenous variables updated each period with the actual data?
adamshap
 


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 5 guests