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

[ENH] Skew-Normal Distribution #512

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Spinachboul
Copy link

Reference Issues/PRs

Fixes Issue #510

What does this implement/fix? Explain your changes.

This implementation adds a new Skew-Normal distribution as a probabilistic model in skpro. The inspiration comes from the paper (https://www.ine.pt/revstat/pdf/rs130105.pdf).

The Skew-Normal distribution captures skewness in data, improving the flexibility of predictive distributions. Scipy already implements this as scipy.stats.skewnorm, which is used as a dependency to avoid redundant code.

Key changes include:

  • Added SkewNormal class to the probabilistic module with parameter fitting and density evaluation methods.
  • Updated the distribution factory to register SkewNormal.
  • Extended model selection capabilities for handling skew-normal data.

Does your contribution introduce a new dependency?

No new core dependencies are introduced. scipy is already a core dependency.

Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

Thanks, great start!

Some comments:

  • please follow the extension template carefully, all __init__ parameters should be written to self, to an attribute of the same name
  • properties should not be used for the __init__ parameters, this is due to how the base class get_params etc works
  • loc is a reserved attribute and should not be overridden. Another common name is xi, but feel free to choose anything as lon gas it is not loc.
  • code formatting tests are failing, please address

@fkiraly fkiraly added module:probability&simulation probability distributions and simulators implementing algorithms Implementing algorithms, estimators, objects native to skpro labels Jan 11, 2025
@Spinachboul
Copy link
Author

Spinachboul commented Jan 13, 2025

@fkiraly
Thanks for the suggestions
I have updated the PR by making changes in the class implementation where I have followed the extension template
But I have used BaseDistribution instead of ScipyAdapter, since that might provide more flexibility in terms of functions and general implementation.
What are your views on that??

@Spinachboul Spinachboul requested a review from fkiraly January 13, 2025 04:39
@fkiraly fkiraly changed the title Implementation of Skew-Normal Distribution [ENH] Skew-Normal Distribution Jan 13, 2025
Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

Thanks!

@Spinachboul Spinachboul requested a review from fkiraly January 16, 2025 04:01
Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

Thanks!

Can you kindly make sure you use the extension template? Please read it carefully. For instance:

@Spinachboul Spinachboul requested a review from fkiraly January 16, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implementing algorithms Implementing algorithms, estimators, objects native to skpro module:probability&simulation probability distributions and simulators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants