constrained: Constrained Precision Matrix

Description Usage Arguments Value Note References Examples

View source: R/constrained.R

Description

Compute the maximum likelihood estimate, given certain elements are constrained to zero (e.g., an adjacency matrix). This approach is described in \insertCitehastie2009elements;textualGGMnonreg.

Usage

1
constrained(Sigma, adj)

Arguments

Sigma

Covariance matrix

adj

Matrix with constraints. A zero indicates that element should be constrained to zero.

Value

A list containing the inverse covariance matrix and the covariance matrix.

Note

The algorithm is written in c++.

References

\insertAllCited

Examples

1
2
3
4
5
6
7
8
# data
Y <- ptsd

# estimate graph
fit <- ggm_inference(Y, boot = FALSE)

# constrain to zero
constrained_graph <- constrained(cor(Y), fit$adj)

GGMnonreg documentation built on April 8, 2021, 5:06 p.m.