| matSPACE | R Documentation |
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.
matSPACE(
data,
lambda_V = NULL,
lambda_U = NULL,
K = 30,
f_type_V = "equal",
f_type_U = "equal",
sf_vec = c(1, 1.5)
)
data |
list of n matrices, each p x q; the matrix-variate
observations, in the same format expected by the |
lambda_V |
optional numeric vector of lasso penalties to use for
the column ( |
lambda_U |
optional numeric vector of lasso penalties to use for
the row ( |
K |
number of lambda values to generate with |
f_type_V |
column weighting scheme forwarded to |
f_type_U |
column weighting scheme forwarded to |
sf_vec |
numeric vector of BIC scaling factors (the |
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 |
U |
p x p precision matrix at the BIC-minimizing |
lambda_V, lambda_U |
the BIC-minimizing lambda for |
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.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.