Sampling from a distribution

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.

Sampling from a distribution

Postby flel » Wed Jan 11, 2012 12:41 pm

Dear all,

my task is to simulate a model with dynare. Two of my variables are drawn form a known lognormal-distribution with different support. Is there any way to do this in dynare? The only help I found is the random sample function of matlab. However, I dont know how to implement this in dynare. Moreover, I cannot define the support of the distriubtion using this function.

thanks a lot in advance!

flel
flel
 
Posts: 1
Joined: Wed Jan 11, 2012 12:35 pm

Re: Sampling from a distribution

Postby kyri82 » Fri Jan 13, 2012 10:42 am

You can always use Matlab commands in Dynare. So, I guess you can put the relevant command there. For draws from the log-normal distribution see:

http://www.mathworks.fr/help/toolbox/stats/lognrnd.html

Indeed, it seems that you cannot define the support but you can write a small routine where if a draw falls outside your desired support it is dropped. Hope that helps.

Kyriacos
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 5 guests