screeplot | R Documentation |
Draws screeplots of performance statistics for models of varying complexity.
## S3 method for class 'mat'
screeplot(x, k, restrict = 20,
display = c("rmsep", "avg.bias",
"max.bias", "r.squared"),
weighted = FALSE, col = "red", xlab = NULL,
ylab = NULL, main = NULL, sub = NULL, ...)
## S3 method for class 'bootstrap.mat'
screeplot(x, k, restrict = 20,
display = c("rmsep","avg.bias","max.bias",
"r.squared"),
legend = TRUE, loc.legend = "topright",
col = c("red", "blue"),
xlab = NULL, ylab = NULL,
main = NULL, sub = NULL,
...,
lty = c("solid","dashed"))
x |
object of class |
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
|
display |
which aspect of |
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 |
col |
Colours for lines drawn on the screeplot. Method for class
|
lty |
vector detailing the line type to use in drawing the
screeplot of the apparent and bootstrap statistics,
respectively. Code currently assumes that |
... |
arguments passed to other graphics functions. |
Screeplots are often used to graphically show the results of cross-validation or other estimate of model performance across a range of model complexity.
Four measures of model performance are currently available: i) root
mean square error of prediction (RMSEP); ii) average bias — the
mean of the model residuals; iii) 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 maximum bias statistic, the response (environmental) gradient is split into n = 10 sections.
For the bootstrap
method, apparent and bootstrap
versions of these statistics are available and plotted.
Currently only models of class mat
and
bootstrap.mat
are supported.
Gavin Simpson
screeplot
## 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"))
screeplot(ik.mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.