| Title: | Sparse Partial Correlation Estimation for Matrix-Variate Data |
| Version: | 0.1.0 |
| Description: | Fits sparse partial correlation networks for matrix-variate data by extending the SPACE joint partial correlation estimation framework to a Kronecker-product covariance structure. All partial correlations are estimated simultaneously via an L1-penalized ('lasso') shooting algorithm within a single optimization framework, which preserves symmetry of the estimated network and avoids the tuning-parameter selection difficulties of separate node-wise regressions. Optional features include column reweighting, residual variance re-estimation across outer iterations, and automatic generation of a lasso penalty sequence for tuning. |
| License: | GPL (≥ 3) |
| Encoding: | UTF-8 |
| LinkingTo: | Rcpp |
| Imports: | Rcpp, stats |
| Config/roxygen2/version: | 8.1.0 |
| URL: | https://github.com/kimhyew1/matSPACE |
| BugReports: | https://github.com/kimhyew1/matSPACE/issues |
| NeedsCompilation: | yes |
| Packaged: | 2026-09-03 06:37:58 UTC; User |
| Author: | Hyewon Kim [aut, cre], Seongoh Park [aut] |
| Maintainer: | Hyewon Kim <kimhw4126@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-09-12 13:40:09 UTC |
matSPACE: Sparse Partial Correlation Estimation for Matrix-Variate Data
Description
Fits a sparse network of partial correlations among the columns of
matrix-variate data using an L1-penalized (lasso) SPACE-style shooting
algorithm, with optional per-column reweighting and residual variance
re-estimation across outer iterations. See space() for the main
model-fitting function.
Author(s)
Maintainer: Hyewon Kim kimhw4126@gmail.com
Authors:
Hyewon Kim kimhw4126@gmail.com
Seongoh Park seongohpark6@gmail.com
See Also
Useful links:
Generate a log-spaced lasso penalty sequence for space()
Description
Computes a decreasing, log-spaced sequence of K candidate lasso
penalties (lam values) for tuning space(), analogous to the
lambda_max-based grids used in lasso path algorithms. The largest
value, lambda_max, is the largest off-diagonal entry of a
variance-rescaled Gram matrix — the smallest penalty above which every
off-diagonal partial correlation coefficient is driven to zero; the
sequence descends geometrically to lambda_max * eps.
Usage
lambda.bound(dt, eps = 1e-06, K = 30)
Arguments
dt |
list of n matrices, each p x q, in the same format expected
by the |
eps |
ratio of the smallest to the largest penalty in the
returned sequence, i.e. |
K |
number of penalty values to generate. |
Value
A numeric vector of length K, decreasing geometrically from
lambda_max to lambda_max * eps, suitable to pass one at a time
as the lam argument of space() (e.g. selecting among the fits
with a BIC-type criterion).
Examples
set.seed(1)
p <- 5; q <- 4; n <- 3
data <- replicate(n, matrix(rnorm(p * q), p, q), simplify = FALSE)
lambda.bound(data, K = 10)
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 |
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 |
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 |
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.
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")
Fit a matrix-variate SPACE sparse partial correlation model
Description
Estimates a sparse network of partial correlations among the q columns
of matrix-variate data using an L1-penalized (lasso) SPACE-style
shooting algorithm, with optional per-column reweighting and residual
variance (sig) re-estimation across outer iterations.
Usage
space(
data,
lam,
sig = NULL,
f_type = "equal",
iter = 2,
beta_init = NULL,
sig_init = NULL
)
Arguments
data |
list of n matrices, each p × q. All matrices share the same p × q shape; n is the number of independent replicates and the q columns are the variables whose pairwise partial correlations are estimated. |
lam |
lasso penalty applied to the off-diagonal partial correlation coefficients. |
sig |
optional length-q sigma vector; NULL = iterative estimate |
f_type |
"equal" | "variance" | "degree" |
iter |
number of outer iterations |
beta_init |
optional warm-start for beta: a q x q matrix/flat vector
(row-major, i*q+j layout) forwarded to the first internal
|
sig_init |
optional length-q warm-start for the STARTING value of
SIG when SIG.update = TRUE (i.e. sig = NULL). Unlike
|
Value
A list with components:
ParCor |
q x q matrix of estimated partial correlations (diagonal = 1). |
beta |
q x q matrix of estimated regression coefficients. |
sig |
length-q vector of estimated column residual precisions (1/variance). |
f |
length-q vector of final per-column weights. |
total_iter |
total number of shooting iterations across all outer iterations. |
E |
list of n residual matrices (p x q each). |
Examples
set.seed(1)
p <- 5; q <- 4; n <- 3
data <- replicate(n, matrix(rnorm(p * q), p, q), simplify = FALSE)
fit <- space(data, lam = 0.1, iter = 1)
fit$ParCor