View source: R/reliabilityCategories.R
reliabilityCategories | R Documentation |
Calculates (and draws) reliability diagrams and the related reliability categories, according to Weisheimer et al. 2014 and Manzanas et al. 2017.
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
)
hindcast |
Grid of forecast data |
obs |
Grid of observations |
regions |
SpatialPolygons* object |
n.events |
Number of events considered. Default is 3 (terciles) |
labels |
Character of the names to be given at the events defined in |
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 |
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 |
cex.scale |
numeric (default is 20). Scaling factor for points sizes in the reliability diagrams (see parameter |
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 |
return.diagrams |
Logical. Available when |
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
.
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
).
R. Manzanas \& M.Iturbide
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
Other visualization functions:
bubblePlot()
,
cascadePlot()
,
climagram()
,
spreadPlot()
,
tercileBarplot()
,
tercilePlot()
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.