calc_fc_cats: Get probabilities of forecast categories

Description Usage Arguments Value Note Examples

View source: R/calc_fc_cats.R

Description

Calculates index for hindcasts and forecasts and then derives category thresholds from hindcasts and calculates forecast probabilities for each category. The function works with gridded or station data (all input data needs to be of same type) and first calculates the chosen index (using calc_index) for hindcasts and forecasts and then divides the forecast into categories (e.g. terciles for ncat=3) based on the climatology of the hindcasts. It outputs the forecast probabilities for each category as well as the category thresholds.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
calc_fc_cats(
  fc,
  hc,
  index,
  index_args = list(),
  selyears = NULL,
  prob,
  ncat = 3,
  counts = FALSE
)

Arguments

fc

Forecasts. "climindvis_index" object of type fc_p/fc_grid as output from make_object using an ensemble daily seasonal forecasts.

hc

Hindcasts. "climindvis_index" object of type hc_p/hc_grid as output from make_object using an ensemble of daily seasonal hindcasts.

index

Name of index to be calculated., e.g. index = "dd" or index = "tnn". For list of indices see indices_list

index_args

List of arguments for index. See indices_list.

selyears

Integer array of years to be selected from data. For indices with quantiles, years as defined in index_args are used for quantile calculation, but only selected years are plotted. For functions using seasonal forecast data, selyears is only applied to hindcasts.

prob

Probability thresholds for converting continuous forecasts to category forecasts. If not provided then ncat equidistant categories are calulated: (1:(ncat-1))/ncat).

ncat

Number of forecast categories. Default = 3.

counts

Logical. Should number of ensemble members per category be returned instead of probabilities. Default=FALSE

Value

Object of class index and "climindvis_fc" with following entries:

Note

This function either returns the forecast probabilities (cprob) or, if counts is set to TRUE, the number of ensemble members per category (ccount) . Forecast probabilities are calculated as follows: ccounts/number of ensemble members *100. These values are rounded to the nearest integer, therefore adding the forecast probabilities of all categories may not always add up to 100. Note that for some forecast the year dimension might be greater than one, e.g. for a November forecast and monthly temporal aggregation, the first two months (Nov. + Dez) are from another year than the following months.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Load example climindvis objects:

data("object_hc_st", "object_fc_st")

calc_fc_cats(fc = object_fc_st, hc = object_hc_st, index = "tnn", index_args = list(aggt="seasonal"))


data("object_hc_grid", "object_fc_grid")

calc_fc_cats(fc = object_fc_grid, hc = object_hc_grid, index = "tnn", index_args = list(aggt="seasonal"))

Climandes/ClimIndVis documentation built on Oct. 24, 2021, 10:52 a.m.