Skip to content

[ENH] Gamma Distribution#355

Merged
fkiraly merged 16 commits into
sktime:mainfrom
ShreeshaM07:gamma
May 24, 2024
Merged

[ENH] Gamma Distribution#355
fkiraly merged 16 commits into
sktime:mainfrom
ShreeshaM07:gamma

Conversation

@ShreeshaM07

Copy link
Copy Markdown
Contributor

What does this implement/fix? Explain your changes.

Implements Gamma distribution.

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

No

Did you add any tests for the change?

Yes

PR checklist

For all contributions
  • I've added myself to the list of contributors with any new badges I've earned :-)
    How to: add yourself to the all-contributors file in the skpro root directory (not the CONTRIBUTORS.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 plus code if you also fixed the bug in the PR).maintenance - CI, test framework, release.
    See here for full badge reference
  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG]. [BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
For new estimators
  • I've added the estimator to the API reference - in docs/source/api_reference/taskname.rst, follow the pattern.
  • I've added one or more illustrative usage examples to the docstring, in a pydocstyle compliant Examples section.
  • If the estimator relies on a soft dependency, I've set the python_dependencies tag and ensured
    dependency isolation, see the estimator dependencies guide.

@ShreeshaM07 ShreeshaM07 deleted the gamma branch May 23, 2024 12:33
@ShreeshaM07 ShreeshaM07 restored the gamma branch May 23, 2024 12:34
@ShreeshaM07 ShreeshaM07 deleted the gamma branch May 23, 2024 12:42
@ShreeshaM07 ShreeshaM07 reopened this May 23, 2024
Comment thread skpro/distributions/gamma.py Outdated
Comment on lines +20 to +21
where `\tau(\alpha)` is the Gamma function.
For all positive integers,`\tau(\alpha) = (alpha-1)!`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
where `\tau(\alpha)` is the Gamma function.
For all positive integers,`\tau(\alpha) = (alpha-1)!`.
where :math:`\tau(\alpha)` is the Gamma function.
For all positive integers, :math:`\tau(\alpha) = (\alpha-1)!`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Could you please be so kind to write the expression for the f(x) as well in this LaTex format I am not able to do it with trial and error, or maybe lead me to some resource that explains the usage.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

but f looks correct already - does it not compile to sth readable?

You can always test it by putting it in markdown, like this:

$f(x) = \frac{x^{\alpha-1}\exp\left(-\beta x\right)\beta^{\alpha}}{\tau(\alpha)}$

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

for some reason the expression is working when i use $$ in markdown here but it doesnt convert in readthedocs and instead if i use ..math:: neither here nor there it is readable.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm looking at the docs, it is perfectly readable for me:

image

@fkiraly fkiraly added enhancement module:probability&simulation probability distributions and simulators implementing algorithms Implementing algorithms, estimators, objects native to skpro labels May 23, 2024

@fkiraly fkiraly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me.

Typos in docstring should be fixed, though are not blocking.

@ShreeshaM07

Copy link
Copy Markdown
Contributor Author

Finally it works! please let me know if anything else needs to be done.

@fkiraly

fkiraly commented May 24, 2024

Copy link
Copy Markdown
Collaborator

oh, I see - you fixed it. Great!

@fkiraly fkiraly merged commit 3d0d334 into sktime:main May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement 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.

3 participants