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

...
% gamaintg_rnd.m - generates 'nsamples' of a Linnik random variable.
%   from "NonUniform Random Variate Generation", Chap. 4, L. Devroye.
%
%   Created by: J. Huntley,  09/25/06
%

function [xhold,fhold,ghold,jhold,xsort,fsort,gsort,chold,isint] = ...
          gamaintg_rnd(userin,p_value,nsamples)

a = p_value(1);
userin.distrib = 'gamma'; 
userin.ftype = 4;
userin.p_value = [p_value(1) 0 1];
[xhold,fhold,ghold,jhold,xsort,fsort,gsort,chold,isint] =  gen_distrib2(userin,0);
U = rand(1,nsamples);
xhold = xhold .* U;
      
return

Contact us