MLRC {rioja}R Documentation

Palaeoenvironmental reconstruction using Maximum Likelihood Response Surfaces

Description

Functions for reconstructing (predicting) environmental values from biological assemblages using Maximum Likelihood response Surfaces.

Usage

MLRC(y, x, check.data=TRUE, lean=FALSE, ...)

MLRC.fit(y, x, n.cut=2, use.glm=FALSE, max.iter=50, lean=FALSE, ...)

## S3 method for class 'MLRC':
predict (object, newdata=NULL, sse=FALSE, nboot=100,
      match.data=TRUE, verbose=TRUE, ...)

## S3 method for class 'MLRC':
crossval(object, cv.method="loo", verbose=TRUE, ngroups=10,
      nboot=100, ...)

## S3 method for class 'MLRC':
performance(object, ...)

## S3 method for class 'MLRC':
print(x, ...)

## S3 method for class 'MLRC':
summary(object, full=FALSE, ...)

## S3 method for class 'MLRC':
plot(x, resid=FALSE, xval=FALSE, xlab="", ylab="", 
      ylim=NULL, xlim=NULL, add.ref=TRUE, add.smooth=FALSE, ...)

## S3 method for class 'MLRC':
residuals(object, ...)

## S3 method for class 'MLRC':
coef(object, ...)

## S3 method for class 'MLRC':
fitted(object, ...)

Arguments

y a data frame or matrix of biological abundance data.
x, object a vector of environmental values to be modelled or an object of class wa.
n.cut cutoff value for number of occurrences. Species with fewer than n.cut occurences will be excluded for the analysis.
use.glm logical to use glm to fit responses rather than internal code. Defaults to FALSE.
newdata new biological data to be predicted.
max.iter maximum iterations of the logit regression algorithm.
check.data logical to perform simple checks on the input data.
match.data logical indicate the function will match two species datasets by their column names. You should only set this to FALSE if you are sure the column names match exactly.
lean logical to exclude some output from the resulting models (used when cross-validating to speed calculations).
full logical to show head and tail of output in summaries.
resid logical to plot residuals instead of fitted values.
xval logical to plot cross-validation estimates.
xlab, ylab, xlim, ylim additional graphical arguments to plot.wa.
add.ref add 1:1 line on plot.
add.smooth add loess smooth to plot.
cv.method cross-validation method, either "loo", "lgo" or "bootstrap".
verbose logical or integer to show feedback during cross-validaton. If TRUE print feedback every 50 cycles, if integer, use this value.
nboot number of bootstrap samples.
ngroups number of groups in leave-group-out cross-validation, or a vector contain leave-out group menbership.
sse logical indicating that sample specific errors should be calculated.
... additional arguments.

Details

Function MLRC Maximim likelihood reconstruction using response curves.

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.

MLRC 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, and print and summary to summarise the output. MLRC also has a plot method that produces scatter plots of predicted vs observed measurements for the training set.

Value

Function MLRC returns an object of class MLRC with the following named elements:
To do
Function crossval also returns an object of class MLRC and adds the following named elements:

predicted predicted values of each training set sample under cross-validation.
residuals.cv prediction residuals.
fit predicted values for newdata.
fit.boot mean of the bootstrap estimates of newdata.
v1 squared standard error of the bootstrap estimates for each new sample.
v2 mean squared error for the training set samples, across all bootstrap samples.
SEP standard error of prediction, calculated as the square root of v1 + v2.


Function performance returns a matrix of performance statistics for the MLRC model. See performance, for a description of the summary.

Author(s)

Steve Juggins

References

Birks, H.J.B., Line, J.M., Juggins, S., Stevenson, A.C., & ter Braak, C.J.F. (1990) Diatoms and pH reconstruction. Philosophical Transactions of the Royal Society of London, B, 327, 263-278.

Juggins, S. (1992) Diatoms in the Thames Estuary, England: Ecology, Palaeoecology, and Salinity Transfer Function. Bibliotheca Diatomologica, Band 25, 216pp.

Oksanen, J., Laara, E., Huttunen, P., & Merilainen, J. (1990) Maximum likelihood prediction of lake acidity based on sedimented diatoms. Journal of Vegetation Science, 1, 49-56.

ter Braak, C.J.F. & van Dam, H. (1989) Inferring pH from diatoms: a comparison of old and new calibration methods. Hydrobiologia, 178, 209-223.

See Also

WA, MAT, performance, and compare.datasets for diagnostics.

Examples

data(IK)
spec <- IK$spec / 100
SumSST <- IK$env$SumSST
core <- IK$core / 100

fit <- MLRC(spec, SumSST)
fit

#predict the core
pred <- predict(fit, core)

#plot predictions - depths are in rownames
depth <- as.numeric(rownames(core))
plot(depth, pred$fit[, 1], type="b")

## Not run: 
# this is slow!
# cross-validate model
fit.cv <- crossval(fit, cv.method="loo", verbose=5)

# predictions with sample specific errors
pred <- predict(fit, core, sse=TRUE, nboot=1000, verbose=5)
## End(Not run)

[Package rioja version 0.5-6 Index]