Skip to contents

Compute all verification scores for an ensemble.

Usage

ens_verify(
  .fcst,
  parameter,
  verify_members = TRUE,
  thresholds = NULL,
  groupings = "lead_time",
  circle = NULL,
  rel_probs = NA,
  num_ref_members = NA,
  spread_drop_member = NULL,
  jitter_fcst = NULL,
  climatology = "sample",
  hexbin = TRUE,
  num_bins = 30,
  rank_hist = TRUE,
  crps = TRUE,
  brier = TRUE,
  roc = TRUE,
  econ_val = TRUE,
  show_progress = TRUE,
  ...
)

# S3 method for harp_ens_point_df
ens_verify(
  .fcst,
  parameter,
  verify_members = TRUE,
  thresholds = NULL,
  groupings = "lead_time",
  circle = NULL,
  rel_probs = NA,
  num_ref_members = NA,
  spread_drop_member = NULL,
  jitter_fcst = NULL,
  climatology = "sample",
  hexbin = TRUE,
  num_bins = 30,
  rank_hist = TRUE,
  crps = TRUE,
  show_progress = TRUE,
  brier = TRUE,
  roc = TRUE,
  econ_val = TRUE,
  fcst_model = NULL,
  ...
)

Arguments

.fcst

A harp_df or harp_list object with tables that have a column for observations, or a single forecast table.

parameter

The name of the column for the observations data. Can be the column name, quoted, or unquoted. If a variable it should be embraced - i.e. wrapped in {{}}.

verify_members

Whether to verify the individual members of the ensemble. Even if thresholds are supplied, only summary scores are computed. If you wish to compute categorical scores, the separate det_verify function must be used.

thresholds

A numeric vector of thresholds for which to compute the threshold based scores. Set to NULL (the default) to only compute summary scores.

groupings

The groups for which to compute the scores. See group_by for more information of how grouping works.

circle

If set the parameter is assumed to be cyclic for bias calculations. Should be this distance around a circle in the units of the parameter, so would typically have a value of 360 for degrees or 2 * pi for radians.

rel_probs

Probabilities to use for reliability diagrams. Set to NA (the default) to select automatically.

num_ref_members

For "fair" scores, the score is scaled to be valid for this number of ensemble members. Set to NA (the default) to not modify the score.

spread_drop_member

Which members to drop for the calculation of the ensemble variance and standard deviation. For harp_fcst objects, this can be a numeric scalar - in which case it is recycled for all forecast models; a list or numeric vector of the same length as the harp_fcst object, or a named list with the names corresponding to names in the harp_fcst object.

jitter_fcst

A function to perturb the forecast values by. This is used to account for observation error in the rank histogram. For other statistics it is likely to make little difference since it is expected that the observations will have a mean error of zero.

climatology

The climatology to use for the Brier Skill Score. Can be "sample" for the sample climatology (the default), a named list with elements eps_model and member to use a member of an eps model in the harp_fcst object for the climatology, or a data frame with columns for threshold and climatology and also optionally lead_time.

hexbin

Logical. Whether to compute hexbins for forecast, observation pairs. Defaults to TRUE. See bin_fcst_obs for more details.

num_bins

The number of bins into which to partition observations for the hexbin computation.

rank_hist

Logical. Whether to compute the rank histogram. Defaults to TRUE. Note that the computation of the rank histogram can be slow if there is a large number (> 1000) of groups.

crps

Logical. Whether to compute the CRPS. Defaults to TRUE.

brier

Logical. Whether to compute the Brier score. Defaults to TRUE. Will be ignored if no thresholds are set.

roc

Logical. Whether to compute the Relative Operating Characteristic (ROC). Defaults to TRUE. Will be ignored if no thresholds are set.

econ_val

Logical. Whether to compute the economic value. Defaults to TRUE. Will be ignored if no thresholds are set.

show_progress

Logical - whether to show progress bars. Defaults to TRUE.

...

Reserved for methods.

fcst_model

The name of the forecast model to use in the fcst_model column of the output. If the function is dispatched on a harp_list object, the names of the harp_list are automatically used.

Value

A list containting three data frames: ens_summary_scores, ens_threshold_scores and det_summary_scores.