Learn R Programming

analogue (version 0.3-3)

Screeplot: Screeplots of model results

Description

Draws screeplots of performance statistics for models of varying complexity.

Usage

Screeplot(x, ...)

## S3 method for class 'default': Screeplot(x, \ldots)

## S3 method for class 'mat': Screeplot(x, k, restrict = 20, display = c("rmse", "rmsep", "avg.bias", "max.bias", "r.squared"), weighted = TRUE, xlab = NULL, ylab = NULL, main = NULL, sub = NULL, ...)

## S3 method for class 'bootstrap': Screeplot(x, k, restrict = 20, display = c("rmse","rmsep","avg.bias","max.bias", "r.squared"), legend = TRUE, loc.legend = "topright", xlab = NULL, ylab = NULL, main = NULL, sub = NULL, ..., lty = c("solid","dashed"))

Arguments

x
object on which method dispatch applied; currently only for class mat and bootstrap.
k
number of analogues to use. If missing 'k' is chosen automatically as the 'k' that achieves lowest RMSE.
restrict
logical; restrict comparison of k-closest model to k $<=$ restrict.
display
which aspect of x to plot? Partial match.
weighted
logical; should the analysis use weighted mean of env data of analogues as fitted/estimated values?
xlab, ylab
x- and y-axis labels respectively.
main, sub
main and subtitle for the plot.
legend
logical; should a legend be displayed on the figure?
loc.legend
character; a keyword for the location of the legend. See legend for details of allowed keywords.
lty
vector detailing the line type to use in drawing the screeplot of the apparent and bootstrap statistics, respectively. Code currently assumes that length(lty) is 2.
...
arguments passed to other graphics functions.

Details

Screeplots are often used to graphically show the results of cross-validation or other estimate of model performance across a range of model complexity.

Five measures of model performance are currently available: i) root mean square error (RMSE); ii) root mean square error of prediction (RMSEP); iii) average bias --- the mean of the model residuals; iv) maximum bias --- the maximum average bias calculated for each of n sections of the gradient of the environmental variable; and v) model $R^2$.

For the bootstrap method, apparent and bootstrap versions of these statistics are available and plotted.

See Also

screeplot

Examples

Run this code
## load the example data
data(swapdiat)
data(swappH)
data(rlgh)
## process so common set of columns for training and test
## number of training set samples
n.train <- nrow(swapdiat)
## merge training and test set on columns
dat <- join(swapdiat, rlgh, verbose = TRUE)
## convert to proportions
dat <- dat / 100
## subset data back into training and test sets
swapdiat <- dat[1:n.train, ]
rlgh <- dat[(n.train+1):nrow(dat), ]
## fit the MAT model using the squared chord distance measure
swap.mat <- mat(swapdiat, swappH, method = "SQchord")
swap.mat

##
Screeplot(swap.mat)

Run the code above in your browser using DataLab