ParallelWorld | R Documentation |
R6 Class for parallel world models
R6 Class for parallel world models
Inherits R6 class SCM.
R6causal::SCM
-> ParallelWorld
num_worlds
Number of parallel worlds.
worldnames
Names of parallel worlds.
worldsuffix
Suffix used for parallel world variables.
originalscm
SCM from which the parallel worlds are derived.
dolist
List containing the interventions for each world.
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()
new()
Create a new ParallelWorld object from an SCM object.
ParallelWorld$new(scm, dolist, worldnames = NULL, worldsuffix = "_")
scm
An SCM object.
dolist
A 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.
worldnames
A character vector giving the names of the parallel worlds.
worldsuffix
A text giving the suffix used for parallel world variables before the world number. Defaults to "_" and the worlds have then suffixes "_1", "_2", "_3", ...
A new 'ParallelWorld' object that also belongs to class 'SCM'.
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)
clone()
The objects of this class are cloneable with this method.
ParallelWorld$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.