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

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

[Octave-bug-tracker] [bug #36718] moment, skewness, and kurtosis differe


From: Rik
Subject: [Octave-bug-tracker] [bug #36718] moment, skewness, and kurtosis differences with Matlab
Date: Fri, 18 Oct 2013 15:20:14 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0

Follow-up Comment #21, bug #36718 (project octave):

The patch looks good.  I might change


y(idx) = 3 + C * ((n + 1) * y(idx) - 3 * (n - 1));


to


y = 3 + C * ((n + 1) * y - 3 * (n - 1));


Since it "looks" more like a straightforward equation.  You don't have to
worry about the values not in idx because they have been assigned the value of
NaN, and any further math operation with a NaN value produces a NaN.

Also, this was my mistake in one of the tests for division-by-zero.  I save
and restore the warning state but don't actually force the "divide-by-zero"
state to on.  I've corrected that in skewness so that the test reads


## Verify no "divide-by-zero" warnings
%!test
%! wstate = warning ("query", "Octave:divide-by-zero");
%! warning ("on", "Octave:divide-by-zero");
%! unwind_protect
%!   lastwarn ("");  # clear last warning
%!   skewness (1);
%!   assert (lastwarn (), "");
%! unwind_protect_cleanup
%!   warning (wstate, "Octave:divide-by-zero");
%! end_unwind_protect



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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