Reading and Interpreting Binary Output From 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.

Reading and Interpreting Binary Output From Simulation

Postby yinx » Thu Jul 30, 2015 3:24 pm

Hi All,
I am trying to compute moments for a model using averages of simulated series. So, I have used the "simul_replic=1000" option to generate artificial 1000 economies, which has been saved into "FILENAME_simul" and have also used the "periods=164" option so as to have 64 periods that matches my data periods after dynare may have dropped the first 100 points.
I have tried to read the simulated series using the fread function in MATLAB that I read about elsewhere in this forum, but the data is read in nX1 size. The problem is that the number of rows is much greater than the number of variables multiplied by the number of periods and simulations asked for. Hence, I don't know how to apportion nX1 vector of simulated series to the relevant variables and compute my moments.
Can someone please help with this?
Thanks.
Yinka
yinx
 
Posts: 10
Joined: Sat Oct 26, 2013 1:18 am

Re: Reading and Interpreting Binary Output From Simulation

Postby jpfeifer » Thu Jul 30, 2015 3:47 pm

Please use the get_simul_replications-file from my homepage.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Reading and Interpreting Binary Output From Simulation

Postby yinx » Thu Jul 30, 2015 5:39 pm

Thank you very much.
yinx
 
Posts: 10
Joined: Sat Oct 26, 2013 1:18 am

Re: Reading and Interpreting Binary Output From Simulation

Postby yinx » Thu Jul 30, 2015 5:49 pm

Hi,
Do you have an example of where you have used this function please? Thanks.
Yinka
yinx
 
Posts: 10
Joined: Sat Oct 26, 2013 1:18 am

Re: Reading and Interpreting Binary Output From Simulation

Postby jpfeifer » Fri Jul 31, 2015 11:38 am

An example would be
Code: Select all
var y, c, k, a, h, b;
varexo e, u;

parameters beta, rho, alpha, delta, theta, psi, tau;

alpha = 0.36;
rho   = 0.95;
tau   = 0.025;
beta  = 0.99;
delta = 0.025;
psi   = 0;
theta = 2.95;

phi   = 0.1;

model;
c*theta*h^(1+psi)=(1-alpha)*y;
k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
    *(exp(b(+1))*alpha*y(+1)+(1-delta)*k));
y = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
k = exp(b)*(y-c)+(1-delta)*k(-1);
a = rho*a(-1)+tau*b(-1) + e;
b = tau*a(-1)+rho*b(-1) + u;
end;

initval;
y = 1.08068253095672;
c = 0.80359242014163;
h = 0.29175631001732;
k = 11.08360443260358;
a = 0;
b = 0;
e = 0;
u = 0;                                         
end;

shocks;
var e; stderr 0.009;
var u; stderr 0.009;
var e, u = phi*0.009*0.009;
end;

stoch_simul(order=1,periods=5200,simul_replic=100);
[sim_array]=get_simul_replications(M_,options_);

y_sim=squeeze(sim_array(strmatch('y',M_.endo_names,'exact'),:,:));
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Reading and Interpreting Binary Output From Simulation

Postby yinx » Sat Aug 01, 2015 3:41 pm

Thank you very much.
Yinka
yinx
 
Posts: 10
Joined: Sat Oct 26, 2013 1:18 am


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 7 guests