YunyiShen / vsp

Vintage Sparse PCA for Semi-Parametric Network Analysis

Home Page:https://rohelab.github.io/vsp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vsp

Codecov test coverage R build status

The goal of vsp is to enable fast, spectral estimation of latent factors in random dot product graphs. Under mild assumptions, the vsp estimator is consistent for (degree-corrected) stochastic blockmodels, (degree-corrected) mixed-membership stochastic blockmodels, and degree-corrected overlapping stochastic blockmodels.

More generally, the vsp estimator is consistent for random dot product graphs that can be written in the form

E(A) = Z B Y^T

where Z and Y satisfy the varimax assumptions of [1]. vsp works on directed and undirected graphs, and on weighted and unweighted graphs. Note that vsp is a semi-parametric estimator.

Installation

You can install the development version of vsp with:

install.packages("devtools")
devtools::install_github("RoheLab/vsp")

Example

Obtaining estimates from vsp is straightforward. We recommend representing networks as igraph objects or (sparse) Matrix objects from the Matrix package (see also ?Matrix).

Once you have your network in one of these formats, you can get estimates by calling the vsp() function. The result is an object of class "vsp_fa".

library(Matrix)
library(vsp)

library(igraph)
data(enron, package = "igraphdata")

enron_fa <- vsp(enron, rank = 30, scale = TRUE)
enron_fa
#> Vintage Sparse PCA Factor Analysis
#> 
#> Rows (n):   184
#> Cols (d):   184
#> Factors (rank): 30
#> Lambda[rank]:   0.2077
#> 
#> Pre-Processing Options (TODO) 
#> 
#> Components
#> 
#> Z: 184 x 30 [dgeMatrix] 
#> B: 30 x 30 [dgeMatrix] 
#> Y: 184 x 30 [dgeMatrix] 
#> u: 184 x 30 [matrix] 
#> d: 30      [numeric] 
#> v: 184 x 30 [matrix]

References

  1. Rohe, K. & Zeng, M. Vintage Factor Analysis with Varimax Performs Statistical Inference. 2020+.

Code to reproduce the results from the paper is available here.

About

Vintage Sparse PCA for Semi-Parametric Network Analysis

https://rohelab.github.io/vsp/

License:Other


Languages

Language:R 100.0%