Coverage for /usr/lib/python3/dist-packages/scipy/stats/_distr_params.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.9.1, created at 2025-06-14 15:55 +0200

1""" 

2Sane parameters for stats.distributions. 

3""" 

4import numpy as np 

5 

6distcont = [ 

7 ['alpha', (3.5704770516650459,)], 

8 ['anglit', ()], 

9 ['arcsine', ()], 

10 ['argus', (1.0,)], 

11 ['beta', (2.3098496451481823, 0.62687954300963677)], 

12 ['betaprime', (5, 6)], 

13 ['bradford', (0.29891359763170633,)], 

14 ['burr', (10.5, 4.3)], 

15 ['burr12', (10, 4)], 

16 ['cauchy', ()], 

17 ['chi', (78,)], 

18 ['chi2', (55,)], 

19 ['cosine', ()], 

20 ['crystalball', (2.0, 3.0)], 

21 ['dgamma', (1.1023326088288166,)], 

22 ['dweibull', (2.0685080649914673,)], 

23 ['erlang', (10,)], 

24 ['expon', ()], 

25 ['exponnorm', (1.5,)], 

26 ['exponpow', (2.697119160358469,)], 

27 ['exponweib', (2.8923945291034436, 1.9505288745913174)], 

28 ['f', (29, 18)], 

29 ['fatiguelife', (29,)], # correction numargs = 1 

30 ['fisk', (3.0857548622253179,)], 

31 ['foldcauchy', (4.7164673455831894,)], 

32 ['foldnorm', (1.9521253373555869,)], 

33 ['gamma', (1.9932305483800778,)], 

34 ['gausshyper', (13.763771604130699, 3.1189636648681431, 

35 2.5145980350183019, 5.1811649903971615)], # veryslow 

36 ['genexpon', (9.1325976465418908, 16.231956600590632, 3.2819552690843983)], 

37 ['genextreme', (-0.1,)], 

38 ['gengamma', (4.4162385429431925, 3.1193091679242761)], 

39 ['gengamma', (4.4162385429431925, -3.1193091679242761)], 

40 ['genhalflogistic', (0.77274727809929322,)], 

41 ['genhyperbolic', (0.5, 1.5, -0.5,)], 

42 ['geninvgauss', (2.3, 1.5)], 

43 ['genlogistic', (0.41192440799679475,)], 

44 ['gennorm', (1.2988442399460265,)], 

45 ['halfgennorm', (0.6748054997000371,)], 

46 ['genpareto', (0.1,)], # use case with finite moments 

47 ['gibrat', ()], 

48 ['gompertz', (0.94743713075105251,)], 

49 ['gumbel_l', ()], 

50 ['gumbel_r', ()], 

51 ['halfcauchy', ()], 

52 ['halflogistic', ()], 

53 ['halfnorm', ()], 

54 ['hypsecant', ()], 

55 ['invgamma', (4.0668996136993067,)], 

56 ['invgauss', (0.14546264555347513,)], 

57 ['invweibull', (10.58,)], 

58 ['johnsonsb', (4.3172675099141058, 3.1837781130785063)], 

59 ['johnsonsu', (2.554395574161155, 2.2482281679651965)], 

60 ['kappa4', (0.0, 0.0)], 

61 ['kappa4', (-0.1, 0.1)], 

62 ['kappa4', (0.0, 0.1)], 

63 ['kappa4', (0.1, 0.0)], 

64 ['kappa3', (1.0,)], 

65 ['ksone', (1000,)], # replace 22 by 100 to avoid failing range, ticket 956 

66 ['kstwo', (10,)], 

67 ['kstwobign', ()], 

68 ['laplace', ()], 

69 ['laplace_asymmetric', (2,)], 

70 ['levy', ()], 

71 ['levy_l', ()], 

72 ['levy_stable', (1.8, -0.5)], 

73 ['loggamma', (0.41411931826052117,)], 

74 ['logistic', ()], 

75 ['loglaplace', (3.2505926592051435,)], 

76 ['lognorm', (0.95368226960575331,)], 

77 ['loguniform', (0.01, 1.25)], 

78 ['lomax', (1.8771398388773268,)], 

79 ['maxwell', ()], 

80 ['mielke', (10.4, 4.6)], 

81 ['moyal', ()], 

82 ['nakagami', (4.9673794866666237,)], 

83 ['ncf', (27, 27, 0.41578441799226107)], 

84 ['nct', (14, 0.24045031331198066)], 

85 ['ncx2', (21, 1.0560465975116415)], 

86 ['norm', ()], 

87 ['norminvgauss', (1.25, 0.5)], 

88 ['pareto', (2.621716532144454,)], 

89 ['pearson3', (0.1,)], 

90 ['pearson3', (-2,)], 

91 ['powerlaw', (1.6591133289905851,)], 

92 ['powerlaw', (0.6591133289905851,)], 

93 ['powerlognorm', (2.1413923530064087, 0.44639540782048337)], 

94 ['powernorm', (4.4453652254590779,)], 

95 ['rayleigh', ()], 

96 ['rdist', (1.6,)], 

97 ['recipinvgauss', (0.63004267809369119,)], 

98 ['reciprocal', (0.01, 1.25)], 

99 ['rel_breitwigner', (36.545206797050334, )], 

100 ['rice', (0.7749725210111873,)], 

101 ['semicircular', ()], 

102 ['skewcauchy', (0.5,)], 

103 ['skewnorm', (4.0,)], 

104 ['studentized_range', (3.0, 10.0)], 

105 ['t', (2.7433514990818093,)], 

106 ['trapezoid', (0.2, 0.8)], 

107 ['triang', (0.15785029824528218,)], 

108 ['truncexpon', (4.6907725456810478,)], 

109 ['truncnorm', (-1.0978730080013919, 2.7306754109031979)], 

110 ['truncnorm', (0.1, 2.)], 

111 ['truncpareto', (1.8, 5.3)], 

112 ['truncweibull_min', (2.5, 0.25, 1.75)], 

113 ['tukeylambda', (3.1321477856738267,)], 

114 ['uniform', ()], 

115 ['vonmises', (3.9939042581071398,)], 

116 ['vonmises_line', (3.9939042581071398,)], 

117 ['wald', ()], 

118 ['weibull_max', (2.8687961709100187,)], 

119 ['weibull_min', (1.7866166930421596,)], 

120 ['wrapcauchy', (0.031071279018614728,)]] 

121 

122 

123distdiscrete = [ 

124 ['bernoulli',(0.3,)], 

125 ['betabinom', (5, 2.3, 0.63)], 

126 ['binom', (5, 0.4)], 

127 ['boltzmann',(1.4, 19)], 

128 ['dlaplace', (0.8,)], # 0.5 

129 ['geom', (0.5,)], 

130 ['hypergeom',(30, 12, 6)], 

131 ['hypergeom',(21,3,12)], # numpy.random (3,18,12) numpy ticket:921 

132 ['hypergeom',(21,18,11)], # numpy.random (18,3,11) numpy ticket:921 

133 ['nchypergeom_fisher', (140, 80, 60, 0.5)], 

134 ['nchypergeom_wallenius', (140, 80, 60, 0.5)], 

135 ['logser', (0.6,)], # re-enabled, numpy ticket:921 

136 ['nbinom', (0.4, 0.4)], # from tickets: 583 

137 ['nbinom', (5, 0.5)], 

138 ['planck', (0.51,)], # 4.1 

139 ['poisson', (0.6,)], 

140 ['randint', (7, 31)], 

141 ['skellam', (15, 8)], 

142 ['zipf', (6.5,)], 

143 ['zipfian', (0.75, 15)], 

144 ['zipfian', (1.25, 10)], 

145 ['yulesimon', (11.0,)], 

146 ['nhypergeom', (20, 7, 1)] 

147] 

148 

149 

150invdistdiscrete = [ 

151 # In each of the following, at least one shape parameter is invalid 

152 ['hypergeom', (3, 3, 4)], 

153 ['nhypergeom', (5, 2, 8)], 

154 ['nchypergeom_fisher', (3, 3, 4, 1)], 

155 ['nchypergeom_wallenius', (3, 3, 4, 1)], 

156 ['bernoulli', (1.5, )], 

157 ['binom', (10, 1.5)], 

158 ['betabinom', (10, -0.4, -0.5)], 

159 ['boltzmann', (-1, 4)], 

160 ['dlaplace', (-0.5, )], 

161 ['geom', (1.5, )], 

162 ['logser', (1.5, )], 

163 ['nbinom', (10, 1.5)], 

164 ['planck', (-0.5, )], 

165 ['poisson', (-0.5, )], 

166 ['randint', (5, 2)], 

167 ['skellam', (-5, -2)], 

168 ['zipf', (-2, )], 

169 ['yulesimon', (-2, )], 

170 ['zipfian', (-0.75, 15)] 

171] 

172 

173 

174invdistcont = [ 

175 # In each of the following, at least one shape parameter is invalid 

176 ['alpha', (-1, )], 

177 ['anglit', ()], 

178 ['arcsine', ()], 

179 ['argus', (-1, )], 

180 ['beta', (-2, 2)], 

181 ['betaprime', (-2, 2)], 

182 ['bradford', (-1, )], 

183 ['burr', (-1, 1)], 

184 ['burr12', (-1, 1)], 

185 ['cauchy', ()], 

186 ['chi', (-1, )], 

187 ['chi2', (-1, )], 

188 ['cosine', ()], 

189 ['crystalball', (-1, 2)], 

190 ['dgamma', (-1, )], 

191 ['dweibull', (-1, )], 

192 ['erlang', (-1, )], 

193 ['expon', ()], 

194 ['exponnorm', (-1, )], 

195 ['exponweib', (1, -1)], 

196 ['exponpow', (-1, )], 

197 ['f', (10, -10)], 

198 ['fatiguelife', (-1, )], 

199 ['fisk', (-1, )], 

200 ['foldcauchy', (-1, )], 

201 ['foldnorm', (-1, )], 

202 ['genlogistic', (-1, )], 

203 ['gennorm', (-1, )], 

204 ['genpareto', (np.inf, )], 

205 ['genexpon', (1, 2, -3)], 

206 ['genextreme', (np.inf, )], 

207 ['genhyperbolic', (0.5, -0.5, -1.5,)], 

208 ['gausshyper', (1, 2, 3, -4)], 

209 ['gamma', (-1, )], 

210 ['gengamma', (-1, 0)], 

211 ['genhalflogistic', (-1, )], 

212 ['geninvgauss', (1, 0)], 

213 ['gibrat', ()], 

214 ['gompertz', (-1, )], 

215 ['gumbel_r', ()], 

216 ['gumbel_l', ()], 

217 ['halfcauchy', ()], 

218 ['halflogistic', ()], 

219 ['halfnorm', ()], 

220 ['halfgennorm', (-1, )], 

221 ['hypsecant', ()], 

222 ['invgamma', (-1, )], 

223 ['invgauss', (-1, )], 

224 ['invweibull', (-1, )], 

225 ['johnsonsb', (1, -2)], 

226 ['johnsonsu', (1, -2)], 

227 ['kappa4', (np.nan, 0)], 

228 ['kappa3', (-1, )], 

229 ['ksone', (-1, )], 

230 ['kstwo', (-1, )], 

231 ['kstwobign', ()], 

232 ['laplace', ()], 

233 ['laplace_asymmetric', (-1, )], 

234 ['levy', ()], 

235 ['levy_l', ()], 

236 ['levy_stable', (-1, 1)], 

237 ['logistic', ()], 

238 ['loggamma', (-1, )], 

239 ['loglaplace', (-1, )], 

240 ['lognorm', (-1, )], 

241 ['loguniform', (10, 5)], 

242 ['lomax', (-1, )], 

243 ['maxwell', ()], 

244 ['mielke', (1, -2)], 

245 ['moyal', ()], 

246 ['nakagami', (-1, )], 

247 ['ncx2', (-1, 2)], 

248 ['ncf', (10, 20, -1)], 

249 ['nct', (-1, 2)], 

250 ['norm', ()], 

251 ['norminvgauss', (5, -10)], 

252 ['pareto', (-1, )], 

253 ['pearson3', (np.nan, )], 

254 ['powerlaw', (-1, )], 

255 ['powerlognorm', (1, -2)], 

256 ['powernorm', (-1, )], 

257 ['rdist', (-1, )], 

258 ['rayleigh', ()], 

259 ['rice', (-1, )], 

260 ['recipinvgauss', (-1, )], 

261 ['semicircular', ()], 

262 ['skewnorm', (np.inf, )], 

263 ['studentized_range', (-1, 1)], 

264 ['rel_breitwigner', (-2, )], 

265 ['t', (-1, )], 

266 ['trapezoid', (0, 2)], 

267 ['triang', (2, )], 

268 ['truncexpon', (-1, )], 

269 ['truncnorm', (10, 5)], 

270 ['truncpareto', (-1, 5)], 

271 ['truncpareto', (1.8, .5)], 

272 ['truncweibull_min', (-2.5, 0.25, 1.75)], 

273 ['tukeylambda', (np.nan, )], 

274 ['uniform', ()], 

275 ['vonmises', (-1, )], 

276 ['vonmises_line', (-1, )], 

277 ['wald', ()], 

278 ['weibull_min', (-1, )], 

279 ['weibull_max', (-1, )], 

280 ['wrapcauchy', (2, )], 

281 ['reciprocal', (15, 10)], 

282 ['skewcauchy', (2, )] 

283]