Learn R Programming

eva3dm (version 0.99.1)

eva: 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,
  ...
)

Value

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

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

See Also

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

Examples

Run this code
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)

Run the code above in your browser using DataLab