@@ -120,94 +120,124 @@ def check_shape(rv, size=None, expected=None):
120
120
class ScalarParameterShape (unittest .TestCase ):
121
121
122
122
def check (self , dist , ** kwargs ):
123
+ nr .seed (20090425 )
123
124
test_cases = [(None , (1 ,)), (5 , (5 ,)), ((4 , 5 ), (4 , 5 ))]
124
125
check_dist ((dist , kwargs ), test_cases )
125
126
126
127
def test_normal (self ):
128
+ nr .seed (20090425 )
127
129
self .check (Normal , mu = 0. , tau = 1. )
128
130
129
131
def test_uniform (self ):
132
+ nr .seed (20090425 )
130
133
self .check (Uniform , lower = 0. , upper = 1. )
131
134
132
135
def test_half_normal (self ):
136
+ nr .seed (20090425 )
133
137
self .check (HalfNormal , tau = 1. )
134
138
135
139
def test_wald (self ):
140
+ nr .seed (20090425 )
136
141
self .check (Wald , mu = 1. , lam = 1. , alpha = 0. )
137
142
138
143
def test_beta (self ):
144
+ nr .seed (20090425 )
139
145
self .check (Beta , alpha = 1. , beta = 1. )
140
146
141
147
def test_exponential (self ):
148
+ nr .seed (20090425 )
142
149
self .check (Exponential , lam = 1. )
143
150
144
151
def test_laplace (self ):
152
+ nr .seed (20090425 )
145
153
self .check (Laplace , mu = 1. , b = 1 )
146
154
147
155
def test_lognormal (self ):
156
+ nr .seed (20090425 )
148
157
self .check (Lognormal , mu = 1. , tau = 1. )
149
158
150
159
def test_student_t (self ):
160
+ nr .seed (20090425 )
151
161
self .check (StudentT , nu = 5 , mu = 0. , lam = 1. )
152
162
153
163
def test_pareto (self ):
164
+ nr .seed (20090425 )
154
165
self .check (Pareto , alpha = 0.5 , m = 1. )
155
166
156
167
def test_cauchy (self ):
168
+ nr .seed (20090425 )
157
169
self .check (Cauchy , alpha = 1. , beta = 1. )
158
170
159
171
def test_half_cauchy (self ):
172
+ nr .seed (20090425 )
160
173
self .check (HalfCauchy , beta = 1. )
161
174
162
175
def test_gamma (self ):
176
+ nr .seed (20090425 )
163
177
self .check (Gamma , alpha = 1. , beta = 1. )
164
178
165
179
def test_inverse_gamma (self ):
180
+ nr .seed (20090425 )
166
181
self .check (InverseGamma , alpha = 0.5 , beta = 0.5 )
167
182
168
183
def test_chi_squared (self ):
184
+ nr .seed (20090425 )
169
185
self .check (ChiSquared , nu = 2 )
170
186
171
187
def test_weibull (self ):
188
+ nr .seed (20090425 )
172
189
self .check (Weibull , alpha = 1. , beta = 1. )
173
190
174
191
def test_ex_gaussian (self ):
192
+ nr .seed (20090425 )
175
193
self .check (ExGaussian , mu = 0. , sigma = 1. , nu = 1. )
176
194
177
195
def test_vonmises (self ):
196
+ nr .seed (20090425 )
178
197
self .check (VonMises , mu = 0. , kappa = 1. )
179
198
180
199
def test_binomial (self ):
200
+ nr .seed (20090425 )
181
201
self .check (Binomial , n = 5 , p = 0.5 )
182
202
183
203
def test_beta_binomial (self ):
204
+ nr .seed (20090425 )
184
205
self .check (BetaBinomial , alpha = 1. , beta = 1. , n = 1 )
185
206
186
207
def test_bernoulli (self ):
208
+ nr .seed (20090425 )
187
209
self .check (Bernoulli , p = 0.5 )
188
210
189
211
def test_poisson (self ):
212
+ nr .seed (20090425 )
190
213
self .check (Poisson , mu = 1. )
191
214
192
215
def test_negative_binomial (self ):
216
+ nr .seed (20090425 )
193
217
self .check (NegativeBinomial , mu = 1. , alpha = 1. )
194
218
195
219
def test_constant_dist (self ):
220
+ nr .seed (20090425 )
196
221
self .check (ConstantDist , c = 3 )
197
222
198
223
def test_zero_inflated_poisson (self ):
224
+ nr .seed (20090425 )
199
225
self .check (ZeroInflatedPoisson , theta = 1 , psi = 0.3 )
200
226
201
227
def test_zero_inflated_negative_binomial (self ):
228
+ nr .seed (20090425 )
202
229
self .check (ZeroInflatedNegativeBinomial , mu = 1. , alpha = 1. , psi = 0.3 )
203
230
204
231
def test_discrete_uniform (self ):
232
+ nr .seed (20090425 )
205
233
self .check (DiscreteUniform , lower = 0. , upper = 10 )
206
234
207
235
def test_geometric (self ):
236
+ nr .seed (20090425 )
208
237
self .check (Geometric , p = 0.5 )
209
238
210
239
def test_categorical (self ):
240
+ nr .seed (20090425 )
211
241
self .check (Categorical , p = np .array ([0.2 , 0.3 , 0.5 ]))
212
242
213
243
0 commit comments