ParDAG-class {pcalg} | R Documentation |
Class "ParDAG"
of Parametric Causal Models
Description
This virtual base class represents a parametric causal model.
Details
The class "ParDAG"
serves as a basis for simulating observational
and/or interventional data from causal models as well as for parameter
estimation (maximum-likelihood estimation) for a given causal model in the
presence of a data set with jointly observational and interventional data.
The virtual base class "ParDAG"
provides a “skeleton” for all
functions relied to the aforementioned task. In practical cases, a user may
always choose an appropriate class derived from ParDAG
which
represents a specific parametric model class. The base class itself does
not represent such a model class.
Constructor
new("ParDAG", nodes, in.edges, params)
nodes
Vector of node names; cf. also field
.nodes
.in.edges
A list of length
p
consisting of index vectors indicating the edges pointing into the nodes of the DAG.params
A list of length
p
consisting of parameter vectors modeling the conditional distribution of a node given its parents; cf. also field.params
.
Fields
.nodes
:Vector of node names; defaults to
as.character(1:p)
, wherep
denotes the number of nodes (variables) of the model..in.edges
:A list of length
p
consisting of index vectors indicating the edges pointing into the nodes of the DAG..params
:A list of length
p
consisting of parameter vectors modeling the conditional distribution of a node given its parents. The entries of the parameter vectors only get a concrete meaning in derived classes belonging to specific parametric model classes.
Class-Based Methods
node.count()
:Yields the number of nodes (variables) of the model.
simulate(n, target, int.level)
:Generates
n
(observational or interventional) samples from the parametric causal model. The intervention target to be used is specified by the parametertarget
; if the target is empty (target = integer(0)
), observational samples are generated.int.level
indicates the values of the intervened variables; if it is a vector of the same length astarget
, all samples are drawn from the same intervention levels; if it is a matrix withn
rows and as many columns astarget
has entries, its rows are interpreted as individual intervention levels for each sample.edge.count()
:Yields the number of edges (arrows) in the DAG.
mle.fit(score)
:Fits the parameters using an appropriate
Score
object.
Methods
- plot
signature(x = "ParDAG", y = "ANY")
: plots the underlying DAG of the causal model. Parameters are not visualized.
Author(s)
Alain Hauser (alain.hauser@bfh.ch)