Home > wafo > wstats > wtweibcdf.m

wtweibcdf

PURPOSE

Truncated Weibull cumulative distribution function

SYNOPSIS

F = wtweibcdf(x,a,b,c)

DESCRIPTION

``` WTWEIBCDF Truncated Weibull cumulative distribution function

CALL:  F = wtweibcdf(x,a,b,c);

F = distribution function evaluated at x
a,b,c = parameters

The Truncated Weibull distribution is defined by its cdf

F(x;a,c) = 1 -  exp(-((x+c)/a)^b+abs(c/a)^b), x>=0, a>0,b>0

Some references refer to the Weibull distribution with
a single parameter, this corresponds to WWEIBPDF with a = 1.

Example:
x = linspace(0,6,200);
p1 = wtweibcdf(x,1,1,1); p2 = wtweibcdf(x,2,2,3);
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:
 thcdf Marginal wave height, Hd, CDF for Torsethaugen spectra. wtweibfit Parameter estimates for truncated Weibull data. wtweibfun Is an internal routine for wtweibfit

SOURCE CODE

```001 function F = wtweibcdf(x,a,b,c)
002 %WTWEIBCDF Truncated Weibull cumulative distribution function
003 %
004 % CALL:  F = wtweibcdf(x,a,b,c);
005 %
006 %        F = distribution function evaluated at x
007 %    a,b,c = parameters
008 %
009 %
010 % The Truncated Weibull distribution is defined by its cdf
011 %
012 %  F(x;a,c) = 1 -  exp(-((x+c)/a)^b+abs(c/a)^b), x>=0, a>0,b>0
013 %
014 %   Some references refer to the Weibull distribution with
015 %   a single parameter, this corresponds to WWEIBPDF with a = 1.
016 %
017 % Example:
018 %   x = linspace(0,6,200);
019 %   p1 = wtweibcdf(x,1,1,1); p2 = wtweibcdf(x,2,2,3);
020 %   plot(x,p1,x,p2)
021
022
023 % Reference: Cohen & Whittle, (1988) "Parameter Estimation in Reliability
024 % and Life Span Models", p. 25 ff, Marcel Dekker.
025
026
027 % Tested on; Matlab 5.3
028 % History:
029 % revised pab 24.10.2000
031 % rewritten ms 15.06.2000
032
033
034 error(nargchk(3,4,nargin))
035 if nargin<4|isempty(c),c=0;end
036 [errorcode, x, a,b,c] = comnsize (x,a,b, abs(c));
037 if (errorcode > 0)
038   error ('x, a, b and c must be of common size or scalar');
039 end
040
041 F=zeros(size(x));
042
043 ok = ((b > 0)  & (a > 0));
044
045 k = find (x>=0&ok);
046 if any (k)
047   F(k)=1-exp(-((x(k)+c(k))./a(k)).^b(k)+abs(c(k)./a(k)).^b(k));
048 end
049
050 k1 = find (~ok);
051 if any (k1)
052   tmp=NaN;
053   F(k1) = tmp(ones(size(k1)));
054 end
055
056
057
058
059
060
061
062
063```

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