Page 1 of 1

Normal AND Non-Normal Random Variables

PostPosted: Thu Apr 04, 2013 10:12 am
by antonia
Dear Support Team

I was wondering whether it is possible to use random variables following non-normal distributions ALONGSIDE with standard normal distributions in Dynare 4.
I would need to use both normally distributed shocks and a variable following a binary distribution (value 1 with probability p, and value 0 with probability (1-p)).

I have already found a previous question on uniform distributions between 0 and 1:
http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=1855
where you said it was possible to change the Matlab code for shock variables. This, however, would change the distribution of ALL shocks I guess, so no co-existence of two differently distributed shocks?

Thank you and best wishes
antonia

PS: Another quick question: Is there an option for boolean operators (if) in Dynare?

Re: Normal AND Non-Normal Random Variables

PostPosted: Fri Apr 05, 2013 6:29 pm
by jpfeifer
You have to be more explicit about the application you have in mind. If the model is solved with perturbation (i.e. Taylor approximation), only the first n moments of the shock distribution are relevant for order=n. Thus, whether you use normal or binomial shocks does not matter for the solution itself. If you want to simulate the model given particular shocks, the previous post shows the way to go. You input into Dynare a matrix with shock values. Just make sure you drew them from the correct distributions (and using the correct covariance). If the shocks are independent this is easy as you can proceed shock by shock. The first shock (corresponding to the first column) could for example be drawn from a normal distribution, while the second column is drawn from a binomial one etc.

Re: Normal AND Non-Normal Random Variables

PostPosted: Sat Oct 10, 2015 3:27 am
by camara_cmb
Hello

I am sorry I bring again the topic. Following this topic: viewtopic.php?f=1&t=1855
I understood that if I want to introduce non-normal shocks to the simulation of my model I should modify the matrix in

oo_.exo_simul(:,i_exo_var) = randn(M_.maximum_lag+M_.maximum_lead+options_.periods,nxs)*chol_S;

My first question is that I cannot find the simult.m file. In the topic it says it is in the matlab directory, can anyone be more specific.
My second question is which order should I follow when constructing the oo_.exo_simul(:,i_exo_var) matrix, should I follow the order I declare the variables with the comand "varexo"

Thanks in advance, any commentary will be more thatn appreciated

Re: Normal AND Non-Normal Random Variables

PostPosted: Sat Oct 10, 2015 7:09 am
by jpfeifer
In your dynare installation folder there is matlab subdirectory that contains the file.
The order should be in declaration order. You can check this in M_.exo_names