gausCorScore {causalDisco}R Documentation

Gaussian L0 score computed on correlation matrix

Description

The score is intended to be used with score-based causal discovery algorithms from the pcalg package. It is identical to the GaussL0penObsScore-class, except that it takes in a correlation matrix instead of the full data set. GaussL0penObsScore-class.

Usage

gausCorScore(cormat, n, p = NULL, lambda = NULL, ...)

Arguments

cormat

A correlation matrix. Needs to be symmetric.

n

The number of observations in the dataset that the correlation matrix was computed from.

p

The number of variables. This is inferred from the cormat if not supplied.

lambda

Penalty to use for the score. If NULL (default), the BIC score penalty is used. See GaussL0penObsScore-class for further details.

...

Other arguments passed along to GaussL0penObsScore-class.

Value

A Score object (S4), see Score-class.

Examples

# Simulate data and compute correlation matrix
x1 <- rnorm(100)
x2 <- rnorm(100)
x3 <- x1 + x2 + rnorm(100)
d <- data.frame(x1, x2, x3)
cmat <- cor(d)

# Use gausCorScore with pcalg::ges() 
pcalg::ges(gausCorScore(cmat, n = 100))



[Package causalDisco version 0.9.1 Index]