fxTWAPLS: An Improved Version of WA-PLS
Overview
The goal of this package is to provide an improved version of WA-PLS by including the tolerances of taxa and the frequency of the sampled climate variable. This package also provides a way of leave-out cross-validation that removes both the test site and sites that are both geographically close and climatically close for each cycle, to avoid the risk of pseudo-replication.
Installation
You can install the released version of fxTWAPLS from CRAN with:
install.packages("fxTWAPLS")
And the development version from GitHub with:
install.packages("remotes")
remotes::install_github("special-uor/fxTWAPLS", "dev")
Publications
- Liu Mengmeng, Prentice Iain Colin, ter Braak Cajo J. F., Harrison
Sandy P.. 2020 An improved statistical approach for reconstructing
past climates from biotic assemblages. Proc. R. Soc. A. 476:
20200346. https://doi.org/10.1098/rspa.2020.0346 -
fxTWAPLS v0.0.2
install.packages("remotes")
remotes::install_github("special-uor/fxTWAPLS@v0.0.2")
Notes
The following functions can be executed in parallel:
To do so, include the cpus
parameter. For example:
# without fx
cv_Tmin <- fxTWAPLS::cv.w(taxa,
modern_pollen$Tmin,
nPLS = 5,
fxTWAPLS::WAPLS.w,
fxTWAPLS::WAPLS.predict.w,
cpus = 2)
Optionally, a progress bar can be displayed for long computations. Just
“pipe” the function call to fxTWAPLS::pb()
.
# without fx
`%>%` <- magrittr::`%>%`
cv_Tmin <- fxTWAPLS::cv.w(taxa,
modern_pollen$Tmin,
nPLS = 5,
fxTWAPLS::WAPLS.w,
fxTWAPLS::WAPLS.predict.w,
cpus = 2) %>%
fxTWAPLS::pb()
Alternatively, if you are not familiar with the “pipe” operator, you can run the following code:
# without fx
cv_Tmin <- fxTWAPLS::pb(fxTWAPLS::cv.w(taxa,
modern_pollen$Tmin,
nPLS = 5,
fxTWAPLS::WAPLS.w,
fxTWAPLS::WAPLS.predict.w,
cpus = 2))