https://github.com/egpivo/spatmca
R Package: Regularized Spatial Maximum Covariance Analysis
https://github.com/egpivo/spatmca
admm cca cross-covariance lasso matrix-factorization r r-package rcpparmadillo rcppparallel splines
Last synced: 3 months ago
JSON representation
R Package: Regularized Spatial Maximum Covariance Analysis
- Host: GitHub
- URL: https://github.com/egpivo/spatmca
- Owner: egpivo
- License: gpl-2.0
- Created: 2017-01-21T13:08:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-08-26T16:40:35.000Z (9 months ago)
- Last Synced: 2024-09-27T04:05:16.337Z (8 months ago)
- Topics: admm, cca, cross-covariance, lasso, matrix-factorization, r, r-package, rcpparmadillo, rcppparallel, splines
- Language: C++
- Homepage: https://egpivo.github.io/SpatMCA
- Size: 16.8 MB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
# SpatMCA: Regularized Spatial Maximum Covariance Analysis
[](https://www.gnu.org/licenses/gpl-2.0.html)
[](https://cran.r-project.org/package=SpatMCA)
[](https://github.com/egpivo/SpatMCA/actions)
[](https://codecov.io/github/egpivo/SpatMCA?branch=master)
[](https://www.r-pkg.org/pkg/SpatMCA)
[](https://www.r-pkg.org/pkg/SpatMCA)
[](https://doi.org/10.1002/env.2481)## Description
**SpatMCA** is an R package designed for regularized maximum covariance analysis. It serves as a powerful tool for:
- Identifying smooth and localized coupling patterns to understand how one spatial process affects another.
- Handling both regularly and irregularly spaced data, spanning 1D, 2D, and 3D datasets.
- Implementing the alternating direction method of multipliers (ADMM) algorithm.## Installation
You can install the **SpatMCA** package using one of the following methods:### Install from CRAN:
```r
install.packages("SpatMCA")
```### Install the current development version from GitHub:
```r
remotes::install_github("egpivo/SpatMCA")
```
#### Please Note:
- **Windows Users:** Ensure that you have [Rtools](https://cran.r-project.org/bin/windows/Rtools/) installed before proceeding with the installation.- **Mac Users:** You need Xcode Command Line Tools and should install the library [`gfortran`](https://github.com/fxcoudert/gfortran-for-macOS/releases). Follow these steps in the terminal:
```bash
brew update
brew install gcc
```
For a detailed solution, refer to this [link](https://thecoatlessprofessor.com/programming/rcpp-rcpparmadillo-and-os-x-mavericks-lgfortran-and-lquadmath-error/), or download and install the library [`gfortran`](https://github.com/fxcoudert/gfortran-for-macOS/releases) to resolve the "`ld: library not found for -lgfortran`" error.### Usage
To perform regularized maximum covariance analysis using **SpatMCA**, follow these steps:```r
library(SpatMCA)
spatmca(x1, x2, Y1, Y2, K = 1, num_cores = 1)
```
#### Parameters:
- `x1`, `x2`: Location matrices.
- `Y1`, `Y2`: Data matrices.
- `K`: Number of patterns.
- `num_cores`: Number of CPU cores.
#### Output:
Provides information about the identified patterns## Authors
- [Wen-Ting Wang](https://www.linkedin.com/in/wtwang) ([GitHub](https://www.github.com/egpivo))
- [Hsin-Cheng Huang](https://sites.stat.sinica.edu.tw/hchuang/)
## Maintainer
[Wen-Ting Wang](https://www.linkedin.com/in/wtwang) ([GitHub](https://www.github.com/egpivo))## Reference
Wang, W.-T. and Huang, H.-C. (2018). [Regularized spatial maximum covariance analysis](https://arxiv.org/pdf/1705.02716.pdf), Environmetrics, 29, https://doi.org/10.1002/env.2481
## License
GPL (>= 2)## Citation
1. To cite package ‘SpatMCA’ in publications use:
```
Wang W, Huang H (2023). _SpatMCA: Regularized Spatial Maximum Covariance Analysis_.
R package version 1.0.2.6, .
```
2. A BibTeX entry for LaTeX users is
```
@Manual{,
title = {SpatMCA: Regularized Spatial Maximum Covariance Analysis},
author = {Wen-Ting Wang and Hsin-Cheng Huang},
year = {2023},
note = {R package version 1.0.2.6},
url = {https://github.com/egpivo/SpatMCA},
}
```