Statistics function incorrectly computing median

Ben Abbott bpabbott at mac.com
Mon Jan 21 17:48:06 CST 2008


On Jan 21, 2008, at 5:53 PM, Miguel Garcia-Blanco wrote:

>> I was referring to Octave's statistics functions, specifically  
>> discrete_inv.m
>>
>> Octave's present algorithms calculate the quantiles from the  
>> specified probabilities, P. Thus, it may not always be possible to  
>> find a proper algorithm that works for varied probabilities that is  
>> consistent with a pre-exiting algorithm that works for constant  
>> probabilities.
>>
>
> Ah, now I understand what you mean.
>
> All of the *inv.m functions (e.g., binoinv, norminv, etc.), with the  
> exception of empirical_inv.m, are only for population distributions,  
> not samples (i.e., they return theoretical values of population  
> parameters). Hence, discrete_inv.m is inappropriate for computing  
> sample quantiles.
>
> -Miguel

Correct.

... So what I plan to do is to leave discrete_???.m as it is, and have  
empirical_???.m work as R's method #7. I'll likely have the latter  
optionally support other algorithms as well (Matlab's for sure).

 From there other Matlab style compatible functions can be added  
(quantile, prctile, etc).

I'd change discrete_inv.m to work as R's method #2, but I'm not sure  
it will give the proper result to hygeinv.m ... thoughts?

Ben


More information about the Bug-octave mailing list