| ParallelWorld {R6causal} | R Documentation |
R6 Class for parallel world models
Description
R6 Class for parallel world models
R6 Class for parallel world models
Details
Inherits R6 class SCM.
Super class
R6causal::SCM -> ParallelWorld
Active bindings
num_worldsNumber of parallel worlds.
worldnamesNames of parallel worlds.
worldsuffixSuffix used for parallel world variables.
originalscmSCM from which the parallel worlds are derived.
dolistList containing the interventions for each world.
Methods
Public methods
Inherited methods
R6causal::SCM$add_variable()R6causal::SCM$an()R6causal::SCM$causal.effect()R6causal::SCM$cfid()R6causal::SCM$ch()R6causal::SCM$de()R6causal::SCM$dosearch()R6causal::SCM$intervene()R6causal::SCM$pa()R6causal::SCM$plot()R6causal::SCM$print()R6causal::SCM$remove_variable()R6causal::SCM$simulate()R6causal::SCM$tikz()
Method new()
Create a new ParallelWorld object from an SCM object.
Usage
ParallelWorld$new(scm, dolist, worldnames = NULL, worldsuffix = "_")
Arguments
scmAn SCM object.
dolistA list containing the interventions for each world. Each element of the list has the fields:
target: a vector of variable names that specify the target variable(s) of the counterfactual intervention.
ifunction: a list of functions for the counterfactual intervention.
worldnamesA character vector giving the names of the parallel worlds.
worldsuffixA text giving the suffix used for parallel world variables before the world number. Defaults to "_" and the worlds have then suffixes "_1", "_2", "_3", ...
Returns
A new 'ParallelWorld' object that also belongs to class 'SCM'.
Examples
backdoor_parallel <- ParallelWorld$new(
backdoor,
dolist=list(
list(target = "x",
ifunction = 0),
list(target = list("z","x"),
ifunction = list(1,0))
)
)
backdoor_parallel
plot(backdoor_parallel)
Method clone()
The objects of this class are cloneable with this method.
Usage
ParallelWorld$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
## ------------------------------------------------
## Method `ParallelWorld$new`
## ------------------------------------------------
backdoor_parallel <- ParallelWorld$new(
backdoor,
dolist=list(
list(target = "x",
ifunction = 0),
list(target = list("z","x"),
ifunction = list(1,0))
)
)
backdoor_parallel
plot(backdoor_parallel)