Learn R Programming

verification (version 1.09)

value: Forecast Value Function

Description

Calculates the economic value of a forecast based on a cost/loss ratio.

Usage

value(obs, pred= NULL, baseline = NULL, cl = seq(0.05, 0.95, 0.05),             plot = TRUE, all = FALSE, thresholds = seq(0.05, 0.95, 0.05), ylim = c(-0.1, 0.5), xlim = c(0,1), ...)

Arguments

obs
A vector of binary observations or a contingency table summary of values in the form c(n11, n01, n10, n00) where in nab a = obs, b = forecast.
pred
A vector of probablistic predictions.
baseline
Baseline or naive forecast. Typically climotology.
cl
Cost loss ratio. The relative value of being unprepared and taking a loss to that of un-necessarily preparing. For example, cl = 0.1 indicates it would cost $ 1 to prevent a $10 loss. This defaults to the sequence 0.05 to 0.95 by 0.05
plot
Should a plot be created? Default is TRUE
all
In the case of probablistic forecasts, should value curves for each thresholds be displayed.
thresholds
Thresholds considered for a probalistic forecast.
ylim, xlim
Plotting options.
...
Options to be passed into the plotting function.

Value

  • If assigned to an object, the following values are reported.
  • vmaxMaximum value
  • VVector of values for each cl value
  • FConditional false alarm rate.
  • HConditional hit rate
  • clVector of cost lost ratios.
  • sBase rate

References

Jolliffe, Ian and David B. Stephensen (2003) Forecast Verification: A Practioner's Guide in Atmospheric Science, Chapter 8. Wiley

Examples

Run this code
## value as a contigency table
## Finley tornado data

obs<- c(28, 72, 23, 2680) 
value(obs)
aa <- value(obs)
aa$Vmax # max value

## probablistic forecast example
 obs  <- round(runif(100) )
 pred <-  runif(100)

value(obs, pred, main = "Sample Plot",
             thresholds = seq(0.02, 0.98, 0.02) )

Run the code above in your browser using DataLab