set_dynare_seed

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.

set_dynare_seed

Postby frolik » Tue Apr 11, 2017 5:03 pm

Hello everyone,

I am a bit puzzled by the function set_dynare_seed. In particular, it seems that if I have a model with more than one shock (say 2 shocks), the simulated shocks (in this case say with std=1) from dynare with set_dynare_seed('default') are different from the shocks generated by the lines:
rng('default')
randn(SimLength,M_.exo_nbr)

where the simulation lenght is the same.

When I have only one shock in the model, I don't find this difference.

Attached the sample code I'm using. Thanks a lot in advance for any comment
Attachments
RBC_steadystate.m
(1.83 KiB) Downloaded 47 times
RBC.mod
(1.77 KiB) Downloaded 59 times
Main.m
(448 Bytes) Downloaded 47 times
frolik
 
Posts: 1
Joined: Tue Apr 11, 2017 2:40 pm

Re: set_dynare_seed

Postby jpfeifer » Tue Apr 11, 2017 5:41 pm

That has most probably to do with Dynare using
Code: Select all
randn(nxs,DynareOptions.periods)'

If you just have a vector, column and row order for filling the random number matrix are the same. With a matrix, it matters whether you fill it along rows or columns.
------------
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


Return to Dynare help

Who is online

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