@@ -689,14 +689,11 @@ def _sf(self, x, a, b):
689
689
return _boost ._beta_sf (x , a , b )
690
690
691
691
def _isf (self , x , a , b ):
692
- with warnings .catch_warnings ():
693
- # See gh-14901
694
- message = "overflow encountered in _beta_isf"
695
- warnings .filterwarnings ('ignore' , message = message )
692
+ with np .errstate (over = 'ignore' ): # see gh-17432
696
693
return _boost ._beta_isf (x , a , b )
697
694
698
695
def _ppf (self , q , a , b ):
699
- with warnings . catch_warnings ():
696
+ with np . errstate ( over = 'ignore' ): # see gh-17432
700
697
message = "overflow encountered in _beta_ppf"
701
698
warnings .filterwarnings ('ignore' , message = message )
702
699
return _boost ._beta_ppf (q , a , b )
@@ -6765,35 +6762,31 @@ def _logpdf(self, x, df, nc):
6765
6762
6766
6763
def _pdf (self , x , df , nc ):
6767
6764
cond = np .ones_like (x , dtype = bool ) & (nc != 0 )
6768
- with warnings .catch_warnings ():
6769
- message = "overflow encountered in _ncx2_pdf"
6770
- warnings .filterwarnings ("ignore" , message = message )
6765
+ with np .errstate (over = 'ignore' ): # see gh-17432
6771
6766
return _lazywhere (cond , (x , df , nc ), f = _boost ._ncx2_pdf ,
6772
6767
f2 = lambda x , df , _ : chi2 ._pdf (x , df ))
6773
6768
6774
6769
def _cdf (self , x , df , nc ):
6775
6770
cond = np .ones_like (x , dtype = bool ) & (nc != 0 )
6776
- return _lazywhere (cond , (x , df , nc ), f = _boost ._ncx2_cdf ,
6777
- f2 = lambda x , df , _ : chi2 ._cdf (x , df ))
6771
+ with np .errstate (over = 'ignore' ): # see gh-17432
6772
+ return _lazywhere (cond , (x , df , nc ), f = _boost ._ncx2_cdf ,
6773
+ f2 = lambda x , df , _ : chi2 ._cdf (x , df ))
6778
6774
6779
6775
def _ppf (self , q , df , nc ):
6780
6776
cond = np .ones_like (q , dtype = bool ) & (nc != 0 )
6781
- with warnings .catch_warnings ():
6782
- message = "overflow encountered in _ncx2_ppf"
6783
- warnings .filterwarnings ("ignore" , message = message )
6777
+ with np .errstate (over = 'ignore' ): # see gh-17432
6784
6778
return _lazywhere (cond , (q , df , nc ), f = _boost ._ncx2_ppf ,
6785
6779
f2 = lambda x , df , _ : chi2 ._ppf (x , df ))
6786
6780
6787
6781
def _sf (self , x , df , nc ):
6788
6782
cond = np .ones_like (x , dtype = bool ) & (nc != 0 )
6789
- return _lazywhere (cond , (x , df , nc ), f = _boost ._ncx2_sf ,
6790
- f2 = lambda x , df , _ : chi2 ._sf (x , df ))
6783
+ with np .errstate (over = 'ignore' ): # see gh-17432
6784
+ return _lazywhere (cond , (x , df , nc ), f = _boost ._ncx2_sf ,
6785
+ f2 = lambda x , df , _ : chi2 ._sf (x , df ))
6791
6786
6792
6787
def _isf (self , x , df , nc ):
6793
6788
cond = np .ones_like (x , dtype = bool ) & (nc != 0 )
6794
- with warnings .catch_warnings ():
6795
- message = "overflow encountered in _ncx2_isf"
6796
- warnings .filterwarnings ("ignore" , message = message )
6789
+ with np .errstate (over = 'ignore' ): # see gh-17432
6797
6790
return _lazywhere (cond , (x , df , nc ), f = _boost ._ncx2_isf ,
6798
6791
f2 = lambda x , df , _ : chi2 ._isf (x , df ))
6799
6792
@@ -6875,13 +6868,15 @@ def _cdf(self, x, dfn, dfd, nc):
6875
6868
return _boost ._ncf_cdf (x , dfn , dfd , nc )
6876
6869
6877
6870
def _ppf (self , q , dfn , dfd , nc ):
6878
- return _boost ._ncf_ppf (q , dfn , dfd , nc )
6871
+ with np .errstate (over = 'ignore' ): # see gh-17432
6872
+ return _boost ._ncf_ppf (q , dfn , dfd , nc )
6879
6873
6880
6874
def _sf (self , x , dfn , dfd , nc ):
6881
6875
return _boost ._ncf_sf (x , dfn , dfd , nc )
6882
6876
6883
6877
def _isf (self , x , dfn , dfd , nc ):
6884
- return _boost ._ncf_isf (x , dfn , dfd , nc )
6878
+ with np .errstate (over = 'ignore' ): # see gh-17432
6879
+ return _boost ._ncf_isf (x , dfn , dfd , nc )
6885
6880
6886
6881
def _munp (self , n , dfn , dfd , nc ):
6887
6882
val = (dfn * 1.0 / dfd )** n
@@ -7068,22 +7063,26 @@ def _pdf(self, x, df, nc):
7068
7063
return np .clip (Px , 0 , None )
7069
7064
7070
7065
def _cdf (self , x , df , nc ):
7071
- return np .clip (_boost ._nct_cdf (x , df , nc ), 0 , 1 )
7066
+ with np .errstate (over = 'ignore' ): # see gh-17432
7067
+ return np .clip (_boost ._nct_cdf (x , df , nc ), 0 , 1 )
7072
7068
7073
7069
def _ppf (self , q , df , nc ):
7074
- return _boost ._nct_ppf (q , df , nc )
7070
+ with np .errstate (over = 'ignore' ): # see gh-17432
7071
+ return _boost ._nct_ppf (q , df , nc )
7075
7072
7076
7073
def _sf (self , x , df , nc ):
7077
- return np .clip (_boost ._nct_sf (x , df , nc ), 0 , 1 )
7074
+ with np .errstate (over = 'ignore' ): # see gh-17432
7075
+ return np .clip (_boost ._nct_sf (x , df , nc ), 0 , 1 )
7078
7076
7079
7077
def _isf (self , x , df , nc ):
7080
- return _boost ._nct_isf (x , df , nc )
7078
+ with np .errstate (over = 'ignore' ): # see gh-17432
7079
+ return _boost ._nct_isf (x , df , nc )
7081
7080
7082
7081
def _stats (self , df , nc , moments = 'mv' ):
7083
7082
mu = _boost ._nct_mean (df , nc )
7084
7083
mu2 = _boost ._nct_variance (df , nc )
7085
7084
g1 = _boost ._nct_skewness (df , nc ) if 's' in moments else None
7086
- g2 = _boost ._nct_kurtosis_excess (df , nc )- 3 if 'k' in moments else None
7085
+ g2 = _boost ._nct_kurtosis_excess (df , nc ) if 'k' in moments else None
7087
7086
return mu , mu2 , g1 , g2
7088
7087
7089
7088
0 commit comments