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: Julien Bect
Subject: [Octave-bug-tracker] [bug #36718] moment, skewness, and kurtosis differences with Matlab
Date: Fri, 18 Oct 2013 20:00:59 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:24.0) Gecko/20100101 Firefox/24.0

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

This is weird, because I get

5.437731792528892

on my computer with both R 3.0.0, Matlab R2012a and my latest Octave build. On
the other hand, using mpmath with 30 digits of precision I get the following
interval:

mpi('5.43773179252889008331093791989766',
'5.43773179252889008331093791992922')

which means that the value that you report is the correct one. I will change
the current reference values for more precise ones:

2.9786509002956195 (sample kurtosis)
5.4377317925288901 (with bias corrections)

but then I need to raise the tolerance to 8 * eps on my computer to get the
tests to pass. Is that OK ?

Here is the Python code that I use:


from mpmath import iv
iv.dps = 30

x = iv.matrix ([1, 2, 3, 4, 5, 10])
n = iv.mpf('6')
x = x - sum (x) / n

x2 = iv.matrix ([0, 0, 0, 0, 0, 0])
for i in range(0, 6):
    x2[i] = x[i] * x[i];

x4 = iv.matrix ([0, 0, 0, 0, 0, 0])
for i in range(0, 6):
    x4[i] = x2[i] * x2[i];

mu4 = sum (x4) / n
mu2 = sum (x2) / n

k1 = mu4 / (mu2 * mu2)

C = (n - 1) / ((n - 2) * (n - 3))
k0 = 3 + C * ((n + 1) * k1 - 3 * (n - 1))




    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message posté via/par Savannah
  http://savannah.gnu.org/




reply via email to

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