eva: Model statistical evaluation

View source: R/eva.R

evaR Documentation

Model statistical evaluation

Description

Statistical (or categorical) evaluation from 2 data.frames. The input data.frames (model and observation) must contain a "date" column (containing POSIXlt). The function perform some simple case tests and perform the time pairing of observations and model data and can calculate the statistical evaluation or categorical evaluation.

Usage

eva(
  mo,
  ob,
  rname = site,
  table = NULL,
  site = "ALL",
  wd = FALSE,
  fair = NULL,
  cutoff = NA,
  cutoff_NME = NA,
  no_tz = FALSE,
  nobs = 8,
  eval_function = stat,
  time = "date",
  verbose = TRUE,
  ...
)

Arguments

mo

data.frame with model data

ob

data.frame with observation data

rname

row name of the output (default is site argument)

table

data.frame to append the results

site

name of the stations or "ALL" (default), see notes

wd

default is FALSE, see notes

fair

model data.frame (or list of names) to perform a fair comparison, see notes

cutoff

minimum (optionally the maximum) valid value for observation

cutoff_NME

minimum (optionally the maximum) valid value for observation for NME

no_tz

ignore tz from input (force GMT)

nobs

minimum number of valid observations, default is 8

eval_function

evaluation function (default is stat)

time

name of the time column (containing time in POSIXct)

verbose

display additional information

...

arguments to be passing to stats and plot

Value

data.frame with statistical values from stat or cate functions.

Note

fair can be a data.frame or a character string to be used for the analysis, alternatively the function

for wind direction a rotation of 360 (or -360) is applied to minimize the wind direction difference.

If site == 'ALL' (default) all the columns from observations are combined in one column (same for observation) and all the columns are evaluated together.

Special thanks to Kiarash and Libo to help to test the wind direction option.

See Also

stat for additional information about the statistical evaluation and cate for categorical evaluation.

Examples

model <- readRDS(paste0(system.file("extdata",package="eva3dm"),
                        "/model.Rds"))
obs   <- readRDS(paste0(system.file("extdata",package="eva3dm"),
                        "/obs.Rds"))

# if there is no observed data
# the function return an empty row
table <- eva(mo = model, ob = obs, site = "VVIbes")
print(table)

# if the site are not in the input data frame a message is displayed
# and the function return an empty row
table <- eva(mo = model, ob = obs, site = "Ibirapuera")
print(table)

# calculating statistical with a few observed values
table <- eva(mo = model, ob = obs, site = "Americana")
print(table)

# calculating categorical (using 2 for threshold) with a few observed values
table <- eva(mo = model, ob = obs, site = "Americana",
             eval_function = cate, threshold = 2)
print(table)

# calculating categorical (using 2 for threshold) with a few observed values
table <- eva(mo = model, ob = obs, site = "Americana",
             eval_function = cate, threshold = 10)
print(table)


eva3dm documentation built on April 4, 2025, 5:11 a.m.