Skip to content

BUG: stats: spurious warning from ncf.cdf #17101

@WarrenWeckesser

Description

@WarrenWeckesser

Describe your issue.

When the shape parameters dfn and dfd of the ncf distribution are both 1.0 or both 2.0, ncf.cdf generates a spurious RuntimeWarning.

Reproducing Code Example

In [87]: import scipy

In [88]: scipy.__version__
Out[88]: '1.10.0.dev0+1953.3644066'

In [89]: from scipy.stats import ncf

In [90]: ncf.cdf(1.5, 2.0, 2.0, 1.0)
/home/warren/repos/git/forks/scipy/build-install/lib/python3.10/site-packages/scipy/stats/_continuous_distns.py:6587: RuntimeWarning: invalid value encountered in _ncf_cdf
  return _boost._ncf_cdf(x, dfn, dfd, nc)
Out[90]: 0.49123845184678905

The value is correct; the only problem is the spurious warning.

SciPy/NumPy/Python version information

1.10.0.dev0+1953.3644066 1.24.0.dev0+809.g852f79700 sys.version_info(major=3, minor=10, micro=1, releaselevel='final', serial=0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.stats

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions