Predicted values based on a MAT model object.
# S3 method for mat
predict(object, newdata, k, weighted = FALSE,
        bootstrap = FALSE, n.boot = 1000,
        probs = c(0.01, 0.025, 0.05, 0.1), ...)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.
vector of observed environmental values.
a list containing the model or non-bootstrapped estimates for the training set. With the following components:
estimatedestimated values for "y", the
	environment.
residualsmodel residuals.
r.squaredModel \(R^2\) between observed and
	estimated values  of "y".
avg.biasAverage bias of the model residuals.
max.biasMaximum bias of the model residuals.
rmsepModel error (RMSEP).
knumeric; indicating the size of model used in estimates and predictions.
a list containing the bootstrap estimates for the training set. With the following components:
estimatedBootstrap estimates for "y".
residualsBootstrap residuals for "y".
r.squaredBootstrap derived \(R^2\) between observed
	and estimated values of "y".
avg.biasAverage bias of the bootstrap derived model residuals.
max.biasMaximum bias of the bootstrap derived model residuals.
rmsepBootstrap derived RMSEP for the model.
s1Bootstrap derived S1 error component for the model.
s2Bootstrap derived S2 error component for the model.
knumeric; indicating the size of model used in estimates and predictions.
a list containing the bootstrap-derived sample specific errors for the training set. With the following components:
rmsepBootstrap derived RMSEP for the training set samples.
s1Bootstrap derived S1 error component for training set samples.
s2Bootstrap derived S2 error component for training set samples.
logical; whether the weighted mean was used instead of the mean of the environment for k-closest analogues.
logical; whether "k" was choosen automatically or
    user-selected.
numeric; the number of bootstrap samples taken.
a list containing the model and bootstrap-derived estimates for the new data, with the following components:
observedthe observed values for the new samples ---
	only if newenv is provided.
modela list containing the model or
	non-bootstrapped estimates for the new samples. A list with the
	same components as model, above.
bootstrapa list containing the bootstrap estimates
	for the new samples, with some or all of the same components as
	bootstrap, above.
sample.errorsa list containing the bootstrap-derived
	sample specific errors for the new samples, with some or all of
	the same components as sample.errors, above.
the dissimilarity measure used to fit the underlying MAT models.
probability quantiles of the pairwise dissimilarities computed from the training set.
smallest distances between each sample in newdata
    and the training set samples.
dissimilarities between newdata and training set
    samples.
an object of mat.
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
    join for how to do this. If newdata not
    provided, the fitted values are returned.
number of analogues to use. If missing, k is chosen
    automatically as the k that achieves lowest RMSE.
logical; should the analysis use the weighted mean of environmental data of analogues as predicted values?
logical; should bootstrap derived estimates and
    sample specific errors be calculated-ignored if newdata is
    missing.
numeric; the number of bootstrap samples to take.
numeric; vector of probabilities with values in [0,1].
arguments passed to of from other methods.
Gavin L. Simpson
This function returns one or more of three sets of results depending on the supplied arguments:
the fitted values of the mat
      model are returned if newdata is missing.
the predicted values for some new samples
      are returned if newdata is supplied. Summary model
      statistics and estimated values for the training set are also
      returned.
if newdata
      is supplied and bootstrap = TRUE, the predicted values for
      newdata plus bootstrap estimates and standard errors for the
      new samples and the training set are returned.
The latter is simply a wrapper for bootstrap(model, newdata,
    ...) - see bootstrap.mat.
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.
mat, bootstrap.mat
## 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