Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 696abb44 by Dahua Lin

### Refactor tests

```Original tests in test/distributions.jl has been dispatched to
test/categorical.jl, test/univariate.jl, and test/multivariate.jl.

Contents test/univariate.jl are re-organized to make it easier to

Add tests for a variety of vectorized evaluation functions.```
parent a99c73b0
 tests = [ "distributions", "utils", "fit", "categorical", "truncate", "univariate", "multivariate", ... ...
 ... ... @@ -26,8 +26,9 @@ export # types Binomial, Categorical, Cauchy, Chi, Chisq, # Cosine, Cosine, Dirichlet, DiscreteUniform, DoubleExponential, ... ...
 immutable Chi <: ContinuousUnivariateDistribution df::Float64 Chi(df::Real) = new(float64(df)) end cdf(d::Chi, x::Real) = regularized_gamma(d.df / 2.0, x^2 / 2.0) ... ...
 ... ... @@ -16,7 +16,7 @@ DiscreteUniform() = DiscreteUniform(0, 1) function cdf(d::DiscreteUniform, k::Real) if k < d.a return 0.0 elseif <= d.b elseif k <= d.b return (ifloor(k) - d.a + 1.0) / (d.b - d.a + 1.0) else return 1.0 ... ...
 using Distributions using Base.Test d = Categorical([0.25, 0.5, 0.25]) d = Categorical(3) d = Categorical([0.25, 0.5, 0.25]) @test !insupport(d, 0) @test insupport(d, 1) @test insupport(d, 2) @test insupport(d, 3) @test !insupport(d, 4) @test logpmf(d, 1) == log(0.25) @test pmf(d, 1) == 0.25 @test logpmf(d, 2) == log(0.5) @test pmf(d, 2) == 0.5 @test logpmf(d, 0) == -Inf @test pmf(d, 0) == 0.0 @test 1.0 <= rand(d) <= 3.0 A = Array(Int, 10) rand!(d, A) @test 1.0 <= mean(A) <= 3.0 # Examples of sample() a = [1, 6, 19] p = rand(Dirichlet(3)) x = sample(a, p) @test x == 1 || x == 6 || x == 19 a = 19.0 * [1.0, 0.0] x = sample(a) @test x == 0.0 || x == 19.0