| Title: | Distributed ADMM for High-Dimensional Static Factor Models |
|---|---|
| Description: | Distributed Alternating Direction Method of Multipliers (ADMM) algorithms for high-dimensional static factor models. It provides a suite of distributed statistical estimators, including centralized Principal Component Analysis (PCA, C-PCA), distributed offline Principal Component Analysis (D-PCA), distributed online Expectation-Maximization (EM, D-EM), standard distributed Alternating Direction Method of Multipliers (S-ADMM), and the proposed penalized distributed online Alternating Direction Method of Multipliers (ADMM) with Lasso sparsity regularization. Trace-enabled versions of all algorithms are implemented to record the Frobenius estimation error and augmented Lagrangian values across iterations for convergence diagnosis. This package is suitable for large-scale high-dimensional data distributed over multiple computing nodes, where raw data cannot be gathered onto a single machine. It offers flexible simulation tools to generate static factor model data with sparse loadings and weak temporal dependence. The methodology of 'factorDistADMM' is described in Guo G. (2026) <doi:10.1016/j.jmva.2026.105688>. |
| Authors: | Guangbao Guo [aut, cre] (ORCID: <https://orcid.org/0000-0002-4115-6218>) |
| Maintainer: | Guangbao Guo <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.6 |
| Built: | 2026-11-25 18:30:18 UTC |
| Source: | https://github.com/cran/factorDistADMM |
This function performs centralized principal component analysis for a static high-dimensional factor model.
C_PCA(X, r)C_PCA(X, r)
X |
Observation matrix with dimension |
r |
Number of common factors. |
A list containing:
A_hat: The estimated factor loading matrix
of dimension .
X <- matrix(stats::rnorm(100 * 10), nrow = 100, ncol = 10) res_cpca <- C_PCA(X, r = 3)X <- matrix(stats::rnorm(100 * 10), nrow = 100, ncol = 10) res_cpca <- C_PCA(X, r = 3)
Distributed online EM for static factor model, following Gimenez-Febrer et al. 2020. No explicit Lasso penalty.
D_EM(node_datasets, r, step_size = 0.01, max_iter = 100)D_EM(node_datasets, r, step_size = 0.01, max_iter = 100)
node_datasets |
A list. Each node contains submatrix, original row index. |
r |
Number of common factors. |
step_size |
Step size for online gradient update, default 0.01. |
max_iter |
Maximum number of iterations, default 100. |
A list containing:
: estimated factor loadings matrix.
X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) node_data <- split_distributed_data(X, K_n = 5) res_dem <- D_EM(node_data, r = 3, step_size = 0.01, max_iter = 50)X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) node_data <- split_distributed_data(X, K_n = 5) res_dem <- D_EM(node_data, r = 3, step_size = 0.01, max_iter = 50)
Distributed offline PCA for factor model. Local covariance is computed at each node, then aggregated at the central server.
D_PCA(node_datasets, r)D_PCA(node_datasets, r)
node_datasets |
A list. Each node contains submatrix, original row index. |
r |
Number of common factors. |
A list containing:
: estimated factor loadings matrix.
X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) node_data <- split_distributed_data(X, K_n = 5) res_dpca <- D_PCA(node_data, r = 3)X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) node_data <- split_distributed_data(X, K_n = 5) res_dpca <- D_PCA(node_data, r = 3)
Compute the Frobenius norm of matrix :
frobenius_norm(M)frobenius_norm(M)
M |
A numeric matrix |
A scalar value of Frobenius norm
The proposed method with Lasso penalty, soft-thresholding, stochastic approximation, simple outlier truncation and optimal weighted fusion.
Ours_Dist_Online_ADMM(node_datasets, r, lambda, rho = 1, max_iter = 80)Ours_Dist_Online_ADMM(node_datasets, r, lambda, rho = 1, max_iter = 80)
node_datasets |
A list. Each node contains |
r |
Number of common factors. |
lambda |
Lasso sparsity tuning parameter, default 0.15. |
rho |
ADMM penalty parameter, default 1.0. |
max_iter |
Maximum number of iterations, default 80. |
A list containing:
: estimated factor loadings matrix.
X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) node_data <- split_distributed_data(X, K_n = 5) res_ours <- Ours_Dist_Online_ADMM(node_data, r = 3, lambda = 0.15, rho = 1.0, max_iter = 50)X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) node_data <- split_distributed_data(X, K_n = 5) res_ours <- Ours_Dist_Online_ADMM(node_data, r = 3, lambda = 0.15, rho = 1.0, max_iter = 50)
Extended version of the proposed distributed online ADMM. It includes Lasso penalty, soft-thresholding, Robbins-Monro stochastic approximation, simple outlier truncation and optimal weighted fusion. This variant records iteration-wise Frobenius estimation error and augmented Lagrangian value for convergence analysis.
Ours_Dist_Online_ADMM_trace( node_datasets, A_true, r, lambda = 0.12, rho = 1, max_iter = 150 )Ours_Dist_Online_ADMM_trace( node_datasets, A_true, r, lambda = 0.12, rho = 1, max_iter = 150 )
node_datasets |
A list. Each node contains |
A_true |
|
r |
Number of common factors. |
lambda |
Lasso sparsity tuning parameter, default 0.12. |
rho |
ADMM penalty parameter, default 1.0. |
max_iter |
Maximum number of iterations, default 150. |
A list containing:
: estimated factor loadings matrix.
: A data frame storing iteration history, including iteration index, Frobenius estimation error and augmented Lagrangian.
X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) node_data <- split_distributed_data(X, K_n = 5) A_true <- matrix(rnorm(100 * 3), nrow = 100, ncol = 3) res_trace <- Ours_Dist_Online_ADMM_trace( node_data, A_true, r = 3, lambda = 0.12, rho = 1.0, max_iter = 50 )X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) node_data <- split_distributed_data(X, K_n = 5) A_true <- matrix(rnorm(100 * 3), nrow = 100, ncol = 3) res_trace <- Ours_Dist_Online_ADMM_trace( node_data, A_true, r = 3, lambda = 0.12, rho = 1.0, max_iter = 50 )
Standard distributed ADMM minimizing negative log-likelihood. No Lasso sparsity penalty, no stochastic approximation, no outlier trimming.
S_ADMM(node_datasets, r, rho = 1, max_iter = 80)S_ADMM(node_datasets, r, rho = 1, max_iter = 80)
node_datasets |
A list. Each node contains submatrix, original row index. |
r |
Number of common factors. |
rho |
ADMM penalty parameter, default 1.0. |
max_iter |
Maximum number of iterations, default 80. |
A list containing:
: estimated factor loadings matrix.
X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) node_data <- split_distributed_data(X, K_n = 5) res_sadmm <- S_ADMM(node_data, r = 3, rho = 1.0, max_iter = 50)X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) node_data <- split_distributed_data(X, K_n = 5) res_sadmm <- S_ADMM(node_data, r = 3, rho = 1.0, max_iter = 50)
Extended trace-recording version of the standard distributed ADMM baseline. It minimizes the negative log-likelihood without sparsity penalty, using local gradient iterations and simple averaging fusion across nodes. This function records Frobenius estimation error and augmented Lagrangian value at each iteration for convergence diagnosis.
S_ADMM_trace(node_datasets, A_true, r, rho = 1, max_iter = 150)S_ADMM_trace(node_datasets, A_true, r, rho = 1, max_iter = 150)
node_datasets |
A list. Each node contains |
A_true |
|
r |
Number of common factors. |
rho |
ADMM penalty parameter, default 1.0. |
max_iter |
Maximum number of iterations, default 150. |
A list containing:
: estimated factor loadings matrix.
: A data frame storing iteration history, including iteration index, Frobenius estimation error and augmented Lagrangian.
X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) node_data <- split_distributed_data(X, K_n = 5) A_true <- matrix(rnorm(100 * 3), nrow = 100, ncol = 3) res_trace <- S_ADMM_trace(node_data, A_true, r = 3, rho = 1.0, max_iter = 50)X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) node_data <- split_distributed_data(X, K_n = 5) A_true <- matrix(rnorm(100 * 3), nrow = 100, ncol = 3) res_trace <- S_ADMM_trace(node_data, A_true, r = 3, rho = 1.0, max_iter = 50)
Generates data from static high-dimensional factor model:
, where .
sim_static_factor(n, r, T_sample, sparse_ratio, noise_decay)sim_static_factor(n, r, T_sample, sparse_ratio, noise_decay)
n |
Number of observed dimensions |
r |
Number of common factors |
T_sample |
Time series sample size |
sparse_ratio |
Proportion of zero elements in the loadings matrix A; 0.3 in the paper |
noise_decay |
Geometric decay coefficient for the noise over time (0 < d < 1), inducing weak dependence; d = 0 corresponds to independent noise |
A list containing the simulated data and true model parameters:
X |
|
A_true |
|
F_true |
|
V_list |
List of length |
v |
|
# Generate simulated data from static high-dimensional factor model sim_data <- sim_static_factor(n = 100, r = 5, T_sample = 2000, sparse_ratio = 0.3, noise_decay = 0.7) # Extract observation matrix and true parameters X <- sim_data$X A_true <- sim_data$A_true F_true <- sim_data$F_true# Generate simulated data from static high-dimensional factor model sim_data <- sim_static_factor(n = 100, r = 5, T_sample = 2000, sparse_ratio = 0.3, noise_decay = 0.7) # Extract observation matrix and true parameters X <- sim_data$X A_true <- sim_data$A_true F_true <- sim_data$F_true
Element-wise soft-thresholding function widely used in the Alternating Direction Method of Multipliers (ADMM) for Lasso sparsity regularization.
soft_thresh(x, lambda)soft_thresh(x, lambda)
x |
numeric matrix or vector, input to be thresholded |
lambda |
Non-negative numeric scalar, thresholding parameter. |
Numeric matrix or vector with the same dimension and class as input x.
Each element is calculated as sign(x) * pmax(abs(x) - lambda, 0).
Elements with absolute value less than lambda are shrunk to zero.
x <- matrix(rnorm(10), nrow = 5) soft_thresh(x, lambda = 0.2)x <- matrix(rnorm(10), nrow = 5) soft_thresh(x, lambda = 0.2)
row blocks for distributed computingSplit the high-dimensional observation matrix row-wise into submatrices,
which can be used for distributed factor analysis.
split_distributed_data(X, K_n = 5)split_distributed_data(X, K_n = 5)
X |
Observation matrix with dimension |
K_n |
Number of row partitions (computing nodes). Default is 5. |
A list of length . Each element is a list containing:
: submatrix of on the corresponding row block;
: original row indices of this block.
# Generate test matrix X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) # Split into 5 row partitions node_data <- split_distributed_data(X, K_n = 5) # Check the number of partitions length(node_data)# Generate test matrix X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10) # Split into 5 row partitions node_data <- split_distributed_data(X, K_n = 5) # Check the number of partitions length(node_data)