Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

 

generates random variates from over 870 univariate distributions

tadikal_rnd(p_value,nsamples)
% tadikal_rnd.m - generates 'nsamples' of a Tadikamalla-Johnson L random variable.
%   See "Random Variate Generation in One Line of Code", L. Devroye.
%
%   Created by: J. Huntley,  09/25/06
%

function [jhold,xhold] = tadikal_rnd(p_value,nsamples)

lambda = p_value(1);
delta = p_value(2);
gam = p_value(3);
tsi = p_value(4);
U = rand(1,nsamples);
Z = log(U./(1-U));
jhold = (1:nsamples);
xhold = tsi + lambda.*exp((Z-gam)./delta);

return

Contact us