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

dbtrnorm_pdf(x, mu, sigma, A, B)
% test_dbtrnorm.m - tests a Doubly Truncated Normal Probability Density.
%   See "Continuous Univariate Distributions", Johnson, Kotz and Balakrishnan,
%   Vol.1, J. Wiley, 1995, p.156.
%
%  Created by Jim Huntley,  10/13/08
%

function [pdf] = dbtrnorm_pdf(x, mu, sigma, A, B)

%persistent denom

%if(isempty(denom))
    denom = gaus_cdf(B,mu,sigma) - gaus_cdf(A,mu,sigma);
%end

pdf = gaus_pdf(x,mu,sigma) ./ denom;

return


Contact us