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

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

function [jhold,xhold] = tadikau_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.*sinh((Z-gam)./delta);

return

Contact us