Title: | Target Diagram |
---|---|
Description: | Implementation of target diagrams using 'lattice' and 'ggplot2' graphics. Target diagrams provide a graphical overview of the respective contributions of the unbiased RMSE and MBE to the total RMSE (Jolliff, J. et al., 2009. "Summary Diagrams for Coupled Hydrodynamic-Ecosystem Model Skill Assessment." Journal of Marine Systems 76: 64–82.) |
Authors: | Oscar Perpinan Lamigueiro [cre, aut] |
Maintainer: | Oscar Perpinan Lamigueiro <[email protected]> |
License: | GPL-2 |
Version: | 0.13 |
Built: | 2024-10-18 02:59:17 UTC |
Source: | https://github.com/oscarperpinan/tdr |
Error Statistics
tdStats(m, o, functions = c("mo", "mm", "sdo", "sdm", "mbe", "mae", "rmse", "nmbe", "cvmbe", "nmae", "cvmae", "nrmse", "cvrmse", "r2", "tStone")) applyStats(models, o, functions = c("mo", "mm", "sdo", "sdm", "mbe", "mae", "rmse", "nmbe", "cvmbe", "nmae", "cvmae", "nrmse", "cvrmse", "r2", "tStone"))
tdStats(m, o, functions = c("mo", "mm", "sdo", "sdm", "mbe", "mae", "rmse", "nmbe", "cvmbe", "nmae", "cvmae", "nrmse", "cvrmse", "r2", "tStone")) applyStats(models, o, functions = c("mo", "mm", "sdo", "sdm", "mbe", "mae", "rmse", "nmbe", "cvmbe", "nmae", "cvmae", "nrmse", "cvrmse", "r2", "tStone"))
m |
Numeric, vector, model values |
models |
Numeric, matrix, model values |
o |
Numeric, vector, observation values |
functions |
Character, name of functions to compute model errors. The package includes definitions for these functions:
There are also functions that normalize the MBE, MAE and RMSE values. |
A data.frame
with a column for each function, and a row for each model.
Oscar Perpiñán Lamigueiro
data(modelEx) ## Analyze one model tdStats(pvModels$M01, pvObs) ## Analyze a set of models applyStats(pvModels, pvObs)
data(modelEx) ## Analyze one model tdStats(pvModels$M01, pvObs) ## Analyze a set of models applyStats(pvModels, pvObs)
Target diagrams with lattice, targetDiagram
, and ggplot2, target_diagram
.
targetDiagram(data, class = "", xlab = expression("RMSEc" %.% "sign(" * sigma^"*" * ")"), ylab = "MBE", auto.key = list(space = "right"), default.scales = list(cex = 0.6), scales = list(), type = "quantile", cuts = seq(0.25, 1, 0.25), par.settings = tdTheme(), ...) target_diagram(data, xlab = expression("RMSEc"%.%"sign("*sigma^"*"*")"), ylab = 'MBE', type = 'quantile', cuts = seq(0.25, 1, .25), ...) tdTheme(pch = 21:25, col.points = brewer.pal(n= 8, 'Dark2'), fill = brewer.pal(n= 8, 'Pastel2'), cex = 1.1, ...)
targetDiagram(data, class = "", xlab = expression("RMSEc" %.% "sign(" * sigma^"*" * ")"), ylab = "MBE", auto.key = list(space = "right"), default.scales = list(cex = 0.6), scales = list(), type = "quantile", cuts = seq(0.25, 1, 0.25), par.settings = tdTheme(), ...) target_diagram(data, xlab = expression("RMSEc"%.%"sign("*sigma^"*"*")"), ylab = 'MBE', type = 'quantile', cuts = seq(0.25, 1, .25), ...) tdTheme(pch = 21:25, col.points = brewer.pal(n= 8, 'Dark2'), fill = brewer.pal(n= 8, 'Pastel2'), cex = 1.1, ...)
data |
A |
class |
Character, the name of the variable that defines the panels of a trellis graphic. |
xlab , ylab
|
Character or expression, define the axis labels. |
auto.key , default.scales , scales
|
Legend and scales customization. Read the |
type |
Character, defines the type of cuts between 'quantile' and 'at'. |
cuts |
Numeric, defines the radius of the RMSE circles. If |
par.settings |
Definition of graphical parameters using |
pch , col.points , fill , cex
|
Arguments for |
... |
The Target Diagram is derived from the relation between the unbiased RMSE, MBE, and RMSE. In a Cartesian coordinate system, the x-axis represents the unbiased RMSE (variance of the error), and the y-axis represents the MBE. Therefore the distance between any point to the origin is equal to the RMSE. Because the unbiased RMSE is always positive, the left area of the coordinate system is empty with this scheme. With additional information this region may be also used: the unbiased RMSE is multiplied by the sign of the difference between the standard deviations of model and observations.
The resulting diagram provides three different measures: whether the model overestimates or underestimates (positive or negative values of the MBE on the y-axis, respectively), whether the model standard deviation is larger or smaller than the standard deviation of the measurements (positive or negative values on the x-axis, respectively), and the error performance as quantified by the RMSE represented as the distance to the coordinates origin. This tool is particularly powerful when comparing competing models.
targetDiagram
is built around the lattice
package, while
target_diagram
is the ggplot2
version.
targetDiagram
uses tdTheme
to define the graphical settings, which is just a wrapper around simpleTheme
.
targetDiagram
produces a trellis object.
target_diagram
produces a ggplot object.
Oscar Perpiñán Lamigueiro
Jolliff, J. K., Kindle, J. C., Shulman, I., Penta, B., Friedrichs, M. A., Helber, R., & Arnone, R. A. (2009). Summary diagrams for coupled hydrodynamic-ecosystem model skill assessment. Journal of Marine Systems, 76(1), 64-82.
xyplot
,
ggplot
,
simpleTheme
,
tdStats
data(modelEx) ## Compute statistics errModel <- applyStats(pvModels, pvObs) ## Display results ## Default settings use type = 'quantile' targetDiagram(errModel, groups = model) target_diagram(errModel, fill = 'model') ## whose breaks can be defined with 'cuts' targetDiagram(errModel, groups = model, type = 'quantile', cuts = seq(0, 1, .1)) target_diagram(errModel, fill = 'model', type = 'quantile', cuts = seq(0, 1, .1)) ## Alternatively, with type = 'at' ## one can define manually the breaks targetDiagram(errModel, groups = model, type = 'at', cuts = seq(0, .1, .02)) target_diagram(errModel, fill = 'model', type = 'at', cuts = seq(0, .1, .02))
data(modelEx) ## Compute statistics errModel <- applyStats(pvModels, pvObs) ## Display results ## Default settings use type = 'quantile' targetDiagram(errModel, groups = model) target_diagram(errModel, fill = 'model') ## whose breaks can be defined with 'cuts' targetDiagram(errModel, groups = model, type = 'quantile', cuts = seq(0, 1, .1)) target_diagram(errModel, fill = 'model', type = 'quantile', cuts = seq(0, 1, .1)) ## Alternatively, with type = 'at' ## one can define manually the breaks targetDiagram(errModel, groups = model, type = 'at', cuts = seq(0, .1, .02)) target_diagram(errModel, fill = 'model', type = 'at', cuts = seq(0, .1, .02))