MLRC(y, x, check.data=TRUE, lean=FALSE, n.cut=5, verbose=TRUE, ...)
MLRC.fit(y, x, n.cut=2, use.glm=FALSE, max.iter=50, lean=FALSE, verbose=TRUE, ...)
## S3 method for class 'MLRC':
predict(object, newdata=NULL, sse=FALSE, nboot=100,
match.data=TRUE, verbose=TRUE, \dots)
## S3 method for class 'MLRC':
crossval(object, cv.method="loo", verbose=TRUE, ngroups=10,
nboot=100, h.cutoff=0, h.dist=NULL, \dots)
## S3 method for class 'MLRC':
performance(object, \dots)
## S3 method for class 'MLRC':
print(x, \dots)
## S3 method for class 'MLRC':
summary(object, full=FALSE, \dots)
## S3 method for class 'MLRC':
plot(x, resid=FALSE, xval=FALSE, xlab="", ylab="",
ylim=NULL, xlim=NULL, add.ref=TRUE, add.smooth=FALSE, \dots)
## S3 method for class 'MLRC':
residuals(object, cv=FALSE, \dots)
## S3 method for class 'MLRC':
coef(object, \dots)
## S3 method for class 'MLRC':
fitted(object, \dots)wa.glm to fit responses rather than internal code. Defaults to FALSE.FALSE if you are sure the column names match exactly.plot.wa.h.cutoff from each test sample will be used.MLRC returns an object of class MLRC with the following named elements:
Function crossval also returns an object of class MLRC and adds 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.performance returns a matrix of performance statistics for the MLRC model. See performance, for a description of the summary.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.WA, MAT, performance, and compare.datasets for diagnostics.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")
# 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)Run the code above in your browser using DataLab