Skip to contents

This function is exactly zero if and only if the matrix is a DAG. The gradient is the gradient of the log-determinant acyclicity characterization is also zero exactly when the matrix is a DAG.

Usage

h_logdet(X, s = 1, transform = c("square", "abs"))

h_logdet_grad(X, s = 1)

Arguments

X

a matrix

s

a regularization parameter. Should be larger than spectral radius (largest absolute eigenvalue) of X.

Value

numeric

Details

From Bello, K., Aragam, B., & Ravikumar, P. (2023).

Examples

B <- matrix(c(0, 0.6, -0.5, 0), nrow = 2, byrow = TRUE)
h_logdet(B) # Not a DAG means > 0
#> [1] 0.09431068
B_dag <- matrix(c(0,0,1,0), nrow = 2, byrow = TRUE)
h_logdet(B_dag) # DAG means 0
#> [1] 0