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)

donaldRwilliams/GGMnonreg documentation built on May 13, 2021, 11:57 a.m.