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

add IterativeMoments + test #21

Merged

Conversation

robcaulk
Copy link
Contributor

@robcaulk robcaulk commented May 25, 2023

This PR adds an IterativeMoments class for obtaining the iterative moments, including the mean, variance, skewness, and kurtosis (broken for now, see below).

We need this in Melissa for full backwards compatibility to continue supporting reproducibility of the original 2017 paper.

The equation for Kurtosis appears to be incorrect, but we simply copy pasted it verbatim from the original Melissa implementation. After further investigation, I attempted to change the class to follow OpenTurns exactly, which references this article. The error remains identical, which suggests that the original Melissa implementation is in-fact the same as OpenTurns, and both are incapable of matching Scipy non-iterative Kurtosis.

I opened an issue over at OpenTurns to see if they can correct the issue.

Copy link
Contributor

@alejandro-ribes alejandro-ribes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have verified the formulas proposed by Meng in his article, which are the ones implemented, and agree with the introduction of this method. It is strange that the tests for Kurtosis fails for our library but also for OpenTurns. We should check how kurtosis is implemented in Scipy. I also point out that the tests fails with less error when we augment the number of samples. It maybe indicates a problem of long time of convergence for the iterative algorithm.

@alejandro-ribes alejandro-ribes merged commit 652e391 into IterativeStatistics:main Jun 23, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants