octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pareto function


From: David Bateman
Subject: Re: pareto function
Date: Fri, 30 Nov 2007 00:28:28 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

John W. Eaton wrote:
> On 30-Nov-2007, David Bateman wrote:
> 
> | Here is a patch that adds the pareto function. At the same time it fixes
> | two bugs in plotyy and __go_draw_axes__ that prevented pareto from
> | working correctly.
> 
> I checked it in.
> 
> | +   [dummy, idx95] = min (abs (cdf - .95));
> | +   idx95 - idx95(1);
> 
> The last line above looks like a possible bug, or at least an
> expression that should be deleted.
> 
> jwe
> 

Its a bug the "-" is supposed to be an "=", as its possible to have a
negative values in the data, so we can pass the 95% confidence level
twice. However, thinking about it that fixed isn't enough. The attached
patch (which I committed) is needed..

D.

Index: scripts/plot/pareto.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/plot/pareto.m,v
retrieving revision 1.1
diff -c -r1.1 pareto.m
*** scripts/plot/pareto.m       29 Nov 2007 23:14:08 -0000      1.1
--- scripts/plot/pareto.m       29 Nov 2007 23:27:04 -0000
***************
*** 79,88 ****
    [x, idx] = sort (x, "descend");
    y = y (idx);
    cdf = cumsum (x);
!   maxcdf = cdf(end);
!   cdf = cdf ./ cdf (end);
    [dummy, idx95] = min (abs (cdf - .95));
!   idx95 - idx95(1);
  
    [ax, hbar, hline] = plotyy (ax, 1 : idx95, x (1 : idx95), 
                              1 : length(cdf), 100 .* cdf, 
--- 79,88 ----
    [x, idx] = sort (x, "descend");
    y = y (idx);
    cdf = cumsum (x);
!   maxcdf = max(cdf);
!   cdf = cdf ./ maxcdf;
    [dummy, idx95] = min (abs (cdf - .95));
!   idx95 = idx95(1);
  
    [ax, hbar, hline] = plotyy (ax, 1 : idx95, x (1 : idx95), 
                              1 : length(cdf), 100 .* cdf, 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]