Home > wafo > wstats > wweibcdf.m

wweibcdf

PURPOSE ^

Weibull cumulative distribution function

SYNOPSIS ^

F = wweibcdf(x,a,c)

DESCRIPTION ^

 WWEIBCDF Weibull cumulative distribution function
 
  CALL:  F = wweibcdf(x,a,c);
 
         F = distribution function evaluated at x
      a, c = parameters
 
 
  The Weibull distribution is defined by its cdf
 
   F(x;a,c) = 1 -  exp(-(x/a)^c), x>=0, a,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 = wweibcdf(x,1,1); p2 = wweibcdf(x,2,2);
    plot(x,p1,x,p2)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function F = wweibcdf(x,a,c)
002 %WWEIBCDF Weibull cumulative distribution function
003 %
004 % CALL:  F = wweibcdf(x,a,c);
005 %
006 %        F = distribution function evaluated at x
007 %     a, c = parameters
008 %
009 %
010 % The Weibull distribution is defined by its cdf
011 %
012 %  F(x;a,c) = 1 -  exp(-(x/a)^c), x>=0, a,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 = wweibcdf(x,1,1); p2 = wweibcdf(x,2,2);
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 oab 24.10.2000
030 %  - added comnsize
031 % rewritten ms 15.06.2000
032 
033 
034 error(nargchk(3,3,nargin))
035 
036 [errorcode, x, a, c] = comnsize (x,a, c);
037 if (errorcode > 0)
038   error ('x, a and c must be of common size or scalar');
039 end
040 
041 F=zeros(size(x));
042 
043 ok = ((c > 0)  & (a > 0));
044 
045 k = find (x>=0&ok);
046 if any (k) 
047   F(k)=1-exp(-(x(k)./a(k)).^c(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