GaussL0penIntScore-class: Class '"GaussL0penIntScore"'

Description Details Extends Fields Constructor Methods Author(s) See Also Examples

Description

This class represents a score for causal inference from jointly interventional and observational Gaussian data; it is used in the causal inference functions gies and simy.

Details

The class implements an ℓ0-penalized Gaussian maximum likelihood estimator. The penalization is a constant (specified by the argument lambda in the constructor) times the number of parameters of the DAG model. By default, the constant λ is chosen as log(n)/2, which corresponds to the BIC score.

Extends

Class "Score", directly.

All reference classes extend and inherit methods from "envRefClass".

Fields

The class GaussL0penIntScore has the same fields as Score. They need not be accessed by the user.

Constructor

1
2
3
4
5
6
7
8
new("GaussL0penIntScore",
  data = matrix(1, 1, 1),
  targets = list(integer(0)), 
  target.index = rep(as.integer(1), nrow(data)), 
  lambda = 0.5*log(nrow(data)), 
  intercept = FALSE, 
  use.cpp = TRUE, 
  ...)
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.

lambda

Penalization constant (cf. details)

intercept

Indicates whether an intercept is allowed in the linear structural equations, or, equivalently, if a mean different from zero is allowed for the observational distribution.

use.cpp

Indicates whether the calculation of the score should be done by the C++ library of the package, which speeds up calculation. This parameter should only be set to FALSE in the case of problems.

Methods

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

Calculates the local score of a vertex and its parents. Since this score has no obvious interpretation, it is rather for internal use.

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 an object of a class derived from ParDAG.

local.mle(vertex, parents, ...)

Calculates the local MLE of a vertex and its parents. The result is a vector of parameters encoded as follows:

  • First element: variance of the Gaussian error term

  • Second element: intercept

  • Following elements: regression coefficients; one per parent vertex

global.mle(dag, ...)

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

Author(s)

Alain Hauser ([email protected])

See Also

gies, simy, GaussL0penObsScore, Score

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
##################################################
## Using Gaussian Data
##################################################
## Load predefined data
data(gmInt)

## Define the score object
score <- new("GaussL0penIntScore", gmInt$x, gmInt$targets, gmInt$target.index) 

## Score of the true underlying DAG
score$global.score(as(gmInt$g, "GaussParDAG"))

## Score of the DAG that has only one edge from 1 to 2
A <- matrix(0, ncol(gmInt$x), ncol(gmInt$x))
A[1, 2] <- 1
score$global.score(as(A, "GaussParDAG"))
## (Note: this is lower than the score of the true DAG.)

Example output

[1] -19069.23
[1] -25004.03

pcalg documentation built on June 5, 2018, 1:05 a.m.