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

dbtrlogis_cdf(x, P, Q, k)
% dbtrlogis_cdf.m - evaluates a Doubly Truncated Logistic Cumulative Distribution.
%   See "Continuous Univariate Distributions", Johnson, Kotz and Balakrishnan,
%   Vol.2, J. Wiley, 1995, p.142.
%
%  Created by Jim Huntley,  10/13/08
%

function [cdf] = dbtrlogis_cdf(x, P, Q, k)

%persistent Q1

%if(isempty(Q1))
    Q1 = (1 - ((1-Q)/Q)^k) / k;
%end

cdf = 1 / ((P-Q)*(1+(1-k*x)^(1/k))) - 1 / ((P-Q)*(1+(1-k*Q1)^(1/k)));

return


Contact us