Fast version (parallelized) to calculate EOTs (Empirical orthogonal functions) in R.
It is based on the 'eof' function from remote
,
which already utilises efficient C++ code, but implements an additional parallelization step,
making the calculation of EOTs approximately 7x faster. Currently 'fast.EOT' only calculates
the EOTs of a single spatio-temporal field, contrary to the 'eot' function in 'remote', which
also allows to calculate EOTs based on two seperate fields (predictor & predictant).
To load (using devtools
):
library(devtools)
install_github("BernhardKuehn/fast.EOT")
to cite:
citation("fast.EOT")
Utilising C++ code for speed in a parallelized way, requires the installation
of an additional R package (Rcpp2doParallel
) that is not (yet) available on CRAN.
The Rcpp2doParallel
R package allows the implementation of C++
functions and parallelization using the doParallel
and foreach
backend. Therefore the overhead of compiling C++
code on each parallel worker is reduced, allowing a faster code execution.
# Non-CRAN
# an Rcpp-extension that handles C++ code in a parallel backend
devtools::install_github("coatless-rd-rcpp/rcpp-and-doparallel")
library("Rcpp2doParallel")