Skip to content

Commit

Permalink
Merge e2317a4 into 590adb2
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed82008 committed Oct 6, 2019
2 parents 590adb2 + e2317a4 commit 2dd1be7
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 13 deletions.
27 changes: 14 additions & 13 deletions Manifest.toml
Expand Up @@ -70,15 +70,15 @@ uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.0.0"

[[DataAPI]]
git-tree-sha1 = "8903f0219d3472543fc4b2f5ebaf675a07f817c0"
git-tree-sha1 = "674b67f344687a88310213ddfa8a2b3c76cc4252"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.0.1"
version = "1.1.0"

[[DataStructures]]
deps = ["InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "0809951a1774dc724da22d26e4289bbaab77809a"
git-tree-sha1 = "517ce30aa57cdfae1ab444a7c0aef8bb86345bc2"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.17.0"
version = "0.17.1"

[[Dates]]
deps = ["Printf"]
Expand Down Expand Up @@ -106,21 +106,21 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[Distributions]]
deps = ["LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns"]
git-tree-sha1 = "baaf9e165ba8a2d11fb4fb3511782ee070ee3694"
git-tree-sha1 = "b419fcf95ef9c8cf4d6610cd323890ad66d64240"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
version = "0.21.1"
version = "0.21.3"

[[FFTW]]
deps = ["AbstractFFTs", "BinaryProvider", "Conda", "Libdl", "LinearAlgebra", "Reexport", "Test"]
git-tree-sha1 = "03f8776fbdae28c20c0d1d2ae4e090cd1dfcd247"
git-tree-sha1 = "6c5b420da0b8c12098048561b8d58f81adea506f"
uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
version = "1.0.0"
version = "1.0.1"

[[FillArrays]]
deps = ["LinearAlgebra", "Random", "SparseArrays"]
git-tree-sha1 = "4c707c87ddd3199fc5624d5c98b2c706e4d00675"
git-tree-sha1 = "16974065d5bfa867446d3228bc63f05a440e910b"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "0.7.0"
version = "0.7.2"

[[FiniteDifferences]]
deps = ["LinearAlgebra", "Printf"]
Expand Down Expand Up @@ -174,9 +174,10 @@ deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[Missings]]
git-tree-sha1 = "29858ce6c8ae629cf2d733bffa329619a1c843d0"
deps = ["DataAPI"]
git-tree-sha1 = "de0a5ce9e5289f27df672ffabef4d1e5861247d5"
uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
version = "0.4.2"
version = "0.4.3"

[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
Expand Down Expand Up @@ -309,7 +310,7 @@ uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
version = "0.8.0"

[[SuiteSparse]]
deps = ["Libdl", "LinearAlgebra", "SparseArrays"]
deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"]
uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"

[[Test]]
Expand Down
25 changes: 25 additions & 0 deletions test/runtests.jl
Expand Up @@ -19,8 +19,19 @@ norm_val = ones(dim)
alpha = ones(4)
dir_val = fill(0.25, 4)
beta_mat = rand(MatrixBeta(dim, dim, dim))
tested = []
function test_info(name)
if !(name in tested)
push!(tested, name)
@info("Testing: $(name)")
end
end
test_head(s) = println("\n"*s*"\n")
separator() = println("\n"*"="^50)

separator()
@testset "Univariate discrete distributions" begin
test_head("Testing: Univariate discrete distributions")
uni_disc_dists = [
DistSpec(:Bernoulli, (0.45,), 1),
DistSpec(:Bernoulli, (0.45,), 0),
Expand All @@ -34,13 +45,16 @@ beta_mat = rand(MatrixBeta(dim, dim, dim))
DistSpec(:PoissonBinomial, ([0.5, 0.5],), 0),
]
for d in uni_disc_dists
test_info(d.name)
for testf in get_all_functions(d, false)
test_ad(testf.f, testf.x)
end
end
end
separator()

@testset "Univariate continuous distributions" begin
test_head("Testing: Univariate continuous distributions")
uni_cont_dists = [
DistSpec(:Arcsine, (), 0.5),
DistSpec(:Arcsine, (1,), 0.5),
Expand Down Expand Up @@ -145,27 +159,33 @@ end
DistSpec(:VonMises, (1, 1), 1),
]
for d in uni_cont_dists
test_info(d.name)
for testf in get_all_functions(d, true)
test_ad(testf.f, testf.x)
end
end
end
separator()

@testset "Multivariate discrete distributions" begin
test_head("Testing: Multivariate discrete distributions")
mult_disc_dists = [
]
broken_mult_disc_dists = [
# Dispatch error caused by lack of type parameters in Distributions.Multinomial
DistSpec(:((p) -> Multinomial(4, p)), (fill(0.25, 4),), 1),
]
for d in mult_disc_dists
test_info(d.name)
for testf in get_all_functions(d, false)
test_ad(testf.f, testf.x)
end
end
end
separator()

@testset "Multivariate continuous distributions" begin
test_head("Testing: Multivariate continuous distributions")
mult_cont_dists = [
DistSpec(:MvNormal, (mean, cov_mat), norm_val),
DistSpec(:MvNormal, (mean, cov_vec), norm_val),
Expand Down Expand Up @@ -195,13 +215,16 @@ end
]

for d in mult_cont_dists
test_info(d.name)
for testf in get_all_functions(d, true)
test_ad(testf.f, testf.x)
end
end
end
separator()

@testset "Matrix-variate continuous distributions" begin
test_head("Testing: Matrix-variate continuous distributions")
matrix_cont_dists = [
DistSpec(:((n1, n2)->MatrixBeta(dim, n1, n2)), (dim, dim), beta_mat),
]
Expand All @@ -215,8 +238,10 @@ end
]

for d in matrix_cont_dists
test_info(d.name)
for testf in get_all_functions(d, true)
test_ad(testf.f, testf.x)
end
end
end
separator()

0 comments on commit 2dd1be7

Please sign in to comment.