# # Example of a generalized_inverse
# X <- rbind(1:3, 2*(1:3), c(1,0,1))
# solve(X)  # Error
# MASS::ginv(X)
# X
# X %*% MASS::ginv(X) %*% X

# Conditional independence and the precision matrix
n <- 100000
x <- rnorm(n)
y <- x + rnorm(n)
z <- y + rnorm(n)
cbind(x, y, z) |> cor()
cbind(x, y, z) |> cor() |> solve()

