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:stats: Add _isf method to lomax #18823

Merged
merged 4 commits into from Jul 5, 2023
Merged

Conversation

OmarManzoor
Copy link
Contributor

Reference issue

Towards: gh-17832

What does this implement/fix?

  • Adds the _isf method to the Lomax distribution in order to improve its precision.

Additional information

@OmarManzoor
Copy link
Contributor Author

Figure_1

from scipy.stats import lomax
import numpy as np
import matplotlib.pyplot as plt

def _isf(q, c):
    return q**(-1.0/c) - 1.0


def plot_isf():
    c = 2.0
    q = np.logspace(-40, -1, 1000)
    plt.semilogx(q, lomax.isf(q, c), label="main", ls="dashed")
    plt.semilogx(q, _isf(q, c), label="pr", ls="dotted")
    plt.legend()
    plt.title("lomax inverse survival function")
    plt.show()

@mdhaber
Copy link
Contributor

mdhaber commented Jul 5, 2023

This looks like it will be in good shape if it passes the new test.

@mdhaber
Copy link
Contributor

mdhaber commented Jul 5, 2023

But you need to add it to the list. That test is opt-in because so many distributions didn't pass it - even the ones that override _sf and _isf

@mdhaber mdhaber merged commit ad91cc3 into scipy:main Jul 5, 2023
24 checks passed
@OmarManzoor OmarManzoor deleted the lomax_isf branch July 6, 2023 04:49
alugowski pushed a commit to alugowski/scipy that referenced this pull request Jul 16, 2023
* ENH: stats.lomax._isf: override to extend domain
@mdhaber mdhaber added this to the 1.12.0 milestone Sep 11, 2023
@mdhaber mdhaber added the enhancement A new feature or improvement label Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement scipy.stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants