Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sample.Skewness() returns population skewness #57

Open
kirbatious opened this issue Sep 11, 2019 · 0 comments
Open

sample.Skewness() returns population skewness #57

kirbatious opened this issue Sep 11, 2019 · 0 comments

Comments

@kirbatious
Copy link

The Statistics class has Skewness() and PopulationSkewness() methods where skewness has a bessel correction.

However if you make a new instance of Sample, the two (extension) methods Skewness() and PopulationSkewness() give the same answer in meta.numerics 4.0.7.

This is because sample.Skewness() actually defaults into the Univariate class implementation of Skewness(), which seems to calculate population skewness.

I believe that either Univariate needs fixing, or Sample needs an override Skewness() method which calls through to the Statistics class, but I don't know which is more sensible.

Example code:

        var sample = new Sample { 2, 2.3, -5.6, 10, -21, 42 };

        var sampleSkewness = Statistics.Skewness(sample);
        var populationSkewness = sample.PopulationSkewness(); // Equivalent to Statistics.PopulationSkewness(sample);
        var alsoPopulationSkewness = sample.Skewness(); // Equivalent to Univariate.Skewness(sample);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant