Learn R Programming

analogue (version 0.17-7)

stdError: Standard error of MAT fitted and predicted values

Description

Computes the (weighted) standard deviation of the environment for the k-closest analogues for each sample. This was proposed as one measure of reconstruction uncertainty for MAT models (ter Braak, 1995).

Usage

stdError(object, ...)

# S3 method for mat stdError(object, k, weighted = FALSE, ...)

# S3 method for predict.mat stdError(object, k, weighted = FALSE, ...)

Value

A named numeric vector of weighted standard deviations of the environment for the k closest analogues used to compute the MAT predicted values.

The returned vector has attributes "k" and "auto", indicating the number of analogues used and whether this was determined from object or supplied by the user.

Arguments

object

Object for which the uncertainty measure is to be computed. Currently methods for mat and predict.mat.

k

numeric; how many analogues to take? If missing, the default, k is chosen using getK.

weighted

logical; use a weighted computation?

...

Additional arguments passed to other methods. Currently not used.

Author

Gavin L. Simpson

Details

Two types of standard error can be produced depending upon whether the mean or weighted mean of \(y\) for the \(k\) closest analogues is used for the MAT predictions. If weighted = FALSE then the usual standard deviation of the response for the \(k\) closest analogues is returned, whereas for weighted = TRUE a weighted standard deviation is used. The weights are the inverse of the dissimilarity between the target observation and each of the \(k\) closest analogues.

References

Simpson, G.L. (2012) Analogue methods in palaeolimnology. In Birks, H.J.B, Lotter, A.F. Juggins S., and Smol, J.P. (Eds) Tracking Environmental Change Using Lake Sediments, Volume 5: Data Handling and Numerical Techniques. Springer, Dordrecht.

ter Braak, C.J.F. (1995) Non-linear methods for multivariate statistical calibration and their use in palaeoecology: a comparison of inverse (k-nearest neighbours, partial least squares, and weighted averaging partial least squares) and classical approaches. Chemometrics and Intelligent Laboratory Systems 28:165--180.

See Also

minDC, mat, predict.mat.

Examples

Run this code
## Imbrie and Kipp Sea Surface Temperature
data(ImbrieKipp)
data(SumSST)
data(V12.122)

## merge training set and core samples
dat <- join(ImbrieKipp, V12.122, verbose = TRUE)

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

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

## standard errors - unweighted
stdError(ik.mat)
## standard errors - weighted version for above
stdError(ik.mat, k = getK(ik.mat), weighted = TRUE)

## standard errors - weighted; note this uses more (7) analogues
## than the above as this model had lowest LOO error
stdError(ik.mat, weighted = TRUE)

## reconstruct for the V12-122 core data
coreV12.mat <- predict(ik.mat, V12.122, k = 3)
## standard errors
stdError(coreV12.mat)

Run the code above in your browser using DataLab