Page 1 of 1

Sampling from a distribution

PostPosted: Wed Jan 11, 2012 12:41 pm
by flel
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

Re: Sampling from a distribution

PostPosted: Fri Jan 13, 2012 10:42 am
by kyri82
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