|
1 | 1 | using StructuralCausalModels |
2 | 2 | using Test |
3 | 3 |
|
4 | | -@testset "DAGs" begin |
| 4 | +include("test_dag_formulations.jl") |
| 5 | +include("test_set_dag_df.jl") |
5 | 6 |
|
6 | | - include("test_dag_formulations.jl") |
7 | | - include("test_set_dag_df.jl") |
| 7 | +include("test_dagitty_conversion.jl") |
| 8 | +include("test_ggm_conversion.jl") |
8 | 9 |
|
9 | | -end |
10 | | - |
11 | | -@testset "DAG conversions" begin |
12 | | - |
13 | | - include("test_dagitty_conversion.jl") |
14 | | - include("test_ggm_conversion.jl") |
15 | | - include("test_graphviz_conversions.jl") |
16 | | - |
17 | | -end |
18 | | - |
19 | | -@testset "d_separation" begin |
20 | | - |
21 | | - include("test_d_separation.jl") |
22 | | - @test to_ggm(dag) == "DAG(u ~ x + v, s1 ~ u, w ~ v + y, s2 ~ w)" |
23 | | - @test d_separation(dag, :x, :v; debug=false) == true |
24 | | - @test d_separation(dag, :x, [:v]; cset=:u, debug=false) == false |
25 | | - @test d_separation(dag, [:x], :v; cset=:s1, debug=false) == false |
26 | | - @test d_separation(dag, [:u], [:w]; debug=false) == false |
27 | | - @test d_separation(dag, :u, [:w]; cset=:v, debug=false) == true |
28 | | - @test d_separation(dag, [:x], :y; debug=false) == true |
29 | | - @test d_separation(dag, :x, :y; cset=[:u, :w], debug=false) == false |
30 | | - @test d_separation(dag, :x, :y; cset=[:s1, :s2], debug=false) == false |
31 | | - @test d_separation(dag, :x, :y; cset=[:u, :v, :w], debug=false) == true |
32 | | - @test d_separation(dag, :x, [:v]; cset=:u, debug=false) == false |
33 | | - @test d_separation(dag, [:x], :v; cset=:s1, debug=false) == false |
34 | | - |
35 | | - include("test_descendents_02.jl") |
36 | | - @test d_separation(dag, :k1, :v, cset=[:x1]) == true |
37 | | - @test d_separation(dag, :k1, :v, cset=[:w]) == true |
38 | | - @test d_separation(dag, :k1, :x1, cset=[:w]) == true |
39 | | - @test d_separation(dag, :k1, :x2, cset=[:v]) == true |
40 | | - @test d_separation(dag, :k1, :x2, cset=[:x1]) == true |
41 | | - @test d_separation(dag, :k1, :x2, cset=[:w]) == true |
42 | | - @test d_separation(dag, :k1, :x3, cset=[:w]) == true |
43 | | - @test d_separation(dag, :k1, :y, cset=[:k2, :x2, :x3]) == true |
44 | | - @test d_separation(dag, :k1, :y, cset=[:k2, :v, :x3]) == true |
45 | | - @test d_separation(dag, :k1, :y, cset=[:k2, :x1, :x3]) == true |
46 | | - @test d_separation(dag, :k1, :y, cset=[:k2, :w]) == true |
47 | | - @test d_separation(dag, :k2, :v, cset=[:x1]) == true |
48 | | - @test d_separation(dag, :k2, :v, cset=[:w]) == true |
49 | | - @test d_separation(dag, :k2, :v, cset=[:k1]) == true |
50 | | - @test d_separation(dag, :k2, :w, cset=[:k1]) == true |
51 | | - @test d_separation(dag, :k2, :x1, cset=[:w]) == true |
52 | | - @test d_separation(dag, :k2, :x1, cset=[:k1]) == true |
53 | | - @test d_separation(dag, :k2, :x2, cset=[:v]) == true |
54 | | - @test d_separation(dag, :k2, :x2, cset=[:x1]) == true |
55 | | - @test d_separation(dag, :k2, :x2, cset=[:w]) == true |
56 | | - @test d_separation(dag, :k2, :x2, cset=[:k1]) == true |
57 | | - @test d_separation(dag, :k2, :x3, cset=[:w]) == true |
58 | | - @test d_separation(dag, :k2, :x3, cset=[:k1]) == true |
59 | | - @test d_separation(dag, :v, :w; cset=:x1) == true |
60 | | - @test d_separation(dag, :v, :x3) == true |
61 | | - @test d_separation(dag, :v, :y; cset=[:k2, :x2, :x3]) == true |
62 | | - @test d_separation(dag, :v, :y; cset=[:k1, :x2, :x3]) == true |
63 | | - @test d_separation(dag, :v, :y; cset=[:w, :x2, :x3]) == true |
64 | | - @test d_separation(dag, :v, :y; cset=[:x2, :x1]) == true |
65 | | - @test d_separation(dag, :w, :x2; cset=[:v]) == true |
66 | | - @test d_separation(dag, :w, :x2; cset=[:x1]) == true |
67 | | - @test d_separation(dag, :w, :y; cset=[:k2, :x2, :x3]) == true |
68 | | - @test d_separation(dag, :w, :y; cset=[:k2, :v, :x3]) == true |
69 | | - @test d_separation(dag, :w, :y; cset=[:k1, :x2, :x3]) == true |
70 | | - @test d_separation(dag, :w, :y; cset=[:k1, :v, :x3]) == true |
71 | | - @test d_separation(dag, :w, :y; cset=[:k1, :x1, :x3]) == true |
72 | | - @test d_separation(dag, :w, :y; cset=[:k2, :x2, :x3]) == true |
73 | | - @test d_separation(dag, :x1, :x2; cset=[:v]) == true |
74 | | - @test d_separation(dag, :x1, :x3) == true |
75 | | - @test d_separation(dag, :x1, :y; cset=[:k2, :x2, :x3]) == true |
76 | | - @test d_separation(dag, :x1, :y; cset=[:k1, :x2, :x3]) == true |
77 | | - @test d_separation(dag, :x1, :y; cset=[:w, :x2, :x3]) == true |
78 | | - @test d_separation(dag, :x1, :y; cset=[:k2, :v, :x3]) == true |
79 | | - @test d_separation(dag, :x1, :y; cset=[:k1, :v, :x3]) == true |
80 | | - @test d_separation(dag, :x1, :y; cset=[:v, :w, :x3]) == true |
81 | | - @test d_separation(dag, :x2, :x3) == true |
82 | | - |
83 | | -end |
84 | | - |
85 | | -@testset "Methods" begin |
86 | | - |
87 | | - include("test_sr6_4_3b.jl") |
88 | | - include("test_ag.jl") |
89 | | - |
90 | | -end |
| 10 | +include("test_graphviz_conversions.jl") |
91 | 11 |
|
92 | | -@testset "Adjustment_sets" begin |
| 12 | +include("test_basis_set_01.jl") |
93 | 13 |
|
94 | | - include("test_open_paths_01.jl") |
95 | | - include("test_open_paths_02.jl") |
96 | | - include("test_open_paths_03.jl") |
97 | | - include("test_open_paths_04.jl") |
| 14 | +include("test_d_separation.jl") |
98 | 15 |
|
99 | | -end |
| 16 | +include("test_descendents_01.jl") |
| 17 | +include("test_descendents_02.jl") |
| 18 | +include("test_descendents_03.jl") |
100 | 19 |
|
101 | | -@testset "SR6.4.2" begin |
| 20 | +include("test_sr6_4_3b.jl") |
102 | 21 |
|
103 | | - include("test_sr6_4_2.jl") |
| 22 | +include("test_ag.jl") |
104 | 23 |
|
105 | | -end |
| 24 | +include("test_open_paths_01.jl") |
| 25 | +include("test_open_paths_02.jl") |
| 26 | +include("test_open_paths_03.jl") |
| 27 | +include("test_open_paths_04.jl") |
106 | 28 |
|
107 | | -@testset "SR6.4.3" begin |
| 29 | +include("test_sr6_4_2.jl") |
108 | 30 |
|
109 | | - include("test_sr6_4_3.jl") |
| 31 | +include("test_sr6_4_3.jl") |
110 | 32 |
|
111 | | -end |
0 commit comments