Skip to content

Commit

Permalink
a fix to IDC graph definition
Browse files Browse the repository at this point in the history
  • Loading branch information
santikka committed Jun 13, 2021
1 parent 5bf0ebb commit 8440e74
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
^.*\.git$
^README.md$
^README.md$
^.*\.Rproj$
^\.Rproj\.user$
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
*.Rproj
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: causaleffect
Version: 1.3.12
Date: 2020-12-18
Version: 1.3.13
Date: 2021-06-13
Title: Deriving Expressions of Joint Interventional Distributions and Transport Formulas in Causal Models
Authors@R: person(given = "Santtu",
family = "Tikka",
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Changes from version 1.3.12 to 1.3.13
* Fixed an incorrect graph definition in the IDC algorithm.

Changes from version 1.3.11 to 1.3.12
* The package no longer depends on the 'ggm' package.
* The package no longer requires the 'XML' package, now suggests instead.
Expand Down
8 changes: 4 additions & 4 deletions R/idc.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ idc <- function(y, x, z, P, G, G.obs, v, topo, tree, prune) {
tree$branch <- list()
offset <- (prune) * 2
from <- NULL
G.xz <- unobserved.graph(G)
edges.to.x <- igraph::E(G.xz)[to(x)]
edges.from.z <- igraph::E(G.xz)[from(z)]
G.xz <- igraph::subgraph.edges(G.xz, igraph::E(G.xz)[setdiff(igraph::E(G.xz), union(edges.to.x, edges.from.z))], delete.vertices = FALSE)
G.u <- unobserved.graph(G)
edges.to.x <- igraph::E(G.u)[to(x)]
nxt <- list()
for (node in z) {
cond <- setdiff(z, node)
edges.from.node <- igraph::E(G.u)[from(node)]
G.xz <- igraph::subgraph.edges(G.u, igraph::E(G.u)[setdiff(igraph::E(G.u), union(edges.to.x, edges.from.node))], delete.vertices = FALSE)
if (wrap.dSep(G.xz, y, node, union(x, cond))) {
tree$call$line <- 9 + offset
tree$call$z.prime <- node
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ devtools::install_github("santikka/causaleffect")

## Recent changes (for all changes, see NEWS file).

### Changes from version 1.3.12 to 1.3.13
* Fixed an incorrect graph definition in the IDC algorithm.

### Changes from version 1.3.11 to 1.3.12
* The package no longer depends on the 'ggm' package.
* The package no longer requires the 'XML' package, now suggests instead.
Expand All @@ -45,7 +48,3 @@ devtools::install_github("santikka/causaleffect")

### Changes from version 1.3.6 to 1.3.7
* Fixed an issue with simplification introduced in version 1.3.6.

### Changes from version 1.3.5 to 1.3.6
* Fixed a bug regarding graphs where zero edges had the 'description' attribute.
* Fixed a bug when attempting to simplify conditional causal effects.

0 comments on commit 8440e74

Please sign in to comment.