Skip to content

[BUG] Fix Laplace energy_self calculation and docstring typos#720

Merged
fkiraly merged 2 commits intosktime:mainfrom
Ashish-Kumar-Dash:_energy_self
Feb 13, 2026
Merged

[BUG] Fix Laplace energy_self calculation and docstring typos#720
fkiraly merged 2 commits intosktime:mainfrom
Ashish-Kumar-Dash:_energy_self

Conversation

@Ashish-Kumar-Dash
Copy link
Contributor

Reference Issues/PRs

Fixes #719

What does this implement/fix? Explain your changes.

  1. Bug fix in Laplace._energy_self: The 1.5 multiplier for self-energy was incorrectly placed inside the array dimension check, causing scalar Laplace distributions to return wrong energy values. Moved the multiplier to apply unconditionally before the dimension check.

  2. Docstring convention fixes: Changed ParameterParameters and ReturnReturns to follow NumPy docstring conventions in:

    • exponential.py
    • _base.py
    • evaluate.py
    • _show_versions.py
  3. Input validation in evaluate(): Added a check that X and y have the same length, providing a clear error message instead of cryptic failures downstream.

Does your contribution introduce a new dependency? If yes, which one?

No.

What should a reviewer concentrate their feedback on?

  • Verify the mathematical correctness of the Laplace energy fix
  • Confirm the input validation message is appropriate

Did you add any tests for the change?

No new tests added. Existing tests cover the fixed functionality.

PR checklist

  • I've added myself to the list of contributors with bug and code badges
  • The PR title starts with [BUG]

@fkiraly fkiraly added bug module:probability&simulation probability distributions and simulators labels Feb 13, 2026
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, good spot!

@fkiraly fkiraly merged commit dde572d into sktime:main Feb 13, 2026
13 of 217 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug module:probability&simulation probability distributions and simulators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Laplace distribution _energy_self incorrect for scalar case

2 participants