reliabilityCategories: Reliability categories of a probabilistic forecast.

View source: R/reliabilityCategories.R

reliabilityCategoriesR Documentation

Reliability categories of a probabilistic forecast.

Description

Calculates (and draws) reliability diagrams and the related reliability categories, according to Weisheimer et al. 2014 and Manzanas et al. 2017.

Usage

reliabilityCategories(
  hindcast,
  obs,
  regions = NULL,
  n.events = 3,
  labels = NULL,
  n.bins = 10,
  n.boot = 100,
  conf.level = 0.75,
  na.rate = 0.75,
  diagrams = TRUE,
  cex0 = 0.5,
  cex.scale = 20,
  layout = c(1, n.events),
  backdrop.theme = "countries",
  return.diagrams = FALSE
)

Arguments

hindcast

Grid of forecast data

obs

Grid of observations

regions

SpatialPolygons* object SpatialPolygons. delimiting the regions for which the relaiability is calculated. Default is NULL (See details).

n.events

Number of events considered. Default is 3 (terciles)

labels

Character of the names to be given at the events defined in n.events (e.g. c("lower", "middle", "upper")). If NULL (default) numbered events are returned (Event 1 corresponds to the lowest values).

n.bins

(optional): number of probability bins considered. By default n.bins = 10

n.boot

number of samples considered for bootstrapping. By default n.boot = 100

conf.level

Confidence interval for the reliability line. By default conf.level = 0.75 (two sided), as in Weisheimer et al. 2014

na.rate

Allowed proportion of NA values in each region. Regions with proportions higher than na.rate are excuded from the analysis. Default is 0.75.

diagrams

Logical (default = TRUE). Plotting results.

cex0

numeric (default is 0.5). Minimum size of the points shown in the reliability diagrams, i.e. size of the point for the minimum n frequency (n = 1) (see parameter n.bins. The sizes for points that correspond to n > 1 are reescaled according to parameter cex.scale.

cex.scale

numeric (default is 20). Scaling factor for points sizes in the reliability diagrams (see parameter cex0)

layout

integer (default = c(1, n.events)). Sets the layout of panels (rows,cols)

backdrop.theme

Reference geographical lines to be added to the plot. Default is "countries" (See spatialPlot for other options).

return.diagrams

Logical. Available when diagrams = TRUE. If TRUE a trellis object for plotting diagrams is returned.

Details

If parameter regions is NULL (default) the whole region in obs and hindcast is considered for computing reliability. A subregion will be considered If the corresponding SpatialPolygons* object is provided. In these cases, if parameter diagrams = TRUE, reliability diagrams are plotted for each specified event. If a SpatialPolygons* object of multiple subregions is provided, reliability is computed separately for each region and reliability maps are plotted instead.

A SpartialPolygons* object is easily obtained by reading a shapefile with function readOGR.

Value

Grid of reliability categories with an additional data dimension for categories and an additional slot ($ReliabilityCategories) containing the following elements: catname: reliability categories. slope: $slope slope of the reliability line; $lower lower bound confidence for slope (according to "sigboot"); $upper upper bound confidence for slope (according to "sigboot").

If return.diagrams is TRUE, a list of two objects is returned, the grid object ($grid) and a trellis class object ($plot).

Author(s)

R. Manzanas \& M.Iturbide

References

Weisheimer, A., Palmer, T.N., 2014. On the reliability of seasonal climate forecasts. Journal of The Royal Society Interface 11, 20131162. doi:10.1098/rsif.2013.1162

Manzanas, R., Lucero, A., Weisheimer, A., Guti\'errez, J.M., 2017. Can bias correction and statistical downscaling methods improve the skill of seasonal precipitation forecasts? Climate Dynamics, pg 1-16, doi:10.1007/s00382-017-3668-z

See Also

Other visualization functions: bubblePlot(), cascadePlot(), climagram(), spreadPlot(), tercileBarplot(), tercilePlot()

Examples

## Not run: 
data("tas.cfs")
data("tas.ncep")
data("PRUDENCEregions")
require(transformeR)
#select spatio-temporal domain
tas.ncep2 <- subsetGrid(tas.ncep, lonLim = c(-10, 35), latLim = c(35,70), years = 1983:2009)
tas.cfs2 <- subsetGrid(tas.cfs, lonLim = c(-10, 35), latLim = c(35,70), years = 1983:2009)
#interpolate
tas.cfs2.int <- interpGrid(tas.cfs2, getGrid(tas.ncep2))
#calculate reliability
rel.reg <- reliabilityCategories(hindcast = tas.cfs2.int, obs = tas.ncep2,
                                 n.bins = 5, n.boot = 10,
                                 regions = PRUDENCEregions,
                                 return.diagrams = TRUE)
rel <- reliabilityCategories(hindcast = tas.cfs2.int, obs = tas.ncep2,
                             n.bins = 5, n.boot = 10)
# Irregular grids
require(climate4R.datasets) 
data("NCEP_Iberia_tas")
data("CFS_Iberia_tas")
obs <- aggregateGrid(VALUE_Iberia_tas, aggr.y = list(FUN= mean))
hind <- aggregateGrid(interpGrid(NCEP_Iberia_tas, getGrid(obs)), aggr.y = list(FUN= mean))
rel <- reliabilityCategories(hindcast = hind, obs = obs,
                             n.bins = 7, n.boot = 10)

## End(Not run)

SantanderMetGroup/visualizeR documentation built on Oct. 28, 2023, 6:11 a.m.