RMSEP: Root mean square error of prediction

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/RMSEP.R

Description

Calculates or extracts the RMSEP from transfer function models.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
RMSEP(object, ...)

## S3 method for class 'mat'
RMSEP(object, k, weighted = FALSE,
          ...)

## S3 method for class 'bootstrap.mat'
RMSEP(object, type = c("birks1990", "standard"),
          ...)

## S3 method for class 'bootstrap.wa'
RMSEP(object, type = c("birks1990", "standard"),
          ...)

Arguments

object

An R object.

k

numeric; the number of analogues to use in calculating the RMSEP. May be missing. If missing, k is extracted from the model using getK.

weighted

logical; Return the RMSEP for the weighted or unweighted model? The default is for an unweighted model.

type

The type of RMSEP to return/calculate. See Details, below.

...

Arguments passed to other methods.

Details

There are two forms of RMSEP in common usage. Within palaeoecology, the RMSEP of Birks et al. (1990) is most familiar:

RMSEP = sqrt(s[1]^2 + s[2]^2)

where where s[1] is the standard deviation of the out-of-bag (OOB) residuals and s[2] is the mean bias or the mean of the OOB residuals.

In the wider statistical literature, the following form of RMSEP is more commonly used:

RMSEP = sqrt(mean((y[i] - yhat[i])^2))

where y[i] are the observed values and \hat{y}_i the transfer function predictions/fitted values.

The first form of RMSEP is returned by default or if type = "birks1990" is supplied. The latter form is returned if type = "standard" is supplied.

The RMSEP for objects of class "mat" is a leave-one-out cross-validated RMSEP, and is calculated as for type = "standard".

Value

A numeric vector of length 1 that is the RMSEP of object.

Author(s)

Gavin L. Simpson

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, wa, bootstrap.wa.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## 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 squared chord distance measure
(ik.mat <- mat(ImbrieKipp, SumSST, method = "chord"))

## Leave-one-out RMSEP for the MAT model
RMSEP(ik.mat)

## bootstrap training set
(ik.boot <- bootstrap(ik.mat, n.boot = 100))

## extract the Birks et al (1990) RMSEP
RMSEP(ik.boot)

## Calculate the alternative formulation
RMSEP(ik.boot, type = "standard")

analogue documentation built on June 21, 2021, 1:08 a.m.