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

predict,D2C-methodR Documentation

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

Description

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

Usage

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

Arguments

object

: a D2C object

i

: index of putative cause (1 \le i \le n)

j

: index of putative effect (1 \le j \le n)

data

: dataset of observations from the DAG

Value

list with response and prob of the prediction

References

Gianluca Bontempi, Maxime Flauder (2015) From dependency to causality: a machine learning approach. JMLR, 2015, http://jmlr.org/papers/v16/bontempi15a.html

Examples

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

gbonte/D2C documentation built on Sept. 8, 2023, 11:22 p.m.