pdf - Laplace distribution sampling -
anyone know how draw multiple times laplace distribution in stata? want run monte carlo analysis , know data fits laplace distribution.
here's sample script. naturally scale parameter whatever is. location parameter here 0 implication; if not add in.
clear version 10: set seed 2803 set obs 10000 scalar sigma = 1 gen p = runiform() gen y = sigma * cond(p <= 0.5, log(2 * p), -log(2 * (1 - p))) we can use normal quantile plot reference showing tail behaviour quite different normal or gaussian.
qnorm y many people prefer see kind of density estimate
kdensity y, biweight bw(0.2) but critical graph dedicated quantile-quantile plot. 1 uses qplot must install stata journal archive after search qplot in stata. note @ not typo here: placeholder whatever otherwise plotted on x axis.
qplot y, trscale(cond(@ <= 0.5, log(2 * @), -log(2 * (1 - @)))) 


Comments
Post a Comment