diff --git a/.Rbuildignore b/.Rbuildignore index af21c6d..9c59904 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,2 +1,4 @@ ^.*\.git$ -^README.md$ \ No newline at end of file +^README.md$ +^.*\.Rproj$ +^\.Rproj\.user$ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..52c1c38 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata +*.Rproj \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index 8f8acdc..08d7d57 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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", diff --git a/NEWS b/NEWS index b752a8c..dc32e75 100644 --- a/NEWS +++ b/NEWS @@ -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. diff --git a/R/idc.R b/R/idc.R index be10b00..8c20e86 100644 --- a/R/idc.R +++ b/R/idc.R @@ -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 diff --git a/README.md b/README.md index 70ccf0f..7e41aeb 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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.