GOF: Goodness of Fit Functions

GOFR Documentation

Goodness of Fit Functions

Description

Numerical goodness-of-fit measures between sim and obs, with treatment of missing values.

Usage

gof(sim, obs, ...)

## Default S3 method:
gof(
  sim,
  obs,
  na.rm = TRUE,
  do.spearman = FALSE,
  s = c(1, 1, 1),
  method = c("2009", "2012"),
  start.month = 1,
  digits = 2,
  fun = NULL,
  ...,
  epsilon.type = c("none", "Pushpalatha2012", "otherFactor", "otherValue"),
  epsilon.value = NA
)

valindex(sim, obs, ...)

## Default S3 method:
valindex(sim, obs, ...)

rPearson(sim, obs, ...)

## Default S3 method:
rPearson(
  sim,
  obs,
  fun = NULL,
  ...,
  epsilon.type = c("none", "Pushpalatha2012", "otherFactor", "otherValue"),
  epsilon.value = NA
)

sKGE(sim, obs, ...)

## Default S3 method:
sKGE(
  sim,
  obs,
  s = c(1, 1, 1),
  na.rm = TRUE,
  method = c("2009", "2012"),
  start.month = 1,
  out.PerYear = FALSE,
  fun = NULL,
  ...,
  epsilon.type = c("none", "Pushpalatha2012", "otherFactor", "otherValue"),
  epsilon.value = NA
)

KGE(sim, obs, ...)

## Default S3 method:
KGE(
  sim,
  obs,
  s = c(1, 1, 1),
  na.rm = TRUE,
  method = c("2009", "2012", "2021"),
  out.type = c("single", "full"),
  fun = NULL,
  ...,
  epsilon.type = c("none", "Pushpalatha2012", "otherFactor", "otherValue"),
  epsilon.value = NA
)

NSE(sim, obs, ...)

## Default S3 method:
NSE(
  sim,
  obs,
  na.rm = TRUE,
  fun = NULL,
  ...,
  epsilon.type = c("none", "Pushpalatha2012", "otherFactor", "otherValue"),
  epsilon.value = NA
)

pbias(sim, obs, ...)

## Default S3 method:
pbias(
  sim,
  obs,
  na.rm = TRUE,
  dec = 1,
  fun = NULL,
  ...,
  epsilon.type = c("none", "Pushpalatha2012", "otherFactor", "otherValue"),
  epsilon.value = NA
)

mae(sim, obs, ...)

## Default S3 method:
mae(
  sim,
  obs,
  na.rm = TRUE,
  fun = NULL,
  ...,
  epsilon.type = c("none", "Pushpalatha2012", "otherFactor", "otherValue"),
  epsilon.value = NA
)

VE(sim, obs, ...)

## Default S3 method:
VE(
  sim,
  obs,
  na.rm = TRUE,
  fun = NULL,
  ...,
  epsilon.type = c("none", "Pushpalatha2012", "otherFactor", "otherValue"),
  epsilon.value = NA
)

Arguments

sim

numeric, vector of simulated values

obs

numeric, vector of observed values

...

further arguments passed to/from other methods.

na.rm

a logical value indicating whether 'NA' should be stripped before the computation proceeds. When an 'NA' value is found at the i-th position in obs OR sim, the i-th value of obs AND sim are removed before the computation.

do.spearman

logical, indicates if the Spearman correlation should be computed. The default is FALSE.

s

argument passed to the KGE function.

method

argument passed to the KGE function.

start.month

argument passed to the sKGE function.

digits

integer, numer of decimal places used for rounding the goodness of fit indexes.

fun

function to be applied to sim and obs in order to obtain transformed values thereof before applying any goodness-of-fit function

epsilon.type

argument used to define a numeric value to be added to both sim and obs before applying fun. It was designed to allow the use of logarithm and other similar functions that do not work with zero values. It must be one of the following possible values:

  • none: no value added to sim or obs.

  • Pushpalatha2012: one hundredth of the mean observed values is added to both sim and obs as described in Pushpalatha et al., 2012.

  • otherFactor: the numeric value defined in epsilon.value is used to multiply the mean observed values instead of the one hundredth (1/100) described in Pushpalatha et al., (2012). The resulting value is then added to both sim and obs.

  • otherValue: the numeric value defined in epsilon.value is directly added to both sim and obs.

epsilon.value

numeric, value to be added to both sim and obs when epsilon = "otherValue".

out.PerYear

logical, argument passed to the sKGE function.

out.type

argument passed to the KGE function.

dec

argument passed to the pbias function.

Details

The gof, mae, pbias, NSE, rPearson, sKGE, and KGE functions are provided to calculate goodness of fit statistics. The functions were adapted from the hydroGOF package https://github.com/hzambran/hydroGOF.

Value

gof Returns a matrix of goodness of fit statistics. mae, pbias, NSE, rPearson, sKGE, and KGE return a numeric of the goodness of fit statistic.

Examples

gof(sim = sample(1:100), obs = sample(1:100))


rcapell/RHYPE documentation built on Feb. 28, 2024, 3:11 p.m.