Learn R Programming

analogue (version 0.10-0)

predict.mat: Predict method for Modern Analogue Technique models

Description

Predicted values based on a MAT model object.

Usage

## S3 method for class 'mat':
predict(object, newdata, k, weighted = FALSE,
        bootstrap = FALSE, n.boot = 1000,
        probs = c(0.01, 0.025, 0.05, 0.1), ...)

Arguments

object
an object of mat.
newdata
data frame; required only if predictions for some new data are required. Mst have the same number of columns, in same order, as x in mat. See example below or
k
number of analogues to use. If missing, k is chosen automatically as the k that achieves lowest RMSE.
weighted
logical; should the analysis use the weighted mean of environmental data of analogues as predicted values?
bootstrap
logical; should bootstrap derived estimates and sample specific errors be calculated-ignored if newdata is missing.
n.boot
numeric; the number of bootstrap samples to take.
probs
numeric; vector of probabilities with values in [0,1].
...
arguments passed to of from other methods.

Value

  • A object of class predict.mat is returned if newdata is supplied, otherwise an object of fitted.mat is returned. If bootstrap = FALSE then not all components will be returned.
  • observedvector of observed environmental values.
  • modela list containing the model or non-bootstrapped estimates for the training set. With the following components:
    • estimated
    {estimated values for "y", the environment.} residuals{model residuals.} r.squared{Model $R^2$ between observed and estimated values of "y".} avg.bias{Average bias of the model residuals.} max.bias{Maximum bias of the model residuals.} rmsep{Model error (RMSEP).} k{numeric; indicating the size of model used in estimates and predictions.}

item

  • bootstrap
  • residuals
  • r.squared
  • avg.bias
  • max.bias
  • rmsep
  • s1
  • s2
  • k
  • sample.errors
  • s1
  • s2
  • weighted
  • auto
  • n.boot
  • predictions
  • model
  • bootstrap
  • sample.errors
  • method
  • quantiles
  • minDC
  • Dij

itemize

  • observed

code

newdata

eqn

$R^2$

emph

k

Details

This function returns one or more of three sets of results depending on the supplied arguments: [object Object],[object Object],[object Object] The latter is simply a wrapper for bootstrap(model, newdata, ...) - see bootstrap.mat.

References

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

See Also

mat, bootstrap.mat

Examples

Run this code
## Imbrie and Kipp example
## load the example data
data(ImbrieKipp)
data(SumSST)
data(V12.122)

## merge training and test set on columns
dat <- join(ImbrieKipp, V12.122, verbose = TRUE)

## extract the merged data sets and convert to proportions
ImbrieKipp <- dat[[1]] / 100
V12.122 <- dat[[2]] / 100

## fit the MAT model using the chord distance measure
(ik.mat <- mat(ImbrieKipp, SumSST, method = "chord"))

## predict for V12.122 data
predict(ik.mat, V12.122)

Run the code above in your browser using DataLab