Home > wafo > wstats > wlogncdf.m

# wlogncdf

## PURPOSE

Lognormal cumulative distribution function

## SYNOPSIS

F = wlogncdf(x,m,v);

## DESCRIPTION

``` WLOGNCDF Lognormal cumulative distribution function

CALL:  F = wlogncdf(x,m,s);

F = distribution function evaluated at x
m,v =parameters

The Lognormal distribution is defined by its pdf

f(x)=(v*2*pi*x^2)^(-1)*exp(-(log(x)-m)^2/(2*v)), x>=0.

Example:
x = linspace(0,6,200);
p1 = wlogncdf(x,0,1); p2 = wlogncdf(x,.5,0.25);
plot(x,p1,x,p2)```

## CROSS-REFERENCE INFORMATION

This function calls:
 comnsize Check if all input arguments are either scalar or of common size. wnormcdf Normal cumulative distribution function error Display message and abort function.
This function is called by:
 dist2dcdf Joint 2D CDF computed as int F(X1 dist2dfun is an internal function to dist2dcdf dist2dprb. ltwcpdf Long Term Wave Climate PDF of significant wave height and wave period mdist2dcdf Joint 2D CDF due to Plackett mdist2dpdf Joint 2D PDF due to Plackett given as f{x1}*f{x2}*G(x1,x2;Psi). mk87pdf Myrhaug and Kjeldsen (1987) joint (Scf,Hd) PDF. wlognfit Parameter estimates for Lognormal data.

## SOURCE CODE

```001 function F = wlogncdf(x,m,v);
002 %WLOGNCDF Lognormal cumulative distribution function
003 %
004 % CALL:  F = wlogncdf(x,m,s);
005 %
006 %        F = distribution function evaluated at x
007 %      m,v =parameters
008 %
009 % The Lognormal distribution is defined by its pdf
010 %
011 %        f(x)=(v*2*pi*x^2)^(-1)*exp(-(log(x)-m)^2/(2*v)), x>=0.
012 %
013 % Example:
014 %   x = linspace(0,6,200);
015 %   p1 = wlogncdf(x,0,1); p2 = wlogncdf(x,.5,0.25);
016 %   plot(x,p1,x,p2)
017
018 % Reference: Cohen & Whittle, (1988) "Parameter Estimation in Reliability
019 % and Life Span Models", p. 59 ff, Marcel Dekker.
020
021
022
023 % Tested on; Matlab 5.3
024 % History:
025 % revised pab 24.10.2000
026 %  - added comnsize, nargchk
027 %  - added default values
029
030 error(nargchk(1,3,nargin))
031 if nargin<2|isempty(m),  m=0;  end
032 if nargin<3|isempty(v),  v=1;  end
033
034 [errorcode, x, m, v] = comnsize (x,m, v);
035 if (errorcode > 0)
036   error ('x, m and v must be of common size or scalar');
037 end
038 F=zeros(size(x));
039 k=find(x>0); % avoid log(0)
040 if any(k)
041   F(k)=wnormcdf(log(x(k)),m(k),v(k));
042 end
043
044```

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group

Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003