Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley (view profile)


generates random variates from over 870 univariate distributions

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

function [jhold,xhold] = tadikab_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./(1+exp(-(Z-gam)./delta));


Contact us