octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #44987] statistics: hist3 should pad output wh


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #44987] statistics: hist3 should pad output when called with centers larger than data
Date: Thu, 13 Aug 2015 01:59:43 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.8.0

Update of bug #44987 (project octave):

                  Status:                    None => Fixed                  
             Open/Closed:                    Open => Closed                 
                 Release:                   4.0.0 => other                  
                 Summary: hist3 should pad output when called with centers
larger than data => statistics: hist3 should pad output when called with
centers larger than data

    _______________________________________________________

Follow-up Comment #2:

I can confirm this bug and that this is a regression caused by
http://hg.code.sf.net/p/octave/statistics/rev/51b09dcd0aa7 by the change
"replaced 'sparse' with 'accumarray', which avoids the superfluous creation
and conversion of sparse matrices".

Replacing the use of accumarray back to sparse, fixes the issue. (pushed fix
http://hg.code.sf.net/p/octave/statistics/rev/4ce359e8d1de )

A simple example, using "Edges" (which is my use case and was working fine 2
years ago):


octave> hist3 ([1:10; 1:5:50]', "Edges", {linspace(0, 10, 10), linspace(0, 50,
10)})
error: surface: rows (Z) must be the same as length (Y) and columns (Z) must
be the same as length (X)
error: called from


The error comes surface but that's because hist3 is passing the wrong data to
it.  This can be shown by getting the data instead of displaying. Note how the
size of the output changes with random data, even though the bin edges are
defined always the same:


octave> for i=1:10
  h_size(:, i) = size (hist3 (rand (10, 2), "Edges", {[0:0.2:1]; [0:.2:1]}));
endfor
octave> h_size 
h_size =

   5   3   5   5   5   4   5   5   4   5
   5   5   5   5   5   5   5   5   5   5




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44987>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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