GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 304d31...af78de )
by
unknown
10s
created

TestDirichlet._sample_postprocessing()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
1
# Copyright (c) 2014, Salesforce.com, Inc.  All rights reserved.
2
# Copyright (c) 2015, Gamelan Labs, Inc.
3
# Copyright (c) 2016, Google, Inc.
4
# Copyright (c) 2016, Gamelan Labs, Inc.
5
#
6
# Redistribution and use in source and binary forms, with or without
7
# modification, are permitted provided that the following conditions
8
# are met:
9
#
10
# - Redistributions of source code must retain the above copyright
11
#   notice, this list of conditions and the following disclaimer.
12
# - Redistributions in binary form must reproduce the above copyright
13
#   notice, this list of conditions and the following disclaimer in the
14
#   documentation and/or other materials provided with the distribution.
15
# - Neither the name of Salesforce.com nor the names of its contributors
16
#   may be used to endorse or promote products derived from this
17
#   software without specific prior written permission.
18
#
19
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
23
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
28
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
29
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
from __future__ import division
31
try:
32
    from itertools import izip as zip
33
except ImportError:
34
    pass
35
import random
36
from unittest import skip
37
from unittest import TestCase
38
39
import numpy
40
import scipy.stats
41
from numpy import pi
42
from numpy.testing import rand
43
44
from goftests import get_dim
45
from goftests import multinomial_goodness_of_fit
46
from goftests import discrete_goodness_of_fit
47
from goftests import auto_density_goodness_of_fit
48
from goftests import mixed_density_goodness_of_fit
49
from goftests import split_discrete_continuous
50
from goftests import volume_of_sphere
51
52
NUM_BASE_SAMPLES = 250
53
54
NUM_SAMPLES_SCALE = 1000
55
56
TEST_FAILURE_RATE = 5e-4
57
58
59
class TestMultinomialGoodnessOfFit(TestCase):
60
61
    def test_multinomial_goodness_of_fit(self):
62
        random.seed(0)
63
        numpy.random.seed(0)
64
        for dim in range(2, 20):
65
            sample_count = int(1e5)
66
            probs = numpy.random.dirichlet([1] * dim)
67
68
            counts = numpy.random.multinomial(sample_count, probs)
69
            p_good = multinomial_goodness_of_fit(probs, counts, sample_count)
70
            self.assertGreater(p_good, TEST_FAILURE_RATE)
71
72
            unif = [1 / dim] * dim
73
            unif_counts = numpy.random.multinomial(sample_count, unif)
74
            p_bad = multinomial_goodness_of_fit(probs, unif_counts,
75
                                                sample_count)
76
            self.assertLess(p_bad, TEST_FAILURE_RATE)
77
78
79
class TestVolumeOfSphere(TestCase):
80
81
    def test_volume_of_sphere(self):
82
        for r in [0.1, 1.0, 10.0]:
83
            self.assertAlmostEqual(volume_of_sphere(1, r), 2 * r)
84
            self.assertAlmostEqual(volume_of_sphere(2, r), pi * r ** 2)
85
            self.assertAlmostEqual(volume_of_sphere(3, r), 4 / 3 * pi * r ** 3)
86
87
88
SPLIT_EXAMPLES = [
89
    (False, False, []),
90
    (0, 0, []),
91
    ('abc', 'abc', []),
92
    (0.0, None, [0.0]),
93
    ((), (), []),
94
    ([], (), []),
95
    ((0, ), (0, ), []),
96
    ([0], (0, ), []),
97
    ((0.0, ), (None, ), [0.0]),
98
    ([0.0], (None, ), [0.0]),
99
    ([True, 1, 'xyz', 3.14, [None, (), ([2.71],)]],
100
     (True, 1, 'xyz', None, (None, (), ((None,),))),
101
     [3.14, 2.71]),
102
    (numpy.zeros(3), (None, None, None), [0.0, 0.0, 0.0]),
103
]
104
105
106
class TestSplitDiscreteContinuous(TestCase):
107
108
    def test_split_continuous_discrete(self):
109
        for mixed, discrete, continuous in SPLIT_EXAMPLES:
110
            d, c = split_discrete_continuous(mixed)
111
            self.assertEqual(d, discrete)
112
            self.assertAlmostEqual(c, continuous)
113
114
115
class DistributionTestBase(object):
116
    """Abstract base class for probability distribution unit tests.
117
118
    This class supplies two test methods, :meth:`.test_goodness_of_fit`
119
    and :meth:`.test_mixed_density_goodness_of_fit` for testing the
120
    goodness of fit functions.
121
122
    Subclasses must override and implement one class attribute and two
123
    instance methods. The :attr:`.dist` class attribute must be set to
124
    one of SciPy probability distribution constructors in
125
    :mod:`scipy.stats`. The :meth:`.goodness_of_fit` method must return
126
    the result of calling one of the goodness of fit functions being
127
    tested. The :meth:`.probabilites` method must return an object
128
    representing the probabilities for each sample; the output depends
129
    on the format of the inputs to the :meth:`.goodness_of_fit` method.
130
131
    Subclasses may also set the :attr:`.params` attribute, which is a
132
    list of tuples that will be provided as arguments to the underlying
133
    SciPy distribution constructor as specified in :attr:`.dist`. If not
134
    specified, random arguments will be provided.
135
136
    If samples drawn from :attr:`.dist` must be modified in some way
137
    before the PDF or PMF can be computed, then subclasses may override
138
    the :meth:`._sample_postprocessing` method.
139
140
    """
141
142
    #: The SciPy distribution constructor to test.
143
    dist = None
144
145
    #: An optional list of arguments to the distribution constructor.
146
    #:
147
    #: Each tuple in this list will be provided as the positional
148
    #: arguments to the distribution constructor specified in
149
    #: :attr:`.dist`. If not specified, random arguments will be
150
    #: provided.
151
    params = None
152
153
    def setUp(self):
154
        random.seed(0)
155
        numpy.random.seed(0)
156
157
    def _sample_postprocessing(self, sample):
158
        """Modify a sample drawn from the distribution.
159
160
        This method returns a modified version of `sample`, but that
161
        modification may be arbitrary. This modified sample is the one
162
        for which the PDF and the goodness-of-fit are computed.
163
164
        By default, this is a no-op, but subclasses may wish to override
165
        this method to modify sample in some way.
166
167
        """
168
        return sample
169
170
    def dist_params(self):
171
        # If there are no parameters, then we provide a random one.
172
        if self.params is None:
173
            params = [tuple(1 + rand(self.dist.numargs))]
174
        else:
175
            params = self.params
176
        return params
177
178 View Code Duplication
    def test_mixed_density_goodness_of_fit(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
179
        for param in self.dist_params():
180
            dim = get_dim(self.dist.rvs(*param, size=2)[0])
181
            sample_count = NUM_BASE_SAMPLES + NUM_SAMPLES_SCALE * dim
182
            samples = self.dist.rvs(*param, size=sample_count)
183
            samples = list(map(self._sample_postprocessing, samples))
184
            probabilities = [self.pdf(sample, *param) for sample in samples]
185
            gof = mixed_density_goodness_of_fit(samples, probabilities)
186
            self.assertGreater(gof, TEST_FAILURE_RATE)
187
188 View Code Duplication
    def test_good_fit(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
189
        for param in self.dist_params():
190
            dim = get_dim(self.dist.rvs(*param, size=2)[0])
191
            sample_count = NUM_BASE_SAMPLES + NUM_SAMPLES_SCALE * dim
192
            samples = self.dist.rvs(*param, size=sample_count)
193
            samples = list(map(self._sample_postprocessing, samples))
194
            probabilities = [self.pdf(sample, *param) for sample in samples]
195
            gof = self.goodness_of_fit(samples, probabilities)
196
            self.assertGreater(gof, TEST_FAILURE_RATE)
197
198
    def goodness_of_fit(self, samples, probabilities):
199
        raise NotImplementedError
200
201
202
class ContinuousTestBase(DistributionTestBase):
203
    """Abstract base class for testing continuous probability distributions.
204
205
    Concrete subclasses must set the :attr:`.dist` attribute to be the
206
    constructor for a continuous probability distribution.
207
208
    """
209
210
    def goodness_of_fit(self, samples, probabilities):
211
        gof = auto_density_goodness_of_fit(samples, probabilities)
212
        return gof
213
214
    def pdf(self, *args, **kw):
215
        return self.dist.pdf(*args, **kw)
216
217
218
class DiscreteTestBase(DistributionTestBase):
219
    """Abstract base class for testing discrete probability distributions.
220
221
    Concrete subclasses must set the :attr:`.dist` attribute to be the
222
    constructor for a discrete probability distribution.
223
224
    """
225
226
    def goodness_of_fit(self, samples, probabilities):
227
        probs_dict = dict(zip(samples, probabilities))
228
        gof = discrete_goodness_of_fit(samples, probs_dict)
229
        return gof
230
231
    def pdf(self, *args, **kw):
232
        return self.dist.pmf(*args, **kw)
233
234
235
#
236
# Multivariate probability distributions.
237
#
238
239
class TestMultivariateNormal(ContinuousTestBase, TestCase):
240
241
    dist = scipy.stats.multivariate_normal
242
243
    params = [
244
        (numpy.ones(1), numpy.eye(1)),
245
        (numpy.ones(2), numpy.eye(2)),
246
        (numpy.ones(3), numpy.eye(3)),
247
    ]
248
249
250
class TestDirichlet(ContinuousTestBase, TestCase):
251
252
    dist = scipy.stats.dirichlet
253
254
    params = [
255
        ([2.0, 2.5],),
256
        ([2.0, 2.5, 3.0],),
257
        ([2.0, 2.5, 3.0, 3.5],),
258
    ]
259
260
    def _sample_postprocessing(self, value):
261
        """Project onto all but the last dimension."""
262
        return value[:-1]
263
264
265
#
266
# Discrete probability distributions.
267
#
268
269
class TestBernoulli(DiscreteTestBase, TestCase):
270
271
    dist = scipy.stats.bernoulli
272
273
    params = [(0.2, )]
274
275
276
class TestBinomial(DiscreteTestBase, TestCase):
277
278
    dist = scipy.stats.binom
279
280
    params = [(40, 0.4)]
281
282
283
@skip('')
284
class TestBoltzmann(DiscreteTestBase, TestCase):
285
286
    dist = scipy.stats.boltzmann
287
288
289
class TestDiscreteLaplacian(DiscreteTestBase, TestCase):
290
291
    dist = scipy.stats.dlaplace
292
293
    params = [(0.8, )]
294
295
296
class TestGeometric(DiscreteTestBase, TestCase):
297
298
    dist = scipy.stats.geom
299
300
    params = [(0.1, )]
301
302
303
class TestHypergeometric(DiscreteTestBase, TestCase):
304
305
    dist = scipy.stats.hypergeom
306
307
    params = [(40, 14, 24)]
308
309
310
class TestLogSeries(DiscreteTestBase, TestCase):
311
312
    dist = scipy.stats.logser
313
314
    params = [(0.9, )]
315
316
317
class TestNegativeBinomial(DiscreteTestBase, TestCase):
318
319
    dist = scipy.stats.nbinom
320
321
    params = [(40, 0.4)]
322
323
324
class TestPlanck(DiscreteTestBase, TestCase):
325
326
    dist = scipy.stats.planck
327
328
    params = [(0.51, )]
329
330
331
class TestPoisson(DiscreteTestBase, TestCase):
332
333
    dist = scipy.stats.poisson
334
335
    params = [(20, )]
336
337
338
@skip('too sparse')
339
class TestRandInt(DiscreteTestBase, TestCase):
340
341
    dist = scipy.stats.randint
342
343
344
class TestSkellam(DiscreteTestBase, TestCase):
345
346
    dist = scipy.stats.skellam
347
348
349
@skip('bug?')
350
class TestZipf(DiscreteTestBase, TestCase):
351
352
    dist = scipy.stats.zipf
353
354
    params = [(1.2, )]
355
356
#
357
# Continuous probability distributions.
358
#
359
360
361
@skip('')
362
class TestAlpha(ContinuousTestBase, TestCase):
363
364
    dist = scipy.stats.alpha
365
366
367
class TestAnglit(ContinuousTestBase, TestCase):
368
369
    dist = scipy.stats.anglit
370
371
372
class TestArcsine(ContinuousTestBase, TestCase):
373
374
    dist = scipy.stats.arcsine
375
376
377
class TestBeta(ContinuousTestBase, TestCase):
378
379
    dist = scipy.stats.beta
380
381
    params = [
382
        (0.5, 0.5),
383
        (0.5, 1.5),
384
        (0.5, 2.5),
385
    ]
386
387
388
class TestBetaPrime(ContinuousTestBase, TestCase):
389
390
    dist = scipy.stats.betaprime
391
392
393
class TestBradford(ContinuousTestBase, TestCase):
394
395
    dist = scipy.stats.bradford
396
397
398
class TestBurr(ContinuousTestBase, TestCase):
399
400
    dist = scipy.stats.burr
401
402
403
class TestCauchy(ContinuousTestBase, TestCase):
404
405
    dist = scipy.stats.cauchy
406
407
408
class TestChi(ContinuousTestBase, TestCase):
409
410
    dist = scipy.stats.chi
411
412
413
class TestChiSquared(ContinuousTestBase, TestCase):
414
415
    dist = scipy.stats.chi2
416
417
418
class TestCosine(ContinuousTestBase, TestCase):
419
420
    dist = scipy.stats.cosine
421
422
423
class TestDoubleGamma(ContinuousTestBase, TestCase):
424
425
    dist = scipy.stats.dgamma
426
427
428
class TestDoubleWeibull(ContinuousTestBase, TestCase):
429
430
    dist = scipy.stats.dweibull
431
432
433
class TestErlang(ContinuousTestBase, TestCase):
434
435
    dist = scipy.stats.erlang
436
437
    params = [(7, )]
438
439
440
class TestExponential(ContinuousTestBase, TestCase):
441
442
    dist = scipy.stats.expon
443
444
    params = [(7, )]
445
446
447
class TestExponentiallyModifiedNormal(ContinuousTestBase, TestCase):
448
449
    dist = scipy.stats.exponnorm
450
451
452
class TestExponentiatedWeibull(ContinuousTestBase, TestCase):
453
454
    dist = scipy.stats.exponweib
455
456
457
class TestExponentialPower(ContinuousTestBase, TestCase):
458
459
    dist = scipy.stats.exponpow
460
461
462
class TestF(ContinuousTestBase, TestCase):
463
464
    dist = scipy.stats.f
465
466
467
class TestFatigueLife(ContinuousTestBase, TestCase):
468
469
    dist = scipy.stats.fatiguelife
470
471
472
class TestFisk(ContinuousTestBase, TestCase):
473
474
    dist = scipy.stats.fisk
475
476
477
class TestFoldedCauchy(ContinuousTestBase, TestCase):
478
479
    dist = scipy.stats.foldcauchy
480
481
482
class TestFoldedNormal(ContinuousTestBase, TestCase):
483
484
    dist = scipy.stats.foldnorm
485
486
487
class TestFrechetRight(ContinuousTestBase, TestCase):
488
489
    dist = scipy.stats.frechet_r
490
491
492
class TestFrechetLeft(ContinuousTestBase, TestCase):
493
494
    dist = scipy.stats.frechet_l
495
496
497
class TestGeneralizedLogistic(ContinuousTestBase, TestCase):
498
499
    dist = scipy.stats.genlogistic
500
501
502
class TestGeneralizedNormal(ContinuousTestBase, TestCase):
503
504
    dist = scipy.stats.gennorm
505
506
507
class TestGeneralizedPareto(ContinuousTestBase, TestCase):
508
509
    dist = scipy.stats.genpareto
510
511
512
class TestGeneralizedExponential(ContinuousTestBase, TestCase):
513
514
    dist = scipy.stats.genexpon
515
516
517
class TestGeneralizedExtreme(ContinuousTestBase, TestCase):
518
519
    dist = scipy.stats.genextreme
520
521
522
@skip('very slow')
523
class TestGaussHypergeometric(ContinuousTestBase, TestCase):
524
525
    dist = scipy.stats.gausshyper
526
527
528
class TestGamma(ContinuousTestBase, TestCase):
529
530
    dist = scipy.stats.gamma
531
532
533
class TestGeneralizedGamma(ContinuousTestBase, TestCase):
534
535
    dist = scipy.stats.gengamma
536
537
538
class TestGeneralizedHalfLogistic(ContinuousTestBase, TestCase):
539
540
    dist = scipy.stats.genhalflogistic
541
542
543
class TestGilbrat(ContinuousTestBase, TestCase):
544
545
    dist = scipy.stats.gilbrat
546
547
548
class TestGompertz(ContinuousTestBase, TestCase):
549
550
    dist = scipy.stats.gompertz
551
552
553
class TestGumbelRight(ContinuousTestBase, TestCase):
554
555
    dist = scipy.stats.gumbel_r
556
557
558
class TestGumbelLeft(ContinuousTestBase, TestCase):
559
560
    dist = scipy.stats.gumbel_l
561
562
563
class TestHalfCauchy(ContinuousTestBase, TestCase):
564
565
    dist = scipy.stats.halfcauchy
566
567
568
class TestHalfLogistic(ContinuousTestBase, TestCase):
569
570
    dist = scipy.stats.halflogistic
571
572
573
class TestHalfNormal(ContinuousTestBase, TestCase):
574
575
    dist = scipy.stats.halfnorm
576
577
578
class TestHalfGeneralizedNormal(ContinuousTestBase, TestCase):
579
580
    dist = scipy.stats.halfgennorm
581
582
583
class TestHyperbolicSecant(ContinuousTestBase, TestCase):
584
585
    dist = scipy.stats.hypsecant
586
587
588
class TestInverseGamma(ContinuousTestBase, TestCase):
589
590
    dist = scipy.stats.invgamma
591
592
593
class TestInverseGauss(ContinuousTestBase, TestCase):
594
595
    dist = scipy.stats.invgauss
596
597
598
class TestInverseWeibull(ContinuousTestBase, TestCase):
599
600
    dist = scipy.stats.invweibull
601
602
603
class TestJohnsonSB(ContinuousTestBase, TestCase):
604
605
    dist = scipy.stats.johnsonsb
606
607
608
class TestJohnsonSU(ContinuousTestBase, TestCase):
609
610
    dist = scipy.stats.johnsonsu
611
612
613
@skip('???')
614
class TestKolmogorovSmirnovOneSided(ContinuousTestBase, TestCase):
615
616
    dist = scipy.stats.ksone
617
618
619
class TestKolmogorovSmirnovTwoSided(ContinuousTestBase, TestCase):
620
621
    dist = scipy.stats.kstwobign
622
623
624
class TestLaplace(ContinuousTestBase, TestCase):
625
626
    dist = scipy.stats.laplace
627
628
629
class TestLevy(ContinuousTestBase, TestCase):
630
631
    dist = scipy.stats.levy
632
633
634
class TestLeftSkewedLevy(ContinuousTestBase, TestCase):
635
636
    dist = scipy.stats.levy_l
637
638
639
@skip('???')
640
class TestLevyStable(ContinuousTestBase, TestCase):
641
642
    dist = scipy.stats.levy_stable
643
644
645
class TestLogistic(ContinuousTestBase, TestCase):
646
647
    dist = scipy.stats.logistic
648
649
650
class TestLogGamma(ContinuousTestBase, TestCase):
651
652
    dist = scipy.stats.loggamma
653
654
655
class TestLogLaplace(ContinuousTestBase, TestCase):
656
657
    dist = scipy.stats.loglaplace
658
659
660
class TestLogNormal(ContinuousTestBase, TestCase):
661
662
    dist = scipy.stats.lognorm
663
664
665
class TestLomax(ContinuousTestBase, TestCase):
666
667
    dist = scipy.stats.lomax
668
669
670
class TestMaxwell(ContinuousTestBase, TestCase):
671
672
    dist = scipy.stats.maxwell
673
674
675
class TestMielke(ContinuousTestBase, TestCase):
676
677
    dist = scipy.stats.mielke
678
679
680
class TestNakagami(ContinuousTestBase, TestCase):
681
682
    dist = scipy.stats.nakagami
683
684
685
class TestNonCentralChiSquared(ContinuousTestBase, TestCase):
686
687
    dist = scipy.stats.ncx2
688
689
690
class TestNonCentralF(ContinuousTestBase, TestCase):
691
692
    dist = scipy.stats.ncf
693
694
    params = [(27, 27, 0.415784417992)]
695
696
697
class TestNonCentralT(ContinuousTestBase, TestCase):
698
699
    dist = scipy.stats.nct
700
701
702
class TestNormal(ContinuousTestBase, TestCase):
703
704
    dist = scipy.stats.norm
705
706
707
class TestPareto(ContinuousTestBase, TestCase):
708
709
    dist = scipy.stats.pareto
710
711
712
class TestPearson3(ContinuousTestBase, TestCase):
713
714
    dist = scipy.stats.pearson3
715
716
717
class TestPowerLaw(ContinuousTestBase, TestCase):
718
719
    dist = scipy.stats.powerlaw
720
721
722
class TestPowerNormal(ContinuousTestBase, TestCase):
723
724
    dist = scipy.stats.powernorm
725
726
727
class TestRDistributed(ContinuousTestBase, TestCase):
728
729
    dist = scipy.stats.rdist
730
731
732
class TestReciprocal(ContinuousTestBase, TestCase):
733
734
    dist = scipy.stats.reciprocal
735
736
    params = [tuple(numpy.array([0, 1]) + rand(1)[0])]
737
738
739
class TestRayleigh(ContinuousTestBase, TestCase):
740
741
    dist = scipy.stats.rayleigh
742
743
744
class TestRice(ContinuousTestBase, TestCase):
745
746
    dist = scipy.stats.rice
747
748
749
class TestReciprocalInverseGaussian(ContinuousTestBase, TestCase):
750
751
    dist = scipy.stats.recipinvgauss
752
753
754
class TestSemicircular(ContinuousTestBase, TestCase):
755
756
    dist = scipy.stats.semicircular
757
758
759
class TestT(ContinuousTestBase, TestCase):
760
761
    dist = scipy.stats.t
762
763
764
class TestTrapz(ContinuousTestBase, TestCase):
765
766
    dist = scipy.stats.trapz
767
768
    params = [(1 / 3, 2 / 3)]
769
770
771
class TestTriangular(ContinuousTestBase, TestCase):
772
773
    dist = scipy.stats.triang
774
775
    params = [tuple(rand(1))]
776
777
778
class TestTruncatedExponential(ContinuousTestBase, TestCase):
779
780
    dist = scipy.stats.truncexpon
781
782
783
class TestTruncatedNormal(ContinuousTestBase, TestCase):
784
785
    dist = scipy.stats.truncnorm
786
787
    params = [(0.1, 2.0)]
788
789
790
class TestTukeyLambda(ContinuousTestBase, TestCase):
791
792
    dist = scipy.stats.tukeylambda
793
794
795
class TestUniform(ContinuousTestBase, TestCase):
796
797
    dist = scipy.stats.uniform
798
799
800
class TestVonMises(ContinuousTestBase, TestCase):
801
802
    dist = scipy.stats.vonmises
803
804
    params = [tuple(1.0 + rand(1))]
805
806
807
class TestVonMisesLine(ContinuousTestBase, TestCase):
808
809
    dist = scipy.stats.vonmises_line
810
811
812
class TestWald(ContinuousTestBase, TestCase):
813
814
    dist = scipy.stats.wald
815
816
817
class TestWeibullMin(ContinuousTestBase, TestCase):
818
819
    dist = scipy.stats.weibull_min
820
821
822
class TestWeibullMax(ContinuousTestBase, TestCase):
823
824
    dist = scipy.stats.weibull_max
825
826
827
class TestWrappedCauchy(ContinuousTestBase, TestCase):
828
829
    dist = scipy.stats.wrapcauchy
830
831
    params = [(0.5,)]
832