Git Product home page Git Product logo

spatpca's Introduction

SpatPCA: Regularized Principal Component Analysis for Spatial Data

License R build status Coverage Status CRAN_Status_Badge Downloads (monthly) Downloads (total) JCGS

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

install.packages("SpatPCA")

Install the Development Version from GitHub

remotes::install_github("egpivo/SpatPCA")

Compilation Requirements

To compile C++ code with the required RcppArmadillo and RcppParallel packages, follow these instructions based on your operating system:

For Windows users

Install 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:
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

To use SpatPCA, first load the package:

library(SpatPCA)

Then, apply the spatpca function with the following syntax:

spatpca(position, realizations)
  • Input: Realizations with the corresponding positions.
  • Output: Return the most dominant eigenfunctions automatically.

For more details, refer to the Demo.

Authors

Maintainer

Wen-Ting Wang (GitHub)

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 (>= 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,
  <https://CRAN.R-project.org/package=SpatPCA>.
  • 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},
  }

spatpca's People

Contributors

egpivo avatar olivroy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rpkgs

spatpca's Issues

failed to install

remotes::install_github("egpivo/SpatPCA")

Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo egpivo/SpatPCA@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All                          
2: CRAN packages only           
3: None                         
4: cli   (3.6.0 -> 3.6.1) [CRAN]
5: vctrs (0.6.2 -> 0.6.3) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 
── R CMD build ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file 'C:\Users\hydro\AppData\Local\Temp\RtmpSGxkUE\remotes11582e472bc0\egpivo-SpatPCA-c2bf66f/DESCRIPTION' ... 
─  preparing 'SpatPCA':
✔  checking DESCRIPTION meta-information ... 
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
   Omitted 'LazyData' from DESCRIPTION
─  building 'SpatPCA_1.3.3.8.tar.gz'
   
Installing package into ‘D:/Documents/R/win-library/4.2’
(as ‘lib’ is unspecified)
NULL
* installing *source* package 'SpatPCA' ...
** using staged installation
** libs
g++  -std=gnu++17 -I"C:/PROGRA~1/R/R-42~1.3/include" -DNDEBUG -I../inst/include -DARMA_DONT_PRINT_OPENMP_WARNING=1 -I'D:/Documents/R/win-library/4.2/Rcpp/include' -I'D:/Documents/R/win-library/4.2/RcppArmadillo/include' -I'D:/Documents/R/win-library/4.2/RcppParallel/include'   -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -DRCPP_PARALLEL_USE_TBB=1 -DARMA_64BIT_WORD=1   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RcppExports.cpp -o RcppExports.o
g++  -std=gnu++17 -I"C:/PROGRA~1/R/R-42~1.3/include" -DNDEBUG -I../inst/include -DARMA_DONT_PRINT_OPENMP_WARNING=1 -I'D:/Documents/R/win-library/4.2/Rcpp/include' -I'D:/Documents/R/win-library/4.2/RcppArmadillo/include' -I'D:/Documents/R/win-library/4.2/RcppParallel/include'   -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -DRCPP_PARALLEL_USE_TBB=1 -DARMA_64BIT_WORD=1   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RcppSpatPCA.cpp -o RcppSpatPCA.o
RcppSpatPCA.cpp: In member function 'virtual void thinPlateSpline::operator()(std::size_t, std::size_t)':
RcppSpatPCA.cpp:25:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'long long unsigned int'} [-Wsign-compare]
   25 |         if(j > i) {
      |            ~~^~~
RcppSpatPCA.cpp: In member function 'virtual void spatpcaCVPhi3::operator()(std::size_t, std::size_t)':
RcppSpatPCA.cpp:501:26: warning: comparison of integer expressions of different signedness: 'int' and 'const uword' {aka 'const long long unsigned int'} [-Wsign-compare]
  501 |       for(int gj = 0; gj < gamma.n_elem; gj++) {
      |                       ~~~^~~~~~~~~~~~~~
gcc  -I"C:/PROGRA~1/R/R-42~1.3/include" -DNDEBUG -I../inst/include -DARMA_DONT_PRINT_OPENMP_WARNING=1 -I'D:/Documents/R/win-library/4.2/Rcpp/include' -I'D:/Documents/R/win-library/4.2/RcppArmadillo/include' -I'D:/Documents/R/win-library/4.2/RcppParallel/include'   -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c registerDynamicSymbol.c -o registerDynamicSymbol.o
 -LD:/Documents/R/win-library/4.2/RcppParallel/lib/x64 -ltbb -ltbbmalloc -LC:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools42/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-42~1.3/bin/x64 -lR
: Invalid argumentLL
no DLL was created
ERROR: compilation failed for package 'SpatPCA'
* removing 'D:/Documents/R/win-library/4.2/SpatPCA'
Warning message:
In i.p(...) :
  installation of package ‘C:/Users/hydro/AppData/Local/Temp/RtmpSGxkUE/file11588a726fe/SpatPCA_1.3.3.8.tar.gz’ had non-zero exit status

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.