diff --git a/src/Copulas.jl b/src/Copulas.jl index c19e3a8..bd69637 100644 --- a/src/Copulas.jl +++ b/src/Copulas.jl @@ -15,9 +15,7 @@ typealias IntArrays Array{Array{Int, 1}, 1} #################### abstract Copula -abstract PccCop <: Copula -abstract PairCop <: PccCop -abstract VarPairCop <: PccCop +abstract PairCop <: Copula # parametric pair copulas abstract AbstractParamPC <: PairCop @@ -27,12 +25,20 @@ abstract ParamPC_Cpp <: AbstractParamPC # VineCopulaCPP # package code goes here export # copula types -PairCop, +AbstractCTree, AbstractParamPC, +Copula, +CTreeParRef, +CTreePaths, +MixPC, +ModPC, +PairCop, ParamPC, ParamPC_Cpp, -ModPC, -MixPC, +PCC, +PITMatrix, +Raw_html, +Vine, # parametric copula types IndepPC, AMHPC, @@ -76,10 +82,6 @@ Tawn2PC_Cpp, TawnPC_Cpp, tPC_Cpp, # functions -PITMatrix, -Tree, -Vine, -Raw_html, allPathVals, allVals, condSetChk, diff --git a/src/PCC/Vines/graphviz.jl b/src/PCC/Vines/graphviz.jl index 3c8d3f5..f9bd5d1 100644 --- a/src/PCC/Vines/graphviz.jl +++ b/src/PCC/Vines/graphviz.jl @@ -111,9 +111,9 @@ function toGviz(tr::CTreeParRef, write(stream, "}") end -function toGviz(tr::AbstractCTree, stream::IO; args...) +function toGviz(tr::AbstractCTree, stream::IO, chrt::String; args...) trPar = convert(CTreeParRef, tr) - return toGviz(trPar, stream; args...) + return toGviz(trPar, stream, chrt; args...) end function getCmd(tr::CTreeParRef, chrt::String) diff --git a/test/condTree_test.jl b/test/condTree_test.jl index 316e3c0..4008a69 100644 --- a/test/condTree_test.jl +++ b/test/condTree_test.jl @@ -107,10 +107,6 @@ end ## attach! ## ############# -############# -## attach! ## -############# - ## attach to end of path tr = Copulas.CTreePaths(1, [2 3], [4]) Copulas.attach!(tr, 5, [2,3]) diff --git a/test/graphviz_test.jl b/test/graphviz_test.jl index 1c510ac..b53aa26 100644 --- a/test/graphviz_test.jl +++ b/test/graphviz_test.jl @@ -4,21 +4,23 @@ using Copulas using Base.Test tr = Copulas.CTreeParRef([0, 1, 2, 2]) +Copulas.viz(tr) expGraphvizString = """ digraph { -1 -> 2; -2 -> 3; -2 -> 4; +node [shape=circle]; +edge [arrowhead=none]; +1 -> 2 ; +2 -> 3 ; +2 -> 4 ; }""" -@test expGraphvizString == Copulas.toGviz(tr) +@test expGraphvizString == Copulas.toConsole(tr) tr = Copulas.CTreePaths(6, [4,2], [5,3,1], [5,7], [5,8], [5,9], [5,10], [11], [12], [13], [14]) Copulas.viz(tr) -Copulas.viz(tr, cmd="neato") Copulas.render(tr) ## Copulas.render(tr, "png", "/home/chris/treePic") diff --git a/test/pitmatrix_test.jl b/test/pitmatrix_test.jl index e568b53..b9a5984 100644 --- a/test/pitmatrix_test.jl +++ b/test/pitmatrix_test.jl @@ -30,4 +30,14 @@ kk = PITMatrix([0.1 0.3; 0.4 -0.2; 0.6 0.4]) +@test_throws Exception PITMatrix([0.1 0.3; + 0.4 -0.2; + 0.6 0.4]) + +kk = reshape([0.1 0.2; + 0.4 0.3; + 0.5 0.1], 3, 2, 1) + +@test_throws Exception PITMatrix(kk) + end diff --git a/test/runtests.jl b/test/runtests.jl index d7ded0c..fa6c062 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,10 +2,10 @@ using Copulas using Base.Test tests = [ - ## "utils_test.jl", - ## "paircop_test.jl", - ## "condTree_test.jl", - ## "graphviz_test.jl", + "utils_test.jl", + "paircop_test.jl", + "condTree_test.jl", + "graphviz_test.jl", "vine_test.jl", "rvine_matrix_test.jl", "pcc_test.jl", diff --git a/test/rvine_matrix_test.jl b/test/rvine_matrix_test.jl index 221d93d..d716564 100644 --- a/test/rvine_matrix_test.jl +++ b/test/rvine_matrix_test.jl @@ -33,6 +33,14 @@ kk = [2 0 0; 2 3 0; 3 2 2] kk = [1 0 0; 2 3 0; 3 2 2] @test Copulas.chkColumnSubsets(kk) +######## +## dg ## +######## + +kk = [1 0 0; 2 3 0; 3 2 2] +rvm = Copulas.RVMatrix(kk) +@test Copulas.dg(rvm) == kk + ############### ## allExcept ## ############### diff --git a/test/various_test.jl b/test/various_test.jl new file mode 100644 index 0000000..214b77b --- /dev/null +++ b/test/various_test.jl @@ -0,0 +1,11 @@ +module TestVarious + +using Copulas +using Base.Test + +## undefined testpcc +##------------------ + +@test_throws Exception Copulas.testpcc(187) + +end