predict-D2C-method: predict if there is a connection between node i and node j

Description Usage Arguments Value References Examples

Description

predict if there is a connection between node i and node j

Usage

1
2
## S4 method for signature 'D2C'
predict(object, i, j, data)

Arguments

object

: a D2C object

i

: index of putative cause (1 ≤ i ≤ n)

j

: index of putative effect (1 ≤ j ≤ n)

data

: dataset of observations from the DAG

Value

list with response and prob of the prediction

References

Gianluca Bontempi, Maxime Flauder (2014) From dependency to causality: a machine learning approach. Under submission

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
require(RBGL)
require(gRbase)
require(foreach)
data(example)
## load the D2C object
testDAG<-new("simulatedDAG",NDAG=1, N=50,noNodes=5,
           functionType = "linear", seed=1,sdn=c(0.25,0.5))
## creates a simulatedDAG object for testing
plot(testDAG@list.DAGs[[1]])
## plot the topology of the simulatedDAG
predict(example,1,2, testDAG@list.observationsDAGs[[1]])
## predict if the edge 1->2 exists
predict(example,4,3, testDAG@list.observationsDAGs[[1]])
## predict if the edge 4->3 exists
predict(example,4,1, testDAG@list.observationsDAGs[[1]])
## predict if the edge 4->1 exists

D2C documentation built on May 29, 2017, 10:44 a.m.