-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
75 lines (54 loc) · 1.96 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
# date: "`r Sys.Date()`"
output: github_document
header-includes:
- \usepackage{amsfonts,amsmath,amsthm,amsbsy,amssymb,dsfont,bm,mathtools,mathalfa}
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
tidy = TRUE,
tidy.opts = list(comment = FALSE),
collapse = TRUE,
comment = "#>",
out.width = "100%"
)
library(epca)
```
# Exploratory Principal Component Analysis
<!-- badges: start -->
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#maturing)
<!-- badges: end -->
`epca` is an R package for comprehending any data matrix that contains *low-rank* and *sparse* underlying signals of interest.
The package currently features two key tools:
* `sca` for **s**parse principal **c**omponent **a**nalysis.
* `sma` for **s**parse **m**atrix **a**pproximation, a two-way data analysis for simultaneously row and column dimensionality reductions.
## Installation
You can install the released version of epca from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("epca")
```
or the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("fchen365/epca")
```
## Example
The usage of `sca` and `sma` is straightforward. For example, to find `k` sparse PCs of a data matrix `X`:
```{r sca, eval=FALSE}
## perform sparse PCA
sca(X, k)
```
Similarly, we can find a rank-`k` sparse matrix decomposition by
```{r sma, eval=FALSE}
## perform sparse matrix approximation
sma(X, k)
```
For more examples, please see the vignette:
```{r, eval=FALSE}
vignette("epca")
```
## Getting help
If you encounter a clear bug, please file an issue with a minimal reproducible example on [GitHub](https://github.com/fchen365/epca/issues).
## Reference
Chen F and Rohe K, "A New Basis for Sparse Principal Component Analysis." ([arXiv](https://arxiv.org/abs/2007.00596))