| Title: | Structured Covariances Estimators for Pairwise and Spatial Covariates |
|---|---|
| Description: | Implements estimators for structured covariance matrices in the presence of pairwise and spatial covariates. Metodiev, Perrot-Dockès, Ouadah, Fosdick, Robin, Latouche & Raftery (2026) <doi:10.1214/26-AOAS2183>. |
| Authors: | Martin Metodiev [aut, cre, cph] (ORCID: <https://orcid.org/0009-0000-9432-3756>), Marie Perrot-Dockès [aut], Stéphane Robin [aut] |
| Maintainer: | Martin Metodiev <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 2.0.0 |
| Built: | 2026-10-18 08:38:06 UTC |
| Source: | https://github.com/m-metodiev/scov |
This function computes the WSCE, SCE or IVE estimator for large covariances in the presence of pairwise and spatial covariates from Metodiev et al. (2026).
scov( pairwise_covariate_matrices, dataset, adj_matrix = NULL, mean_estim = NULL, sd_estim = NULL, grid_size = 100, parallelize = FALSE, ncores = 8, adj_positions = 1:nrow(adj_matrix), interaction_effects = list(), init = NULL, use_bootstrap = FALSE, num_bootstrap_iters = 100, semiparametric = FALSE, misspecification = FALSE, seed = 0, verbose = TRUE, joint_estimation = FALSE )scov( pairwise_covariate_matrices, dataset, adj_matrix = NULL, mean_estim = NULL, sd_estim = NULL, grid_size = 100, parallelize = FALSE, ncores = 8, adj_positions = 1:nrow(adj_matrix), interaction_effects = list(), init = NULL, use_bootstrap = FALSE, num_bootstrap_iters = 100, semiparametric = FALSE, misspecification = FALSE, seed = 0, verbose = TRUE, joint_estimation = FALSE )
pairwise_covariate_matrices |
named list of square matrices |
dataset |
the dataset given in matrix form |
adj_matrix |
adjacency matrix of the spatial covariate |
mean_estim |
mean vector estimate |
sd_estim |
standard deviation vector estimate |
grid_size |
grid-size for spatial effect |
parallelize |
uses parallel-processing if TRUE |
ncores |
number of cores for the parallelization |
adj_positions |
positions within the adjacency matrix |
interaction_effects |
list of interaction effects |
init |
the initialization parameter vector |
use_bootstrap |
uses bootstrapping if TRUE |
num_bootstrap_iters |
number of bootstrap simulations |
semiparametric |
computes the IVE if TRUE, the SCE else |
misspecification |
computes the WSCE if TRUE, the WSCE else |
seed |
a seed (can't be set to NULL) |
verbose |
prints progress if TRUE |
joint_estimation |
estimates everything jointly if TRUE, uses a 2 step procedure if FALSE |
Returns a named list with the following elements:
parm, estimated parameters of pairwise, spatial effects average_effects, average effects of the covariates corrmat_estim, estimator of the correlation matrix covmat_estim, estimator of the covariance matrix bic, the Bayesian information criterion (BIC) lambda, the asymptotically optimal weight of the WSCE
Martin Metodiev. Marie Perrot-Dockès. Sarah Ouadah. Bailey K. Fosdick. Stéphane Robin. Pierre Latouche. Adrian E. Raftery. "A structured estimator for large covariance matrices in the presence of pairwise and spatial covariates." Ann. Appl. Stat. 20 (2) 1736 - 1765, June 2026.
intercept = matrix(1,ncol=4,nrow=4) X1 = rbind(c(1,1,1,0),c(1,1,1,0),c(1,1,1,0),c(0,0,0,1)) X2 = rbind(c(1,0,0,0),c(0,1,1,1),c(0,1,1,1),c(0,1,1,1)) covar_mats = list(intercept=intercept,X1=X1,X2=X2) adj_matrix = rbind(c(0,1,0,0),c(1,0,0,0),c(0,0,0,1),c(0,0,1,0)) mean = rep(0,4) sigma = 0.05*intercept+0.2*X1+0.2*X2+0.1*X2*X1+0.4*(diag(4) + adj_matrix) diag(sigma) = 1 dataset = mvtnorm::rmvnorm(1000,mean=mean,sigma=sigma) scov(covar_mats, dataset, adj_matrix, interaction_effects=list(c("X1","X2")), parallelize=FALSE,ncores=1)intercept = matrix(1,ncol=4,nrow=4) X1 = rbind(c(1,1,1,0),c(1,1,1,0),c(1,1,1,0),c(0,0,0,1)) X2 = rbind(c(1,0,0,0),c(0,1,1,1),c(0,1,1,1),c(0,1,1,1)) covar_mats = list(intercept=intercept,X1=X1,X2=X2) adj_matrix = rbind(c(0,1,0,0),c(1,0,0,0),c(0,0,0,1),c(0,0,1,0)) mean = rep(0,4) sigma = 0.05*intercept+0.2*X1+0.2*X2+0.1*X2*X1+0.4*(diag(4) + adj_matrix) diag(sigma) = 1 dataset = mvtnorm::rmvnorm(1000,mean=mean,sigma=sigma) scov(covar_mats, dataset, adj_matrix, interaction_effects=list(c("X1","X2")), parallelize=FALSE,ncores=1)