Skip to content

Commit

Permalink
version 2.6-10
Browse files Browse the repository at this point in the history
  • Loading branch information
mk314199 authored and cran-robot committed Mar 3, 2020
1 parent d2e3cad commit ea4a57c
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 65 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: pcalg
Version: 2.6-9
Date: 2020-02-11
Version: 2.6-10
Date: 2020-03-3
Title: Methods for Graphical Models and Causal Inference
Description: Functions for causal structure
learning and causal inference using graphical models. The main algorithms
Expand Down Expand Up @@ -51,6 +51,6 @@ Encoding: UTF-8
License: GPL (>= 2)
URL: http://pcalg.r-forge.r-project.org/
RoxygenNote: 6.1.1
Packaged: 2020-02-11 08:49:45 UTC; kalischm
Packaged: 2020-03-03 12:31:36 UTC; kalischm
Repository: CRAN
Date/Publication: 2020-02-11 13:00:06 UTC
Date/Publication: 2020-03-03 14:40:07 UTC
12 changes: 6 additions & 6 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
1c213fc1c5a5ec68e7a5ba9293440dc3 *ChangeLog
37d84a7531ceea244c781882060b0d93 *DESCRIPTION
4b9b32644c238bb95ec960bbfc0bff0a *DESCRIPTION
f813efd2d2208b900ae1d5ceb8dce2cf *NAMESPACE
66963591a11cfdb002f5da9070f1500b *R/Aaux.R
83c288d2212114e54bfe624e0edecaaa *R/AllClasses.R
9f99e28f01bd00dedf565c6e01978676 *R/adjustment.R
13a57456f8fd3ae055dd9a45ce6f933f *R/agesFuns.R
709461024e0516af39a962661e2930d0 *R/deprecated.R
4cccbecfa381ea1ad82c20e0151b239c *R/gacFuns.R
2e96c58990915d4dd7e51976b224bbd2 *R/gacFuns.R
8eff3a164a5b32a9c4818a1e840199c0 *R/genRandDAG.R
5c33d7a0849fd620631eb901d6a6540d *R/gies.R
aca17dcd6f37ce1136086a8bc285046e *R/isValidGraph.R
b363657f7e2c52dc0f2aa083780fa0f7 *R/jointIda.R
386ed9be1a524de90dfac185433b009a *R/lingamFuns.R
cc462e22779cb4c455536d1f28811eb7 *R/optAdjSet.R
ace998420ba6145fe7fe3c75c5892e66 *R/optAdjSet.R
af4239ca324cb48eaac6b07fc0cf0061 *R/pcalg.R
67ec62ad56d7cffaba4bee8f88797136 *R/pcalg2dagitty.R
f84d95dd282c42c32595a27ca98f9a3d *R/possDeAn.R
0db1ba6d57801a4d8fc6cdf996384a4d *R/zzz.R
d599e23940bca0203504c0fa6b09e01c *TODO
bd68b3d89307e8260f55874d7dbcf993 *build/vignette.rds
94bed761e02266860aff243b04717fed *build/vignette.rds
f832779eae511757a99906c7670fc0ad *cleanup
7cbe431a233e6c454e24f7b92d63fe75 *data/datalist
1d8d4c43b9cbb9dc9dd57acd59f565bf *data/gmB.rda
Expand All @@ -32,10 +32,10 @@ f832779eae511757a99906c7670fc0ad *cleanup
4e33425acbef8bf36705d8a75622baa8 *inst/doc/mkVignettes.R
cc46b1f49edd31faf5316d5cf4d6c1ce *inst/doc/pcalgDoc.R
6581d4416f174d4d6f07a2a2d4b9d3cb *inst/doc/pcalgDoc.Rnw
7c38555b6c1bbe4e36f53b8c8810e8f8 *inst/doc/pcalgDoc.pdf
277b633e6b422057891d5e6722d84add *inst/doc/pcalgDoc.pdf
01c5a9cb2024f1234d7c4aebb9762db5 *inst/doc/vignette2018.R
65ba145dfc8ae12f50c95d77a8bf8600 *inst/doc/vignette2018.Rnw
fe84a6e311f25d42e56c1f8042c8f07d *inst/doc/vignette2018.pdf
23165d2276ae3dd8fee95d261b9b2da9 *inst/doc/vignette2018.pdf
cee0b4475c720bf58c466e1495451b22 *inst/external/N_6_1000.rds
0d84fdc119d76d992b72f9bdbd0e613d *inst/external/gac-pags.rds
e7a2a9117d97986b2ab6afc6b4f77478 *inst/external/test_conservative_pc_data1.rda
Expand Down
2 changes: 1 addition & 1 deletion R/gacFuns.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ isAmenable <- function(m,x,y, type = "pag") {
## check if there is a pdp from cand[j] to y without going through x[i]
## cand could already be in y
## pathOK <- ( length(intersect(y, possibleDeProper(m,cand[j],x[i]))) != 0 )
pdpTemp <- possDe(m = m, x = cand[j], y = x[i],
pdpTemp <- possDe(m = m, x = cand[j], y = x,
possible = TRUE, ds = FALSE,
type = type)
pathOK <- ( length(intersect(y, pdpTemp)) != 0 )
Expand Down
108 changes: 54 additions & 54 deletions R/optAdjSet.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,57 +51,57 @@ optAdjSet <- function(graphEst, x.pos, y.pos){



isAmenable <- function(m,x,y, type = "pag") {
## INPUT: adj.matrix m; sets of node positions x and y; type in DAG, CPDAG,
## MAG or PAG
## OUTPUT: TRUE if m is amenabel wrt x,y; o/w FALSE
found <- FALSE ## if found == TRUE at any time, graph is not amenable wrt x,y
## DAG is always amenable
if (type %in% c("pdag", "cpdag","dag","pag","mag")) { ##changed added dag just in case, makes no difference
if (type == "dag") ## added the if case for dags
return(!found)
i <- 0
p <- length(x)

## for all nodes in x, if amenability is still possible
while ( (i<p) & !found) {
i <- i+1
## posDesc of x[i] without going through any other x node
## posDesc <- possibleDeProper(m,x[i],x[-i])
posDesc <- possDe(m = m, x = x[i], y = x[-i], possible = TRUE,
ds = FALSE, type = type)
## potential problem for amenability only if there is a
## pdp from x[i] to y
if ( length(intersect(y, posDesc)) != 0 ) {
nb <- as.vector(which(m[x[i],]!=0 | m[,x[i]]!=0)) ## nbrs of x[i]
## potentially first node on pdp from x[i] to y; however, not yet sure
cand <- intersect(nb, posDesc)
j <- 0
## for all candidate nodes, if amenability is still possible
## (also covers case if cand is empty)
while ( (j<length(cand)) & !found ) {
j <- j+1
## check if there is a pdp from cand[j] to y without going through x[i]
## cand could already be in y
## pathOK <- ( length(intersect(y, possibleDeProper(m,cand[j],x[i]))) != 0 )
pdpTemp <- possDe(m = m, x = cand[j], y = x[i],
possible = TRUE, ds = FALSE,
type = type)
pathOK <- ( length(intersect(y, pdpTemp)) != 0 )
if (pathOK) {
isPDAG <- (type == "pdag" | type == "cpdag") ##changed
PDAGproblem <- (isPDAG & (m[x[i],cand[j]] == 1)) ##changed
PAGproblem1 <- (!isPDAG & (m[x[i], cand[j]] != 2) & (m[cand[j], x[i]] != 3)) ##changed
isDirEdge <- ((m[x[i], cand[j]] == 2) & (m[cand[j], x[i]] == 3))
PAGproblem2 <- (!isPDAG & isDirEdge & !visibleEdge(m, x[i], cand[j])) ##changed
found <- (PDAGproblem | PAGproblem1 | PAGproblem2)
} ## if pathOK
} ## while cand
} ## if path from x[i] to y
} ## while x
return(!found)
} else { ## if graph type not known
cat("Not a valid graph type! Should be written in lowercase! \n")
return(NULL)
}
}
# isAmenable <- function(m,x,y, type = "pag") {
# ## INPUT: adj.matrix m; sets of node positions x and y; type in DAG, CPDAG,
# ## MAG or PAG
# ## OUTPUT: TRUE if m is amenabel wrt x,y; o/w FALSE
# found <- FALSE ## if found == TRUE at any time, graph is not amenable wrt x,y
# ## DAG is always amenable
# if (type %in% c("pdag", "cpdag","dag","pag","mag")) { ##changed added dag just in case, makes no difference
# if (type == "dag") ## added the if case for dags
# return(!found)
# i <- 0
# p <- length(x)
#
# ## for all nodes in x, if amenability is still possible
# while ( (i<p) & !found) {
# i <- i+1
# ## posDesc of x[i] without going through any other x node
# ## posDesc <- possibleDeProper(m,x[i],x[-i])
# posDesc <- possDe(m = m, x = x[i], y = x[-i], possible = TRUE,
# ds = FALSE, type = type)
# ## potential problem for amenability only if there is a
# ## pdp from x[i] to y
# if ( length(intersect(y, posDesc)) != 0 ) {
# nb <- as.vector(which(m[x[i],]!=0 | m[,x[i]]!=0)) ## nbrs of x[i]
# ## potentially first node on pdp from x[i] to y; however, not yet sure
# cand <- intersect(nb, posDesc)
# j <- 0
# ## for all candidate nodes, if amenability is still possible
# ## (also covers case if cand is empty)
# while ( (j<length(cand)) & !found ) {
# j <- j+1
# ## check if there is a pdp from cand[j] to y without going through x[i]
# ## cand could already be in y
# ## pathOK <- ( length(intersect(y, possibleDeProper(m,cand[j],x[i]))) != 0 )
# pdpTemp <- possDe(m = m, x = cand[j], y = x[i],
# possible = TRUE, ds = FALSE,
# type = type)
# pathOK <- ( length(intersect(y, pdpTemp)) != 0 )
# if (pathOK) {
# isPDAG <- (type == "pdag" | type == "cpdag") ##changed
# PDAGproblem <- (isPDAG & (m[x[i],cand[j]] == 1)) ##changed
# PAGproblem1 <- (!isPDAG & (m[x[i], cand[j]] != 2) & (m[cand[j], x[i]] != 3)) ##changed
# isDirEdge <- ((m[x[i], cand[j]] == 2) & (m[cand[j], x[i]] == 3))
# PAGproblem2 <- (!isPDAG & isDirEdge & !visibleEdge(m, x[i], cand[j])) ##changed
# found <- (PDAGproblem | PAGproblem1 | PAGproblem2)
# } ## if pathOK
# } ## while cand
# } ## if path from x[i] to y
# } ## while x
# return(!found)
# } else { ## if graph type not known
# cat("Not a valid graph type! Should be written in lowercase! \n")
# return(NULL)
# }
# }
Binary file modified build/vignette.rds
Binary file not shown.
Binary file modified inst/doc/pcalgDoc.pdf
Binary file not shown.
Binary file modified inst/doc/vignette2018.pdf
Binary file not shown.

0 comments on commit ea4a57c

Please sign in to comment.