Derives the MSE of ensemble forecasts stored in long data tables. Can also handle point forecast.
Usage
MSE(
dt,
f,
o = "obs",
by = by_cols_ens_fc_score(),
pool = "year",
mem = "member",
dim.check = TRUE
)
Value
A data table with the scores
Arguments
dt
Data table containing the predictions.
f
column name of the prediction.
o
column name of the observations.
by
column names of grouping variables, all of which need to be columns in dt.
Default is to group by all instances of month, season, lon, lat, system and lead_time that are columns in dt.
pool
column name(s) for the variable(s) along which is averaged, typically just 'year'.
mem
Name of the column identifying the ensemble member. Only used if check_dimension is TRUE. Is NULL for a point forecast.
dim.check
Logical. If True, a simple test whether the dimensions match up is conducted:
The data table should only have one row for each level of c(by,pool,mem)