From bug-request at octave dot org Wed Nov 23 09:00:23 2005 Subject: weibull functions From: Ben Barrowes To: bug at octave dot org Date: Wed, 23 Nov 2005 09:57:18 -0500 octave's weibpdf.m has inputs switched from ML's weibpdf.m (now renamed wblpdf.m). ML: >> lambda = 1:6; >> y = wblpdf(0.1:0.1:0.6,lambda,1) y = Columns 1 through 4 0.90483741803596 0.45241870901798 0.301612472678653 0.22620935450899 Columns 5 through 6 0.180967483607192 0.150806236339327 Octave: octave:9> lambda = 1:6; octave:10> y = weibpdf(0.1:0.1:0.6,lambda,1) y = Columns 1 through 4: 0.904837418035960 0.384315775660929 0.262807535211571 0.249529574810059 Columns 5 and 6: 0.302885385773858 0.445292170382349 octave:11> y = weibpdf(0.1:0.1:0.6,1,lambda) y = Columns 1 through 4: 0.904837418035960 0.452418709017980 0.301612472678653 0.226209354508990 Columns 5 and 6: 0.180967483607192 0.150806236339327 octave:12> Here is a patch to switch the 2 inputs in weibpdf.m --- weibpdf.m.old 2005-11-23 09:37:02.000000000 -0500 +++ weibpdf.m 2005-11-23 09:37:17.000000000 -0500 at @ -34,7 +34,7 @@ ## Author: KH ## Description: PDF of the Weibull distribution -function pdf = weibpdf (x, shape, scale) +function pdf = weibpdf (x, scale, shape) if (nargin != 3) usage ("weibpdf (x, alpha, sigma)"); If it would be better to update the docs and the code to use A, B, and update the help to better reflect this change, I could provide patches for that. octave's weibcdf.m and weibinv.m (now wblcdf.m and wblinv.min ML) also has the inputs switched: --- weibcdf.m.old 2005-11-23 09:47:19.000000000 -0500 +++ weibcdf.m 2005-11-23 09:47:22.000000000 -0500 at @ -34,7 +34,7 @@ ## Author: KH ## Description: CDF of the Weibull distribution -function cdf = weibcdf (x, shape, scale) +function cdf = weibcdf (x, scale, shape) if (nargin != 3) usage ("weibcdf (x, alpha, sigma)"); --- weibinv.m.old 2005-11-23 09:49:44.000000000 -0500 +++ weibinv.m 2005-11-23 09:49:49.000000000 -0500 at @ -27,7 +27,7 @@ ## Author: KH ## Description: Quantile function of the Weibull distribution -function inv = weibinv (x, shape, scale) +function inv = weibinv (x, scale, shape) if (nargin != 3) usage ("weibinv (x, alpha, sigma)"); I assume weibrnd.m has its inputs switched as well: --- weibrnd.m.old 2005-11-23 09:54:46.000000000 -0500 +++ weibrnd.m 2005-11-23 09:54:51.000000000 -0500 at @ -32,7 +32,7 @@ ## Author: KH ## Description: Random deviates from the Weibull distribution -function rnd = weibrnd (shape, scale, r, c) +function rnd = weibrnd (scale, shape, r, c) if (nargin > 1) if (!isscalar(shape) || !isscalar(scale)) bb ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------