Description
Regularized Principal Component Analysis for Spatial Data.
Description
Provide regularized principal component analysis incorporating smoothness, sparseness and orthogonality of eigen-functions by using the alternating direction method of multipliers algorithm (Wang and Huang, 2017, <DOI:10.1080/10618600.2016.1157483>). The method can be applied to either regularly or irregularly spaced data, including 1D, 2D, and 3D.
README.md
SpatPCA Package
Description
SpatPCA is an R package designed for efficient regularized principal component analysis, providing the following features:
- Identification of dominant spatial patterns (eigenfunctions) with both smooth and localized characteristics.
- Spatial prediction (Kriging) at new locations.
- Adaptability for regularly or irregularly spaced data, spanning 1D, 2D, and 3D datasets.
- Implementation using the alternating direction method of multipliers (ADMM) algorithm.
Installation
To install the current development version from GitHub, use the following R code:
remotes::install_github("egpivo/SpatPCA")
For compiling C++ code with the required RcppArmadillo
and RcppParallel
packages, follow these instructions:
- Windows users: Install Rtools
- Mac users: Install Xcode Command Line Tools, and install the
gfortran
library. You can achieve this by running the following commands in the terminal:
brew update
brew install gcc
For a detailed solution, refer to this link, or download and install the library gfortran
to resolve the error ld: library not found for -lgfortran
.
Usage
library(SpatPCA)
spatpca(position, realizations)
- Input: Realizations with the corresponding positions.
- Output: Return the most dominant eigenfunctions automatically.
- For more details, refer to the Demo.
Author
Maintainer
Reference
Wang, W.-T. and Huang, H.-C. (2017). Regularized principal component analysis for spatial data. Journal of Computational and Graphical Statistics, 26, 14-25.
License
GPL-3