Description Usage Arguments Details Value Examples
View source: R/cor_mat_estimators.R
The function uses the GLASSAO algorithm implemented in the glassoFast package to estimate a precision matrix robustly with a conditional independence structure specified by adj_mat
.
1 | robust_sparse_precision(x, adj_mat, sparse = TRUE)
|
x |
An n x p data matrix where each row is an observation vector. |
adj_mat |
A p x p adjacency matrix. See details. |
sparse |
A logical specifying whether the returned estimate should be a sparse matrix from the Matrix package or not. |
The function adjacency_mat
can be used to generate an adjacency matrix from a list containing the neighbours of variable i in list[[i]].
Moreover, the functions banded_neighbours
, lattice_neighbours
, random_neighbours
can be used to generate such lists of neighbours for banded, lattice and random adjacency structures.
A precision matrix.
1 2 | x <- simulate_cor()$x
Q <- robust_sparse_precision(x, adjacency_mat(banded_neighbours(2, ncol(x)), sparse = FALSE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.