bugGNU Octave - Bugs: bug #32168, [octave forge] (dataframe) support...


bug #32168: [octave forge] (dataframe) support for skewness, kurtosis

Submitted by:  Pascal Dupuis <cdemills>
Submitted on:  Tue 18 Jan 2011 11:01:56 AM UTC  
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: NoneAssigned to: None
Originator Name: Pascal DupuisOpen/Closed: Open
Release: otherOperating System: GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Wed 16 Nov 2016 07:00:41 PM UTC, comment #8:

@jbect can this bug report be closed?

Mike Miller <mtmiller>
Project Administrator
Fri 18 Oct 2013 05:23:28 PM UTC, comment #7:

This bug report should be easy to close once I finish working on bug report #36718.

Julien Bect <jbect>
Fri 18 Oct 2013 02:52:15 PM UTC, comment #6:

Ok, my question was indeed about the "closed" status of this bug report ;-)

Julien Bect <jbect>
Fri 18 Oct 2013 02:46:29 PM UTC, comment #5:

No new bug report. This report, since it had the history, was re-assigned to the Octave-Forge category and the Summary was re-written. I accidentally closed it as well, but it is now open again with the new classification.

Rik <rik5>
Project Administrator
Fri 18 Oct 2013 10:56:30 AM UTC, comment #4:

Where is the new bug report ?

Julien Bect <jbect>
Thu 17 Oct 2013 06:12:18 PM UTC, comment #3:

Pushing this bug on to the dataframe package rather than core Octave.

Rik <rik5>
Project Administrator
Tue 24 Sep 2013 04:44:48 PM UTC, comment #2:

Agree with Julien that fixing the problem within the dataframe package makes more sense in this case. Core functions can't be expected to know about arbitrary data types.

Nir Krakauer <nir_krakauer>
Wed 11 Sep 2013 10:40:13 AM UTC, comment #1:

The problem is still there in Octave 3.6.4 and also in the latest development version. Moreover, the exact same problem exists with statistics/base/kurtosis.m.

Wouldn'it be a better idea, instead of modifying the base functions skewness and kurtosis, to to overload them for the @dataframe class?

As a bonus, this would allow to handle non-numeric columns gracefully (by returning NaN for them, for instance, plus perhaps a warning).

Julien Bect <jbect>
Tue 18 Jan 2011 11:01:56 AM UTC, original submission:

In the file statistics/base/skewness.m, a test is performed to detect variables whose std is 0. As the skewness implies taking the inverse of the std, the skewness for those values is simply set to 0, to avoid division by 0. This is accomplished at lines 79-83. retval is initialised to be zeros of the class of the input. For a user-defined class, this fails with
"zeros: invalid data type specified"
Moreover, overloaded funcs for a dataframe object takes care about propagating meta-information. This way, the line
retval(ind) = x(ind) ./ (c * s(ind) .^ 3)
implies a lot of work, as we're dealing with 3 variables. I thus propose the enclosed patch. Ideas:

ind = (s > 0); <= keep tracks of thing to process some way/some other way
retval = sum (x .^ 3, dim); <= retval receive all its meta-inf from x

if !isobject(x),
retval(~ind) = zeros (1, class (x)); <= fast way
retval(~ind) = 0; %# let the class subsasgn handle the cast

retval(ind) = retval(ind) ./ (c * s(ind) .^ 3);



Pascal Dupuis <cdemills>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #22436:  skewness.pat added by cdemills (665B - image/x-coreldrawpattern)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by jwe (Updated the item)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by nir_krakauer (Posted a comment)
  • -unavailable- added by jbect (Posted a comment)
  • -unavailable- added by cdemills (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 13 Aug 2017 01:29:14 PM UTCjweSummary@dataframe package support for skewness, kurtosis=>[octave forge] (dataframe) support for skewness, kurtosis
    Wed 16 Nov 2016 07:09:50 PM UTCrik5Carbon-CopyRemoved 72865=>-
    Wed 16 Nov 2016 07:00:41 PM UTCmtmillerRelease3.3.54=>other
    Fri 18 Oct 2013 02:46:29 PM UTCrik5Open/ClosedClosed=>Open
    Thu 17 Oct 2013 06:12:18 PM UTCrik5CategoryLibraries=>Octave Forge Package
      Summaryskewness.m: initialise the output from the input=>@dataframe package support for skewness, kurtosis
    Tue 18 Jan 2011 11:01:56 AM UTCcdemillsAttached File-=>Added skewness.pat, #22436

    Back to the top

    Powered by Savane 3.1-cleanup1