residuals.bootstrap {analogue}R Documentation

Extract Bootstrapped Model Residuals

Description

residuals is a generic function which extracts model residuals from objects returned by modeling functions. residuals.bootstrap.mat is a residuals method for mat models.

The abbreviated form of this function is resid.

Usage

## S3 method for class 'bootstrap':
residuals(object, which = c("apparent", "bootstrap"), ...) 

Arguments

object an object of class bootstrap.
which character; which set of residuals to return, the apparanet residuals or the residuals of the bootstrap-derived estimates?
... arguments pass to or from other methods.

Value

A list containg the requested residuals and metadata, with the following components:

apparent residuals for the MAT-estimated model.
bootstrap residuals for the bootstrapped MAT model.
k numeric; indicating the size of model used in estimates and predictions.
n.boot numeric; the number of bootstrap samples taken.
auto logical; whether "k" was choosen automatically or user-selected.
weighted logical; whether the weighted mean was used instead of the mean of the environment for k-closest analogues.

Author(s)

Gavin L. Simpson

See Also

residuals, mat, bootstrap.

Examples

## continue the RLGH example from ?join
example(join)

## fit the MAT model using the squared chord distance measure
swap.mat <- mat(swapdiat, swappH, method = "SQchord")

## bootstrap training set
swap.boot <- bootstrap(swap.mat, k = 10, n.boot = 1000)

## residuals
resid(swap.boot) # uses abbreviated form

[Package analogue version 0.3-3 Index]