Home > wafo > wstats > wraylcdf.m

wraylcdf

PURPOSE

Rayleigh cumulative distribution function

SYNOPSIS

F = wraylcdf(x,b);

DESCRIPTION

``` WRAYLCDF Rayleigh cumulative distribution function

CALL:  F = wraylcdf(x,b);

F = distribution function evaluated at x
b = parameter

The Rayleigh distribution is defined by its cdf

F(x;b) = 1 - exp(-x^2/(2b^2)), x>=0

Example:
x = linspace(0,4,200);
p1 = wraylcdf(x,1); p2 = wraylcdf(x,0.5);
plot(x,p1,x,p2)```

CROSS-REFERENCE INFORMATION

This function calls:
 comnsize Check if all input arguments are either scalar or of common size. error Display message and abort function. nan Not-a-Number.
This function is called by:
 dist2dcdf Joint 2D CDF computed as int F(X1 dist2dfun is an internal function to dist2dcdf dist2dprb. mdist2dcdf Joint 2D CDF due to Plackett mdist2dpdf Joint 2D PDF due to Plackett given as f{x1}*f{x2}*G(x1,x2;Psi). ochi98cdf Ochi's (1998) CDF of peaks and troughs of non-gaussian processes tay81cdf Tayfun (1981) CDF of breaking limited wave heights tay90cdf Tayfun (1990) CDF of large wave heights wraylfit Parameter estimates for Rayleigh data.

SOURCE CODE

```001 function F = wraylcdf(x,b);
002 %WRAYLCDF Rayleigh cumulative distribution function
003 %
004 % CALL:  F = wraylcdf(x,b);
005 %
006 %        F = distribution function evaluated at x
007 %        b = parameter
008 %
009 % The Rayleigh distribution is defined by its cdf
010 %
011 %  F(x;b) = 1 - exp(-x^2/(2b^2)), x>=0
012 %
013 % Example:
014 %   x = linspace(0,4,200);
015 %   p1 = wraylcdf(x,1); p2 = wraylcdf(x,0.5);
016 %   plot(x,p1,x,p2)
017
018 % Reference: Cohen & Whittle, (1988) "Parameter Estimation in Reliability
019 % and Life Span Models", p. 181 ff, Marcel Dekker.
020
021
022 % Tested on; Matlab 5.3
023 % History:
024 % revised pab 24.10.2000
025 %  - added comnsize, nargchk
027
028 error(nargchk(2,2,nargin))
029 [errorcode, x, b] = comnsize (x,b);
030 if (errorcode > 0)
031   error ('x and b must be of common size or scalar');
032 end
033
034 F=zeros(size(x));
035
036 k = find ((x>=0)&(b>0));
037 if any (k)
038   F(k)=1-exp(-x(k).^2./(2*b(k).^2));
039 end
040
041 k1 = find (b<=0);
042 if any (k1)
043   tmp=NaN;
044   F(k1) = tmp(ones(size(k1)));
045 end
046
047
048
049
050```

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