vsp

Vintage Sparse PCA for Semi-Parametric Network Analysis

https://github.com/rohelab/vsp

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    2 of 3 committers (66.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.2%) to scientific vocabulary
Last synced: 7 months ago · JSON representation

Repository

Vintage Sparse PCA for Semi-Parametric Network Analysis

Basic Info
Statistics
  • Stars: 26
  • Watchers: 4
  • Forks: 6
  • Open Issues: 7
  • Releases: 3
Created over 7 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r setup, include = FALSE}
knitr::opts_chunk$set(
  message = FALSE,
  warning = FALSE,
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

set.seed(27)
```

# vsp


[![Codecov test coverage](https://codecov.io/gh/RoheLab/vsp/branch/main/graph/badge.svg)](https://app.codecov.io/gh/RoheLab/vsp?branch=main)
[![CRAN status](https://www.r-pkg.org/badges/version/vsp)](https://CRAN.R-project.org/package=vsp)
[![R-CMD-check](https://github.com/RoheLab/vsp/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/RoheLab/vsp/actions/workflows/R-CMD-check.yaml)


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 released version of `vsp` from CRAN with

``` r
install.packages("vsp")
```

You can install the development version of `vsp` with:

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

## Example

Obtaining estimates from `vsp` is straightforward. We recommend representing networks as [`igraph`](https://igraph.org/r/) objects or sparse adjacency matrices using the [`Matrix`](https://cran.r-project.org/package=Matrix) package. Once you have your network in one of these formats, you can get estimates by calling the `vsp()` function. The result is a `vsp_fa` S3 object.

Here we demonstrate `vsp` usage on an `igraph` object, using the `enron` network from `igraphdata` package to demonstrate this functionality. First we peak at the graph:

```{r}
library(igraph)
data(enron, package = "igraphdata")

image(sign(get.adjacency(enron, sparse = FALSE)))
```

Now we estimate:

```{r}
library(vsp)

fa <- vsp(enron, rank = 30)
fa
```

```{r}
get_varimax_z(fa)
```

To visualize a screeplot of the singular value, use:

```{r}
screeplot(fa)
```

At the moment, we also enjoy using pairs plots of the factors as a diagnostic measure:

```{r}
plot_varimax_z_pairs(fa, 1:5)
```

```{r}
plot_varimax_y_pairs(fa, 1:5)
```

Similarly, an IPR pairs plot can be a good way to check for singular vector localization (and thus overfitting!).

```{r}
plot_ipr_pairs(fa)
```

```{r}
plot_mixing_matrix(fa)
```

## References

[1] Rohe, Karl, and Muzhe Zeng. “Vintage Factor Analysis with Varimax Performs Statistical Inference.” Journal of the Royal Statistical Society Series B: Statistical Methodology 85, no. 4 (September 29, 2023): 1037–60. https://doi.org/10.1093/jrsssb/qkad029.

Code to reproduce the results from the paper is [available here](https://github.com/RoheLab/vsp-paper).

Owner

  • Name: Rohe Lab
  • Login: RoheLab
  • Kind: organization

network analysis and multivariate statistics research group

GitHub Events

Total
  • Create event: 1
  • Release event: 1
  • Issues event: 5
  • Watch event: 1
  • Issue comment event: 4
  • Push event: 16
  • Pull request event: 1
Last Year
  • Create event: 1
  • Release event: 1
  • Issues event: 5
  • Watch event: 1
  • Issue comment event: 4
  • Push event: 16
  • Pull request event: 1

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 109
  • Total Committers: 3
  • Avg Commits per committer: 36.333
  • Development Distribution Score (DDS): 0.055
Past Year
  • Commits: 7
  • Committers: 1
  • Avg Commits per committer: 7.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Alex Hayes a****s@g****m 103
karlrohe k****e@s****u 5
Fan Chen f****n@w****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 67
  • Total pull requests: 4
  • Average time to close issues: 9 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 6
  • Total pull request authors: 3
  • Average comments per issue: 1.46
  • Average comments per pull request: 0.75
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 0
  • Average time to close issues: 3 days
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 0
  • Average comments per issue: 0.67
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • alexpghayes (46)
  • karlrohe (16)
  • fchen365 (4)
  • ravwojdyla (2)
  • yixuan (1)
  • carolliu42 (1)
Pull Request Authors
  • alexpghayes (3)
  • acastroaraujo (1)
  • fchen365 (1)
  • olivroy (1)
Top Labels
Issue Labels
enhancement (2) bug (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 542 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 4
  • Total maintainers: 1
cran.r-project.org: vsp

Vintage Sparse PCA for Semi-Parametric Factor Analysis

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 542 Last month
Rankings
Forks count: 8.7%
Stargazers count: 10.6%
Dependent repos count: 23.8%
Average: 28.0%
Dependent packages count: 28.7%
Downloads: 68.0%
Maintainers (1)
Last synced: 7 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.1 depends
  • LRMF3 * imports
  • Matrix * imports
  • RSpectra * imports
  • ggplot2 * imports
  • glue * imports
  • invertiforms * imports
  • magrittr * imports
  • rlang * imports
  • stats * imports
  • tibble * imports
  • withr * imports
  • GGally * suggests
  • covr * suggests
  • dplyr * suggests
  • igraph * suggests
  • igraphdata * suggests
  • knitr * suggests
  • purrr * suggests
  • rmarkdown * suggests
  • scales * suggests
  • testthat >= 3.0.0 suggests
  • tidygraph * suggests
  • tidyr * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v1 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite
.github/workflows/pkgdown.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/pr-fetch v1 composite
  • r-lib/actions/pr-push v1 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite