Page 1 of 1

Dynare++ Simulated Data

PostPosted: Tue Sep 25, 2007 9:43 pm
by kuros
Dear,

After simulating the model in Dynare++1.3.5, the matlab .mat file is generated. However, I could not find the "simulated data" in the .mat file. I could get only steady state, simulated mean, simulated var-cov matrix...... Is it possible for me to see the generated data for each variables?

Thank you,

John

PostPosted: Thu Sep 27, 2007 12:17 pm
by OndraKamenik
Dear John,

no, it is not possible. The simulated data are not dumped to the mat file. You can use dynare_simul Matlab M-file to generate your own simulations.

Ondra K.

PostPosted: Sun Sep 30, 2007 9:31 am
by kuros
Dear Dr. Ondra K.

Thank you for your answer.

I have another question on the simulated data. Then, the mean values of simulated data using dynsre_simul.m are supposed to converge the values of dyn_mean? (if the number of simulation is large enough). Am I right?

Thank you very much, again.

Sincerely,
John

PostPosted: Sun Sep 30, 2007 5:43 pm
by OndraKamenik
John,

you are right, provided that the realizations of the shocks you feed to dynare_simul were generated with the same variance-covariance matrix as in the model file.

Ondra

The simulated means are not consistent with the dyn_mean

PostPosted: Mon Oct 01, 2007 11:01 pm
by kuros
Dear Dr. Ondra K.,

Hello. As you advised, I tried to simulated my model using dynsre_simul.m. But I found that the mean value of the simulated data are not consistent with the mean values in dyn_mean. I simulated 20000 data, so I guess it is large enough. I suspect if it is a kind of possible bug, since the procedure I followed was very standard. Or it can be just my stupid mistake......

I'm attaching my model file ( bSbL_a.mod), and the model simulation m file ( Simulation.m). Could you see if I'm making some mistake or there is a bug?

For this model, the variable I'm interested is RS1 and RL1, which are 7th and 8th endo variables.
Dyn_mean says that mean(RS1) = 0.034621 and mean(RL1)= 0.05131, but the simulated data says that both are around 0.055 or so.

Tnank you very much for your helps.

Sincerely,
John

One more thing!

PostPosted: Tue Oct 02, 2007 2:13 am
by kuros
Dear Dr. Ondra K.,

In the previous files I attached above, I used 3rd-order apporximation.
But when I used 2nd order approximation, the results from Dynare++1.3.5 were significantly (even signs in the vcov matrix) different from those from Dynare v3, as I reported before.

When 2nd order approx, the fact I'm interested in is the cov(y, RL1), cov(y, RS1), and cov(y, sp). In dynare v3, signs were cov(y, RL1) >0, cov(y, RS1) >0, and cov(y, sp) <0. However, in Dynare++1.3.5 the signs were reversed. As you mentioned before, it might be another bugs......

Could you check that also?

Thank you very much.

Sincerely,
John

I also found that......

PostPosted: Mon Oct 08, 2007 9:28 am
by kuros
Dear Dr. Ondra K.,

I also found that the var-cov matrix from the simulated data using dynsre_simul.m is significantly different from that of dyn_vcov in dynare++. Please let me know if it is a bug, or I did something wrong. I already attached my .mod file.

Thank you for your helps.

Sincerely,
John

PostPosted: Tue Oct 09, 2007 6:07 am
by OndraKamenik
Dear John,

Recently, one user notified me that there is an error in drawing random numbers for different threads in Windows version of dynare++. The error is that Windows implementation somehow makes different instaces of a random drawer for different threads and all these instances are initialized to the same state, so they generate the same draws. I have already started rewriting and redesigning the code so that each thread gets its own instance of random number generator and it will be deterministicaly initialized to the different states. dynare_simul.m does not have this problem, sionce it is only single threaded.

This means, if you work on windows, you should try to simulate one long simulation, i.e. --sim 1 --per 20000 for instance.

However, there might be many other reasons for the behaviour you are describing. Please, check whether some simulations were not thrown out (in journal file).

Unfortunatelly, I do not have any time to look at your codes now, we are just in the craziest part of quarterly forecast. But I will be back.

rgds,

Ondra K.