Statistics function incorrectly computing median

Miguel Garcia-Blanco miguel.01 at ihug.com.au
Sat Jan 26 05:39:14 CST 2008


> Ok. I decided to place Matlab compatibility as a high priority (when
> applicable). I do not have access to Matlab's statistics toolbox, and
> have relied upon Michael Godfrey to verify how Matlab handles NaN's,
> Inf's, as well as other compatibility issues (thanks Michael).
>
> To avoid breaking unidinv's compatibility with Matlab, I decided to
> avoid (4) and (5) above.
>
> The three functions prctile, quantile, and statistics each depend upon
> __quantile__.m (a new function). Since variants of the quantile
> function exists in Maxima and GNU's R, I've included those methods as
> well. (See help quantile).
>
> At the moment prctile.m respects Matlab's variant, with no optional
> support for R's methods.
>
> It has been many years since I did any substantial statistics work, so
> the nomenclature help contained in the scripts might be misleading/
> confusing. Feel free to send corrections.
>

I've attached my ideas for the function descriptions. Of course, whether you
use "compute" or "calculate" is a matter of taste.

> I've attached the new scripts (and the modified statistics script).
> For those interested, please review and test them.
>
> There are several tests included as well ("text quantile" for example).
>
> Ben

My tests (using 40 samples with 6 observations ~N(0,100)) indicate
everything seems to be okay, except quantile.m with METHOD = 3: For six
observations, the 3rd quartile should be the 4th order statistic. Currently
returns the 5th order statistic.

-Miguel
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: FunctionDescriptions.txt
Url: https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080126/e8edb757/attachment.txt 


More information about the Bug-octave mailing list