rioja (version 0.9-21)

randomPTF: Random transfer functions to calculate variable importance

Description

Function for calculating the important of each taxon (predictor) in palaeoecological transfer functions

Usage

randomPTF(spec, env, fun, ncol = 1, nVar, nTF = 500, verbose = TRUE, 
          do.parallel = FALSE, …)

# S3 method for randomPTF plot(x, use.pointLabel=TRUE, …)

# S3 method for randomPTF print(x, …)

Arguments

spec

a data frame or matrix of biological abundance data.

env

a vector of environmental values to be modelled.

fun

a transfer function method. Additional arguments can be passed with …)

ncol

some transfer functions return more than one column of results, for example with different WAPLS components. col selects which column to use. See the relevant transfer function method help file.

nVar

number of variables (ie. species) to use in each randomisation (defaults to nsp/3).

nTF

number of random transfer functions to create (default=500).

verbose

logical show feedback during cross-validation.

do.parallel

logical to run in parallel on multi-core machines. If true a suitable parallel back-end should be installed (see examples).

additional parameters to the transfer function call.

x

an object of class randomPTF.

use.pointLabel

logical to label points using function labelPoints in package maptools.

Value

Function randomPTF returns an object of class randomPTF with the following named elements:

VI

taxon importance values, ordered form high to low.

spec

original species data frame.

env

original vector of environmental values.

Details

Function randomPTF calculates taxon importance values using a method analogous to that used in random forests and described in Juggins et al. (2015).

The parallel version can give c. 3 times speed-up on a quad-core machine.

References

Juggins S, Simpson GL, Telford RJ. Taxon selection using statistical learning techniques to improve transfer function prediction. The Holocene 2015; 25: 130-136.

Examples

Run this code
# NOT RUN {
data(SWAP)
result <- randomPTF(SWAP$spec, SWAP$pH, fun=WA)
plot(result, cex=0.6)
print(result)
# parallel version
if (.Platform$OS.type=='windows') {
  library(doParallel)
  registerDoParallel(cores=4)
} else {
  library(doMC)
  registerDoMC(cores=4)
}
system.time(result <- randomPTF(SWAP$spec, SWAP$pH, fun=WA, do.parallel=TRUE, nTF=5000))
# }

Run the code above in your browser using DataCamp Workspace