Normal AND Non-Normal Random Variables

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.

Normal AND Non-Normal Random Variables

Postby antonia » Thu Apr 04, 2013 10:12 am

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?
antonia
 
Posts: 2
Joined: Thu Apr 04, 2013 10:01 am

Re: Normal AND Non-Normal Random Variables

Postby jpfeifer » Fri Apr 05, 2013 6:29 pm

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.
------------
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: Normal AND Non-Normal Random Variables

Postby camara_cmb » Sat Oct 10, 2015 3:27 am

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
camara_cmb
 
Posts: 19
Joined: Thu Jul 17, 2014 3:44 pm

Re: Normal AND Non-Normal Random Variables

Postby jpfeifer » Sat Oct 10, 2015 7:09 am

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
------------
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: No registered users and 4 guests

cron