WAPLS.w: WA-PLS training function

Description Usage Arguments Value See Also Examples

View source: R/fxTWAPLS.R

Description

WA-PLS training function, which can perform fx correction.

Usage

1
WAPLS.w(modern_taxa, modern_climate, nPLS = 5, usefx = FALSE, fx = NA)

Arguments

modern_taxa

The modern taxa abundance data, each row represents a sampling site, each column represents a taxon.

modern_climate

The modern climate value at each sampling site.

nPLS

The number of components to be extracted.

usefx

Boolean flag on whether or not use fx correction.

fx

The frequency of the climate value for fx correction: if usefx = FALSE, this should be NA; otherwise, this should be obtained from the fx function.

Value

A list of the training results, which will be used by the predict function. Each element in the list is described below:

fit

the fitted values using each number of components.

x

the observed modern climate values.

taxon_name

the name of each taxon.

optimum

the updated taxon optimum (u* in the WA-PLS paper).

comp

each component extracted (will be used in step 7 regression).

u

taxon optimum for each component (step 2).

z

a parameter used in standardization for each component (step 5).

s

a parameter used in standardization for each component (step 5).

orth

a list that stores orthogonalization parameters (step 4).

alpha

a list that stores regression coefficients (step 7).

meanx

mean value of the observed modern climate values.

nPLS

the total number of components extracted.

See Also

fx, TWAPLS.w, and WAPLS.predict.w

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
# Load modern pollen data
modern_pollen <- read.csv("/path/to/modern_pollen.csv")
                                      
# Extract taxa
taxaColMin <- which(colnames(modern_pollen) == "taxa0")
taxaColMax <- which(colnames(modern_pollen) == "taxaN")
taxa <- modern_pollen[, taxaColMin:taxaColMax]

# Get the frequency of each climate variable fx
fx_Tmin <- fxTWAPLS::fx(modern_pollen$Tmin, bin = 0.02)
fx_gdd <- fxTWAPLS::fx(modern_pollen$gdd, bin = 20)
fx_alpha <- fxTWAPLS::fx(modern_pollen$alpha, bin = 0.002)

# MTCO
fit_Tmin <- fxTWAPLS::WAPLS.w(taxa, modern_pollen$Tmin, nPLS = 5)
fit_f_Tmin <- fxTWAPLS::WAPLS.w(taxa, 
                                modern_pollen$Tmin, 
                                nPLS = 5, 
                                usefx = TRUE, 
                                fx = fx_Tmin)

## End(Not run)

fxTWAPLS documentation built on April 25, 2021, 1:07 a.m.