help-octave
[Top][All Lists]
Advanced

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

Re: Problem with MEANDEV()


From: Francesco Potortì
Subject: Re: Problem with MEANDEV()
Date: Fri, 18 Dec 2009 17:25:48 +0100

>I'm getting a weird answer from meandev as compared to Excel, Wolfram Alpha
>and Protium.
>
>GNU Octave, version 3.2.3
>Octave was configured for "i686-pc-mingw32"
>
>meandev([8, 8,  9, 11, 11, 15, 16, 19, 19, 20, 20, 21, 21, 25, 32]) --> ans
>=  5.8571
>
>All the others give 5.46667

The meandev function is part of the nan package, which is not
distributed with octave, but rather with octave-forge.

That said, the nan package 1.0.8 uses an unbiased estimation for the
mean deviation:

octave> a=[8, 8,  9, 11, 11, 15, 16, 19, 19, 20, 20, 21, 21, 25, 32];
octave> n=length(a)
ans =  15
octave> mean(abs(a-mean(a)))
ans =  5.4667

octave> pkg load nan
octave> meandev([8, 8,  9, 11, 11, 15, 16, 19, 19, 20, 20, 21, 21, 25, 32])
ans =  5.8571

octave> mean(abs(a-mean(a)))*n/(n-1)
ans =  5.8571

-- 
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/


reply via email to

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