matSPACE: Estimate row/column precision matrices for...

View source: R/matSPACE.R

matSPACER Documentation

Estimate row/column precision matrices for Kronecker-structured (matrix-variate) SPACE, with identifiability resolved

Description

Fits space() independently on the data (for the column precision V, q x q) and on the transposed data (for the row precision U, p x p), each over a lasso penalty path, selects the BIC-minimizing lambda for U and for V separately at every scaling factor in sf_vec, and reconstructs the corresponding precision matrices (via precision_from_parcor()). Because the Kronecker product kronecker(V, U) is invariant under ⁠(V / c, U * c)⁠ for any c > 0, the pair is not separately identifiable from the data; the result is rescaled so that V[1, 1] == 1, using c equal to the raw fitted V[1, 1] (U is multiplied by that same c), which preserves kronecker(V, U) exactly.

Usage

matSPACE(
  data,
  lambda_V = NULL,
  lambda_U = NULL,
  K = 30,
  f_type_V = "equal",
  f_type_U = "equal",
  sf_vec = c(1, 1.5)
)

Arguments

data

list of n matrices, each p x q; the matrix-variate observations, in the same format expected by the data argument of space().

lambda_V

optional numeric vector of lasso penalties to use for the column (V, q x q) fit. If NULL (default), generated via lambda.bound() on data with K values.

lambda_U

optional numeric vector of lasso penalties to use for the row (U, p x p) fit. If NULL (default), generated via lambda.bound() on the transposed data with K values.

K

number of lambda values to generate with lambda.bound() when lambda_V or lambda_U is NULL. Ignored for whichever of the two is supplied directly.

f_type_V

column weighting scheme forwarded to space() for the V fit; see compute_weight().

f_type_U

column weighting scheme forwarded to space() for the U fit; see compute_weight().

sf_vec

numeric vector of BIC scaling factors (the sf argument of compute_BIC()). A separate BIC-minimizing lambda — and resulting identifiability-resolved ⁠(U, V)⁠ pair — is returned for each value.

Value

A named list, one element per value of sf_vec (named ⁠sf_<value>⁠), each a list with components:

V

q x q precision matrix at the BIC-minimizing lambda_V, rescaled so V[1, 1] == 1.

U

p x p precision matrix at the BIC-minimizing lambda_U, rescaled by the same factor to preserve kronecker(V, U).

lambda_V, lambda_U

the BIC-minimizing lambda for V and U at this sf.

BIC_V, BIC_U

the corresponding minimum BIC values.

sf

the scaling factor this element was selected at.

The full lambda paths behind this selection are attached as a "path" attribute (attr(fit, "path")), a list with V and U components, each with fits (the raw space() fit at every lambda tried), bic (a length(lambda) x length(sf_vec) matrix, named ⁠sf_<value>⁠), and lambda. Useful for plotting BIC (or the number of nonzero edges, from fits[[i]]$ParCor) against lambda without refitting.

Examples

set.seed(1)
p <- 4; q <- 3; n <- 3
data <- replicate(n, matrix(rnorm(p * q), p, q), simplify = FALSE)
fit <- matSPACE(data, K = 5, sf_vec = c(1, 1.5))
fit$sf_1$V
fit$sf_1$U
path <- attr(fit, "path")
plot(path$V$lambda, path$V$bic[, "sf_1"], type = "b")

matSPACE documentation built on Sept. 12, 2026, 5:10 p.m.