PlotForecastPDF {CSTools}R Documentation

Plot one or multiple ensemble forecast pdfs for the same event

Description

This function plots the probability distribution function of several ensemble forecasts. Separate panels are used to plot forecasts valid or initialized at different times or by different models or even at different locations. Probabilities for tercile categories are computed, plotted in colors and annotated. An asterisk marks the tercile with higher probabilities. Probabilities for extreme categories (above P90 and below P10) can also be included as hatched areas. Individual ensemble members can be plotted as jittered points. The observed value is optionally shown as a diamond.

Usage

PlotForecastPDF(
  fcst,
  tercile.limits,
  extreme.limits = NULL,
  obs = NULL,
  plotfile = NULL,
  title = "Set a title",
  var.name = "Varname (units)",
  fcst.names = NULL,
  add.ensmemb = c("above", "below", "no"),
  color.set = c("ggplot", "s2s4e", "hydro", "vitigeoss"),
  memb_dim = "member"
)

Arguments

fcst

A dataframe or array containing all the ensember members for each forecast. If 'fcst' is an array, it should have two labelled dimensions, and one of them should be 'members'. If 'fcsts' is a data.frame, each column shoul be a separate forecast, with the rows beeing the different ensemble members.

tercile.limits

An array or vector with P33 and P66 values that define the tercile categories for each panel. Use an array of dimensions (nforecasts,2) to define different terciles for each forecast panel, or a vector with two elements to reuse the same tercile limits for all forecast panels.

extreme.limits

(optional) An array or vector with P10 and P90 values that define the extreme categories for each panel. Use an array of (nforecasts,2) to define different extreme limits for each forecast panel, or a vector with two elements to reuse the same tercile limits for all forecast panels. (Default: extreme categories are not shown).

obs

(optional) A vector providing the observed values for each forecast panel or a single value that will be reused for all forecast panels. (Default: observation is not shown).

plotfile

(optional) A filename (pdf, png...) where the plot will be saved. (Default: the plot is not saved).

title

A string with the plot title.

var.name

A string with the variable name and units.

fcst.names

(optional) An array of strings with the titles of each individual forecast.

add.ensmemb

Either to add the ensemble members 'above' (default) or 'below' the pdf, or not ('no').

color.set

A selection of predefined color sets: use 'ggplot' (default) for blue/green/red, 's2s4e' for blue/grey/orange, 'hydro' for yellow/gray/blue (suitable for precipitation and inflows) or the "vitigeoss" color set.

memb_dim

A character string indicating the name of the member dimension.

Value

A ggplot object containing the plot.

Author(s)

Llorenç Lledó llledo@bsc.es

Examples

fcsts <- data.frame(fcst1 = rnorm(10), fcst2 = rnorm(10, 0.5, 1.2))
PlotForecastPDF(fcsts,c(-1,1))

[Package CSTools version 5.2.0 Index]