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  

enter image description here

many people prefer see kind of density estimate

kdensity y, biweight bw(0.2) 

enter image description here

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 - @)))) 

enter image description here


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -