TargetDiagram {tdr}R Documentation

Target Diagrams

Description

Target diagrams with lattice, targetDiagram, and ggplot2, target_diagram.

Usage


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,
        ...)

Arguments

data

A data.frame with these columns: nrmse (Root Mean Square Error), nmbe (Mean Bias Error), sdm (Standard Deviation of the model), sdo (Standard Deviation of observations)

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 xyplot and panel.xyplot help pages for details.

type

Character, defines the type of cuts between 'quantile' and 'at'.

cuts

Numeric, defines the radius of the RMSE circles. If type = 'quantile' it defines the probabilities with values between 0 and 1, and the radius are such that the circles are the corresponding quantile. If type = 'at' cuts defines the radius of the circles.

par.settings

Definition of graphical parameters using simpleTheme or its wrapper tdTheme

pch, col.points, fill, cex

Arguments for simpleTheme

...

Additional arguments for xyplot or ggplot

Details

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.

Value

targetDiagram produces a trellis object. target_diagram produces a ggplot object.

Author(s)

Oscar Perpiñán Lamigueiro

References

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.

See Also

xyplot, ggplot, simpleTheme, tdStats

Examples

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))


[Package tdr version 0.13 Index]