Skip to content

Commit e3749e5

Browse files
committed
Rel 0.1.2
1 parent 40b896e commit e3749e5

File tree

11 files changed

+162
-273
lines changed

11 files changed

+162
-273
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"julia.environmentPath": "/Users/rob/.julia/environments/v1.6"
3+
}

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "StructuralCausalModels"
22
uuid = "a41e6734-49ce-4065-8b83-aff084c01dfd"
33
authors = ["Rob J Goedman <goedman@mac.com>"]
4-
version = "0.1.1"
4+
version = "0.1.2"
55

66
[deps]
77
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"

SCM.code-workspace

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
}
6+
],
7+
"settings": {
8+
"julia.environmentPath": "/Users/rob/.julia/environments/v1.6"
9+
}
10+
}

conf_triangles.dot

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
digraph conf_triangles {
2+
B -> Z;
3+
B -> D;
4+
A -> Z;
5+
A -> E;
6+
Z -> E;
7+
Z -> D;
8+
E -> D;
9+
}

examples/Shipley/fig2.6/fig2.6.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ using StructuralCausalModels
33
ProjDir = @__DIR__
44
cd(ProjDir) #do
55

6+
VERSION
7+
68
fname = scm_path("..", "examples", "Shipley", "fig2.6", "fig2.6.dot")
79
Sys.isapple() && run(`open -a GraphViz.app $(fname)`)
810

@@ -15,7 +17,6 @@ d = OrderedDict(
1517
);
1618

1719
dag = DAG("fig2.6", d);
18-
show(dag)
1920

2021
f = [:x]; s = [:v]
2122
g1 = d_separation(dag, f, s)

notebooks/confounding_triangles.ipynb

Lines changed: 26 additions & 271 deletions
Large diffs are not rendered by default.

notebooks/pluto_notebook.jl

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
### A Pluto.jl notebook ###
2+
# v0.11.2
3+
4+
using Markdown
5+
using InteractiveUtils
6+
7+
# ╔═╡ 7079ec54-d3f6-11ea-0034-79a1c1c5b137
8+
md"# The Basel problem
9+
_Leonard Euler_ proved in 1741 that the series
10+
$$\frac{1}{1} + \frac{1}{4} + \frac{1}{9} + \cdots$$
11+
converges to
12+
$$\frac{\pi^2}{6}$$"
13+
14+
# ╔═╡ cce045ac-d373-11ea-29af-5be52ed80e36
15+
md"## Test Pluto notebook"
16+
17+
# ╔═╡ 30cfc76c-d276-11ea-1e1a-6567e0173d69
18+
using DrWatson
19+
20+
# ╔═╡ cfa1909e-d278-11ea-215d-4f34edbb8294
21+
using StructuralCausalModels
22+
23+
# ╔═╡ a1b39506-d278-11ea-1a13-05f75d56dbca
24+
VERSION
25+
26+
# ╔═╡ dde39c20-d272-11ea-00b1-71e8b3c09e79
27+
cd(joinpath(homedir(), ".julia/dev/StructuralCausalModels"))
28+
29+
# ╔═╡ 3ed7655e-d276-11ea-185b-29e9192ba4f0
30+
@quickactivate "StructuralCausalModels"
31+
32+
# ╔═╡ 742ca656-d276-11ea-04ab-f36281c92836
33+
d_string = "dag {A -> {E Z}; B -> {D Z}; Z -> {D E}; E -> D}";
34+
35+
# ╔═╡ 739fdd34-d276-11ea-0632-13aeca3d3aa5
36+
dag = DAG("conf_triangles", d_string);
37+
38+
# ╔═╡ 98ce6cf6-d276-11ea-15d5-856fba9a3c50
39+
dag.a
40+
41+
# ╔═╡ 182e0140-d374-11ea-254b-8f4a175f4f06
42+
dag.d
43+
44+
# ╔═╡ eb94dbbc-d278-11ea-2f78-9bd8a49d14d9
45+
fname = projectdir() * "/conf_triangles.dot";
46+
47+
# ╔═╡ eafca4d2-d278-11ea-08ce-11367ae96f69
48+
to_graphviz(dag, fname);
49+
50+
# ╔═╡ 59229f0e-d277-11ea-0bc8-cb68e38ae3b3
51+
Sys.isapple() && run(`open -a GraphViz.app $(fname)`);
52+
53+
# ╔═╡ 1223d8ee-d279-11ea-2ba4-7dbae68007ff
54+
to_ggm(dag)
55+
56+
# ╔═╡ 11b28448-d279-11ea-1d52-2544424ea533
57+
bs = basis_set(dag)
58+
59+
# ╔═╡ 8fd4685c-d374-11ea-3b9c-670bb9da8a7c
60+
bs.bs
61+
62+
# ╔═╡ 2b60ff06-d2cd-11ea-0bf6-050ad1720b31
63+
f = :A
64+
65+
# ╔═╡ 4dc673b4-d2cd-11ea-1ca4-219bfa2bf57d
66+
d = :B
67+
68+
# ╔═╡ 582b9c98-d279-11ea-2daf-93e7a13c9966
69+
d_separation(dag, f, :B)
70+
71+
# ╔═╡ 57534fc8-d279-11ea-0b9b-a99db30bc7b4
72+
d_separation(dag, d, :E)
73+
74+
# ╔═╡ 5712eff0-d279-11ea-3978-2106eb0feb76
75+
d_separation(dag, d, :E; c=[:A, :Z])
76+
77+
# ╔═╡ Cell order:
78+
# ╠═7079ec54-d3f6-11ea-0034-79a1c1c5b137
79+
# ╠═cce045ac-d373-11ea-29af-5be52ed80e36
80+
# ╠═a1b39506-d278-11ea-1a13-05f75d56dbca
81+
# ╠═dde39c20-d272-11ea-00b1-71e8b3c09e79
82+
# ╠═30cfc76c-d276-11ea-1e1a-6567e0173d69
83+
# ╠═3ed7655e-d276-11ea-185b-29e9192ba4f0
84+
# ╠═742ca656-d276-11ea-04ab-f36281c92836
85+
# ╠═cfa1909e-d278-11ea-215d-4f34edbb8294
86+
# ╠═739fdd34-d276-11ea-0632-13aeca3d3aa5
87+
# ╠═98ce6cf6-d276-11ea-15d5-856fba9a3c50
88+
# ╠═182e0140-d374-11ea-254b-8f4a175f4f06
89+
# ╠═eb94dbbc-d278-11ea-2f78-9bd8a49d14d9
90+
# ╠═eafca4d2-d278-11ea-08ce-11367ae96f69
91+
# ╠═59229f0e-d277-11ea-0bc8-cb68e38ae3b3
92+
# ╠═1223d8ee-d279-11ea-2ba4-7dbae68007ff
93+
# ╠═11b28448-d279-11ea-1d52-2544424ea533
94+
# ╠═8fd4685c-d374-11ea-3b9c-670bb9da8a7c
95+
# ╠═2b60ff06-d2cd-11ea-0bf6-050ad1720b31
96+
# ╠═4dc673b4-d2cd-11ea-1ca4-219bfa2bf57d
97+
# ╠═582b9c98-d279-11ea-2daf-93e7a13c9966
98+
# ╠═57534fc8-d279-11ea-0b9b-a99db30bc7b4
99+
# ╠═5712eff0-d279-11ea-3978-2106eb0feb76

research/ancestral.dot

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
digraph ancestral
2+
{
3+
"v" -> "u";
4+
"v" -> "w";
5+
"u" -> "s1" [dir=both];
6+
"x" -> "u" [dir=none, color=red];
7+
"y" -> "w";
8+
"w" -> "s2";
9+
}

research/ancestral_dor.png

7.99 KB
Loading

test/test_basis_set_01.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Sys.isapple() && run(`open -a GraphViz.app $(fname)`)
1616

1717
bs = basis_set(dag)
1818

19+
1920
@testset "basis_set_01" begin
2021

2122
@test length(bs) == 48

0 commit comments

Comments
 (0)