WA(y, x, mono=FALSE, tolDW = FALSE, use.N2=TRUE, tol.cut=.01,
check.data=TRUE, lean=FALSE)
WA.fit(y, x, mono=FALSE, tolDW=FALSE, use.N2=TRUE, tol.cut=.01,
lean=FALSE)
## S3 method for class 'WA':
predict(object, newdata=NULL, sse=FALSE, nboot=100,
match.data=TRUE, verbose=TRUE, \dots)
## S3 method for class 'WA':
crossval(object, cv.method="loo", verbose=TRUE, ngroups=10,
nboot=100, h.cutoff=0, h.dist=NULL, \dots)
## S3 method for class 'WA':
performance(object, \dots)
## S3 method for class 'WA':
rand.t.test(object, n.perm=999, \dots)
## S3 method for class 'WA':
print(x, \dots)
## S3 method for class 'WA':
summary(object, full=FALSE, \dots)
## S3 method for class 'WA':
plot(x, resid=FALSE, xval=FALSE, tolDW=FALSE, deshrink="inverse",
xlab="", ylab="", ylim=NULL, xlim=NULL, add.ref=TRUE,
add.smooth=FALSE, \dots)
## S3 method for class 'WA':
residuals(object, cv=FALSE, \dots)
## S3 method for class 'WA':
coef(object, \dots)
## S3 method for class 'WA':
fitted(object, \dots)WA.tol.cut are replaced by the mean tolerance.FALSE if you are sure the column names match exactly.plot.WA.h.cutoff from each test sample will be used.WA returns an object of class WA with the following named elements:predict is called with newdata=NULL it returns the fitted values of the original model, otherwise it returns a list with the following named elements:newdata.crossval also returns an object of class WA and adds the following named elements:performance returns a matrix of performance statistics for the WA model. See performance, for a description of the summary.WA performs weighted average (WA) regression and calibration. Weighted averaging has a long history in ecology and forms the basis of many biotic indices. It WAs popularised in palaeolimnology by ter Brakk and van Dam (1989) and Birks et al. (1990) follwoing ter Braak & Barendregt (1986) and ter Braak and Looman (1986) who demonstrated it's theroetical properties in providing a robust and simple alternative to species response modelling using Gaussian logistic regression. Function WA predicts environmental values from sub-fossil biological assemblages, given a training dataset of modern species and envionmental data. It calculates estimates using inverse and classical deshrinking, and, optionally, with taxa downweighted by their tolerances. Prediction errors and model complexity (simple or tolerance downweighted WA) can be estimated by cross-validation using crossval which implements leave-one out, leave-group-out, or bootstrapping. With leave-group out one may also supply a vector of group memberships for more carefully designed cross-validation experiments.
Function predict predicts values of the environemntal variable for newdata or returns the fitted (predicted) values from the original modern dataset if newdata is NULL. Variables are matched between training and newdata by column name (if match.data is TRUE). Use compare.datasets to assess conformity of two species datasets and identify possible no-analogue samples.
Function rand.t.test performs a randomisation t-test to test the significance of the difference in cross-validation RMSE between tolerance-downweighted and simple WA, after van der Voet (1994).
WA has methods fitted and rediduals that return the fitted values (estimates) and residuals for the training set, performance, which returns summary performance statistics (see below), coef which returns the species coefficients (optima and tolerances), and print and summary to summarise the output. WA also has a plot method that produces scatter plots of predicted vs observed measurements for the training set.WAPLS, MAT, and compare.datasets for diagnostics.# pH reconstruction of core K05 from the Round Loch of Glenhead,
# Galloway, SW Scotland. This lake has become acidified over the
# last c. 150 years
data(SWAP)
data(RLGH)
spec <- SWAP$spec
pH <- SWAP$pH
core <- RLGH$spec
age <- RLGH$depths$Age
fit <- WA(spec, pH, tolDW=TRUE)
# plot predicted vs. observed
plot(fit)
plot(fit, resid=TRUE)
# RLGH reconstruction
pred <- predict(fit, core)
#plot the reconstructio
plot(age, pred$fit[, 1], type="b")
# cross-validation model using bootstrapping
fit.xv <- crossval(fit, cv.method="boot", nboot=1000)
par(mfrow=c(1,2))
plot(fit)
plot(fit, resid=TRUE)
plot(fit.xv, xval=TRUE)
plot(fit.xv, xval=TRUE, resid=TRUE)
# RLGH reconstruction with sample specific errors
pred <- predict(fit, core, sse=TRUE, nboot=1000)Run the code above in your browser using DataLab