-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from lrnv/fix_miscelaneous
Adding special routes for the independent copulas sampling cdf and pdf, fix a few typos, add a test
- Loading branch information
Showing
4 changed files
with
88 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# @testitem "test default parametrisation of every concrete copula types" begin | ||
# for T in subtypes(Copulas) | ||
# if isconcretetype(T) | ||
# rand(T(),100) | ||
# @test true | ||
# end | ||
# end | ||
# end | ||
|
||
# @testitem "test sampling of every concrete copula type" begin | ||
# for T in subtypes(Copulas) | ||
# if isconcretetype(T) | ||
# rand(T(),100) | ||
# @test true | ||
# end | ||
# end | ||
# end | ||
|
||
|
||
@testitem "small sampling test" begin | ||
# test constructed from https://github.com/lrnv/Copulas.jl/issues/35 | ||
using Copulas, Distributions | ||
rand(GaussianCopula([1.0 0.5; 0.5 1.0]),1) | ||
rand(IndependentCopula(2),1) | ||
rand(MCopula(2),1) | ||
rand(WCopula(2),1) | ||
|
||
@test true | ||
end | ||
|
||
|
||
@testitem "test cdf for three copulas." begin | ||
# test constructed from https://github.com/lrnv/Copulas.jl/issues/35 | ||
using Copulas, Distributions | ||
|
||
u = range(0, stop=1, length=100) | ||
|
||
for G in ( | ||
GaussianCopula([1.0 0.5; 0.5 1.0]), | ||
IndependentCopula(2), | ||
MCopula(2), | ||
WCopula(2) | ||
) | ||
for uᵢ in u | ||
for vᵢ in u | ||
cdf(G,[uᵢ,vᵢ]) | ||
end | ||
end | ||
end | ||
@test true | ||
end | ||
|
||
@testitem "test pdf for three copulas." begin | ||
# test constructed from https://github.com/lrnv/Copulas.jl/issues/35 | ||
using Copulas, Distributions | ||
|
||
u = range(0, stop=1, length=100) | ||
|
||
for G in ( | ||
GaussianCopula([1.0 0.5; 0.5 1.0]), | ||
IndependentCopula(2), | ||
# MCopula(2) | ||
) | ||
for uᵢ in u | ||
for vᵢ in u | ||
pdf(G,[uᵢ,vᵢ]) | ||
end | ||
end | ||
end | ||
@test true | ||
end |