SpatMCA
R Package: Regularized Spatial Maximum Covariance Analysis
Install / Use
/learn @egpivo/SpatMCAREADME
SpatMCA: Regularized Spatial Maximum Covariance Analysis
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:
install.packages("SpatMCA")
Install the current development version from GitHub:
remotes::install_github("egpivo/SpatMCA")
Please Note:
-
Windows Users: Ensure that you have Rtools installed before proceeding with the installation.
-
Mac Users: You need Xcode Command Line Tools and should install the library
gfortran. Follow these steps in the terminal:brew update brew install gccFor a detailed solution, refer to this link, or download and install the library
gfortranto resolve the "ld: library not found for -lgfortran" error.
Usage
To perform regularized maximum covariance analysis using SpatMCA, follow these steps:
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
Maintainer
Reference
Wang, W.-T. and Huang, H.-C. (2018). Regularized spatial maximum covariance analysis, Environmetrics, 29, https://doi.org/10.1002/env.2481
License
GPL (>= 2)
Citation
- To cite package ‘SpatMCA’ in publications use:
Wang W, Huang H (2025). _SpatMCA: Regularized Spatial Maximum Covariance Analysis_.
R package version 1.0.7, <https://github.com/egpivo/SpatMCA>.
- A BibTeX entry for LaTeX users is
@Manual{,
title = {SpatMCA: Regularized Spatial Maximum Covariance Analysis},
author = {Wen-Ting Wang and Hsin-Cheng Huang},
year = {2025},
note = {R package version 1.0.7},
url = {https://github.com/egpivo/SpatMCA},
}
Related Skills
node-connect
352.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
