Skip to content

MathExtensions.Median not following general definition of median #22

@dolivanu

Description

@dolivanu

The MathExtensions.Median() function doesn't adhere to the statistical definition of median, that can be found on Wikipedia. This definition states that the value choosen depends on the value count:

If there is an odd number of numbers, the middle one is picked.

If there are an even number of observations, then there is no single middle value; the median is then usually defined to be the mean of the two middle values.

Current implementation takes the value at count / 2, that differs when value count is even with the above definition. When the value count is odd, the current implementation ok.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions