Learn R Programming

pcalg (version 2.7-12)

Score-class: Virtual Class "Score"

Description

This virtual base class represents a score for causal inference; it is used in the causal inference functions ges, gies and simy.

Arguments

Fields

The fields of Score are mainly of interest for users who aim at deriving an own class from this virtual base class, i.e., implementing an own score function.

.nodes:

Node labels. They are passed to causal inference methods by default to label the nodes of the resulting graph.

decomp:

Indicates whether the represented score is decomposable (cf. details). At the moment, only decomposable scores are supported by the implementation of the causal inference algorithms; support for non-decomposable scores is planned.

pp.dat:

List representing the preprocessed input data; this is typically a statistic which is sufficient for the calculation of the score.

.pardag.class:

Name of the class of the parametric DAG model corresponding to the score. This must name a class derived from ParDAG.

c.fcn:

Only used internally; must remain empty for (user specified) classes derived from Score.

Constructor


new("Score",
  data = matrix(1, 1, 1), 
  targets = list(integer(0)),
  target.index = rep(as.integer(1), nrow(data)), 
  nodes = colnames(data),
  ...)

data

Data matrix with \(n\) rows and \(p\) columns. Each row corresponds to one realization, either interventional or observational.

targets

List of mutually exclusive intervention targets that have been used for data generation.

target.index

Vector of length \(n\); the \(i\)-th entry specifies the index of the intervention target in targets under which the \(i\)-th row of data was measured.

nodes

Node labels

...

Additional parameters used by derived (and non-virtual) classes.

Methods

Note that since Score is a virtual class, its methods cannot be called directly, but only on derived classes.

local.score(vertex, parents, ...)

For decomposable scores, this function calculates the local score of a vertex and its parents. Must throw an error in derived classes that do not represent a decomposable score.

global.score.int(edges, ...)

Calculates the global score of a DAG, represented as a list of in-edges: for each vertex in the DAG, this list contains a vector of parents.

global.score(dag, ...)

Calculates the global score of a DAG, represented as object of a class derived from ParDAG.

local.fit(vertex, parents, ...)

Calculates a local model fit of a vertex and its parents, e.g. by MLE. The result is a vector of parameters whose meaning depends on the model class; it matches the convention used in the corresponding causal model (cf. .pardag.class).

global.fit(dag, ...)

Calculates the global MLE of a DAG, represented by an object of the class specified by .pardag.class. The result is a list of vectors, one per vertex, each in the same format as the result vector of local.mle.

Author

Alain Hauser (alain.hauser@bfh.ch)

Details

Score-based structure learning algorithms for causal inference such as Greedy Equivalence Search (GES, implemented in the function ges), Greedy Interventional Equivalence Search (GIES, implemented in the function gies) and the dynamic programming approach of Silander and Myllymäki (2006) (implemented in the function simy) try to find the DAG model which maximizes a scoring criterion for a given data set. A widely-used scoring criterion is the Bayesian Information Criterion (BIC).

The virtual class Score is the base class for providing a scoring criterion to the mentioned causal inference algorithms. It does not implement a concrete scoring criterion, but it defines the functions that must be provided by its descendants (cf. methods).

Knowledge of this class is only required if you aim to implement an own scoring criterion. At the moment, it is recommended to use the predefined scoring criteria for multivariate Gaussian data derived from Score, GaussL0penIntScore and GaussL0penObsScore.

References

T. Silander and P. Myllymäki (2006). A simple approach for finding the globally optimal Bayesian network structure. Proceedings of the 22nd Conference on Uncertainty in Artificial Intelligence (UAI 2006), 445--452

See Also

ges, gies, simy, GaussL0penIntScore, GaussL0penObsScore