Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

z_pdf(x, alpha, bet, sigma, mu)
% z_pdf.m - evaluates a Z Probability Density.
%   See "Garch Modelling with Skewed Conditional Distributions",
%   J. Miettinen, U. Helsinki, Aug, 2005 (draft),
%   http://www.valt.helsinki.fi/staff/lanne/workshop05/miettinen.pdf.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  1/08/08
%

function [pdf] = z_pdf(x, alpha, bet, sigma, mu)

%persistent coef apb

%if(isempty(coef))
    apb = alpha + bet;
    coef = 1 / (sigma * beta(alpha,bet));
%end

arg = exp((x - mu) ./ sigma);
pdf = coef .* arg.^alpha ./ (1 + arg).^apb;

return

Contact us