5693
|
1 ## Copyright (C) 2006 John W. Eaton |
5411
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by |
|
7 ## the Free Software Foundation; either version 2, or (at your option) |
|
8 ## any later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, write to the Free |
|
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
18 ## 02110-1301, USA. |
|
19 |
|
20 ## -*- texinfo -*- |
5693
|
21 ## @deftypefn {Function File} {} weibull_cdf (@var{x}, @var{shape}, @var{scale}) |
5411
|
22 ## Compute the cumulative distribution function (CDF) at @var{x} of the |
5693
|
23 ## Weibull distribution with shape parameter @var{scale} and scale |
|
24 ## parameter @var{shape}, which is |
5411
|
25 ## |
|
26 ## @example |
5693
|
27 ## 1 - exp(-(x/shape)^scale) |
5411
|
28 ## @end example |
|
29 ## |
|
30 ## @noindent |
|
31 ## for @var{x} >= 0. |
|
32 ## @end deftypefn |
|
33 |
|
34 function cdf = weibull_cdf (varargin) |
|
35 |
5693
|
36 if (nargin == 2) |
|
37 varargin{3} = varargin{2}; |
|
38 varargin{2} = 1; |
|
39 elseif (nargin > 2) |
|
40 tmp = varargin{3}; |
|
41 varargin{3} = varargin{2}; |
|
42 varargin{2} = tmp; |
|
43 endif |
|
44 |
|
45 cdf = wblcdf (varargin{:}); |
5411
|
46 |
|
47 endfunction |