Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/egpivo/spatpca
R Package: Regularized Principal Component Analysis for Spatial Data
https://github.com/egpivo/spatpca
admm covariance-estimation eigenfunctions lasso matrix-factorization pca r r-package rcpparmadillo rcppparallel regularization spatial spatial-data-analysis splines
Last synced: 5 days ago
JSON representation
R Package: Regularized Principal Component Analysis for Spatial Data
- Host: GitHub
- URL: https://github.com/egpivo/spatpca
- Owner: egpivo
- License: gpl-2.0
- Created: 2017-01-21T04:37:27.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-08-26T16:43:57.000Z (6 months ago)
- Last Synced: 2025-02-02T18:26:06.460Z (19 days ago)
- Topics: admm, covariance-estimation, eigenfunctions, lasso, matrix-factorization, pca, r, r-package, rcpparmadillo, rcppparallel, regularization, spatial, spatial-data-analysis, splines
- Language: R
- Homepage: https://egpivo.github.io/SpatPCA/
- Size: 110 MB
- Stars: 20
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
# SpatPCA: Regularized Principal Component Analysis for Spatial Data
[](https://www.gnu.org/licenses/gpl-2.0.html)
[](https://github.com/egpivo/SpatPCA/actions)
[](https://app.codecov.io/github/egpivo/SpatpCA?branch=master)
[](https://cran.r-project.org/package=SpatPCA)
[](https://www.r-pkg.org/pkg/SpatPCA)
[](https://www.r-pkg.org/pkg/SpatPCA)
[](https://doi.org/10.1080/10618600.2016.1157483)## Description
**SpatPCA** is an R package designed for efficient regularized principal component analysis, providing the following features:- Identify dominant spatial patterns (eigenfunctions) with both smooth and localized characteristics.
- Conduct spatial prediction (Kriging) at new locations.
- Adapt to regularly or irregularly spaced data, spanning 1D, 2D, and 3D datasets.
- Implement using the alternating direction method of multipliers (ADMM) algorithm.## Installation
You can install **SpatPCA** using either of the following methods:### Install from CRAN
```r
install.packages("SpatPCA")
```
### Install the Development Version from GitHub
```r
remotes::install_github("egpivo/SpatPCA")
```
### Compilation Requirements
To compile C++ code with the required [`RcppArmadillo`](https://CRAN.R-project.org/package=RcppArmadillo) and [`RcppParallel`](https://CRAN.R-project.org/package=RcppParallel) packages, follow these instructions based on your operating system:#### For Windows users
Install [Rtools](https://CRAN.R-project.org/bin/windows/Rtools/)#### For Mac users
1. Install Xcode Command Line Tools
2. install the `gfortran` library. You can achieve this by running the following commands 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 error `ld: library not found for -lgfortran`.
## Usage
To use **SpatPCA**, first load the package:```r
library(SpatPCA)
```Then, apply the `spatpca` function with the following syntax:
```r
spatpca(position, realizations)
```
- Input: Realizations with the corresponding positions.
- Output: Return the most dominant eigenfunctions automatically.For more details, refer to the [Demo](https://egpivo.github.io/SpatPCA/articles/).
## Authors
- [Wen-Ting Wang](https://www.linkedin.com/in/wen-ting-wang-6083a17b) ([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/wen-ting-wang-6083a17b) ([GitHub](https://www.github.com/egpivo))## Reference
Wang, W.-T. and Huang, H.-C. (2017). [Regularized principal component analysis for spatial data](https://arxiv.org/pdf/1501.03221v3.pdf), "Regularized principal component analysis for spatial data"). *Journal of Computational and Graphical Statistics*, **26**, 14-25.
## License
GPL (>= 2)## Citation
- To cite package ‘SpatPCA’ in publications use:
```
Wang W, Huang H (2023). SpatPCA: Regularized Principal Component Analysis for
Spatial Data_. R package version 1.3.5,
.
```- A BibTeX entry for LaTeX users is
```
@Manual{,
title = {SpatPCA: Regularized Principal Component Analysis for Spatial Data},
author = {Wen-Ting Wang and Hsin-Cheng Huang},
year = {2023},
note = {R package version 1.3.5},
url = {https://CRAN.R-project.org/package=SpatPCA},
}
```