valueMeasure: VALUE measure calculation for climate4R grids

View source: R/valueMeasure.R

valueMeasureR Documentation

VALUE measure calculation for climate4R grids

Description

VALUE measure calculation for climate4R grids

Usage

valueMeasure(
  y,
  x,
  measure.code,
  index.code = NULL,
  return.NApercentage = TRUE,
  parallel = FALSE,
  max.ncores = 16,
  condition = NULL,
  threshold = NULL,
  which.wetdays = NULL,
  ncores = NULL
)

Arguments

y

Grid (also station data) of observations

x

Grid (also station data) of the grid that is being validated

measure.code

characher of the measure code to be computed (use VALUE::show.measures)

index.code

Default is NULL. characher of the index code to be computed (use VALUE::show.indices).

return.NApercentage

Logical to also return or not a grid containing NA percentage information.

parallel

Logical. Should parallel execution be used?

max.ncores

Integer. Upper bound for user-defined number of cores.

condition

Inequality operator to be applied to the given "threshold". Only the days that satisfy the condition will be used for validation. "GT" = greater than the value of threshold, "GE" = greater or equal, "LT" = lower than, "LE" = lower or equal than.

threshold

Numeric value. Threshold used as reference for the condition. Default is NULL. If a threshold value is supplied with no specificaction of the argument condition. Then condition is set to "GE".

which.wetdays

A string, default to NULL. Infer the measure/index taiking into account only the wet days of the temporal serie. As there are two temporal series (i.e., x and y), the subsetting can be done according to the observed (i.e., y) serie, to the intersection of the both wet days subsets or finally subset each serie according to its own wet days subset. The possible values are c("Observation","Intersection","Independent"). When performing an index instead of a measure the only possible value is "Independent".

ncores

Integer number of cores used in parallel computation. Self-selected number of cores is used when ncpus = NULL (the default), or when maxcores exceeds the default ncores value.

Details

Some measures are computed directly from the original time series (e.g. temporal correlation), whereas others are computed upon previouly computed indices (e.g. mean bias). Thus, argument index.code must be provided for the latter case.

Value

A grid of the index or a list containing the grid of the index and the grid of NA percenatage

Author(s)

M. Iturbide

Examples

require(transformeR)
require(climate4R.datasets)
data(EOBS_Iberia_tas)
data(CFS_Iberia_tas)
y <- EOBS_Iberia_tas
x <- CFS_Iberia_tas
bias <- valueMeasure(y, x, measure.code = "bias", index.code = "mean")
str(bias$Measure)
str(bias$NAmeanPercentage)

SantanderMetGroup/climate4R.value documentation built on July 8, 2023, 8:01 a.m.