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

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

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

userin.distrib = 'gamma'; 
userin.ftype = 4;
userin.p_value(2) = 0;
[xhold,fhold,ghold,jhold,xsort,fsort,gsort,chold,isint] =  gen_distrib2(userin,0);
xhold = exp(-xhold);
      
return

Contact us