[ENH] Rayleigh Distribution with analytical energy calculation#778
[ENH] Rayleigh Distribution with analytical energy calculation#778KaranSinghDev wants to merge 3 commits intosktime:mainfrom
Conversation
1d84788 to
fb234b4
Compare
|
I have updated the PR for the workflow failing earlier . |
fkiraly
left a comment
There was a problem hiding this comment.
Nice!
For exact energy tag, the cross-term is still missing, _energy_x - do you also have that, or do you leave that for now?
|
@fkiraly Yes I was working on the cross-term to make the energy tag fully exact. I have added the closed-form analytical solution for
I verified these formulas against scipy.integrate.quad across both negative and positive x |
fkiraly
left a comment
There was a problem hiding this comment.
Nice!
I think there does not exist a reference for these formulae, so it would be great if we could display them in docstrings.
For that, this PR (abandoned) needs to be fixed. Maybe if you have time, you could have a look, and then add your explicit formulae?
#698
Alternatively, there is already a markdown where we are collecting these, in the distributions folder, where you can add them.
|
@fkiraly Sure I will do it . |

Reference Issues/PRs
#22
What does this implement/fix? Explain your changes.
This PR implements a native, high-performance version of the Rayleigh Distribution (
skpro.distributions.Rayleigh).I have implemented the following analytical methods to bypass Monte Carlo and
_approx_derivativefallbacks:_pdfand_log_pdf-_cdfand_ppf(Inverse CDF) -_mean-_var-_energy_self:Does your contribution introduce a new dependency? If yes, which one?
No
What should a reviewer concentrate their feedback on?
Did you add any tests for the change?
I relied on existing distributions suite. I implemented get_test_params with multiple parameter sets (scalar, array, and DataFrame inputs). The Rayleigh class was picked up by the suite, passing 194 automated tests locally.
Any other comments?
I chose this distribution as I am aware of it and I have used it before in signal processing and believe it will be useful in the current list of distributions (even though it is low priority). I have also performed numerical verification against scipy.stats.rayleigh to ensure accuracy in the PDF, CDF, and Mean/Variance calculations.

PR checklist
For all contributions
How to: add yourself to the all-contributors file in the
skproroot directory (not theCONTRIBUTORS.md). Common badges:code- fixing a bug, or adding code logic.doc- writing or improving documentation or docstrings.bug- reporting or diagnosing a bug (get this pluscodeif you also fixed the bug in the PR).maintenance- CI, test framework, release.See here for full badge reference
For new estimators
docs/source/api_reference/taskname.rst, follow the pattern.Examplessection.python_dependenciestag and ensureddependency isolation, see the estimator dependencies guide.