Skip to contents

Supports inverse, square root, power, and Box-Cox transformations of runoff data. Log transformation is included but generally not recommended for KGE calculations (see airGR or Santos, 2018). Use Use KGEtang instead.

Usage

transfo_q(Q, q_transfo_type = "none", lambda = 0.25, ...)

Arguments

Q

A numeric vector, matrix, or data frame of runoff values.

q_transfo_type

A string specifying the transformation type. Options are: "none", "sqrt", "inv", "log", "boxcox", "boxcoxsantos", and "power".

lambda

A numeric value used for Box-Cox and power transformations. Default is 0.25.

...

Additional arguments passed to mean(), e.g., na.rm = TRUE, used in boxcoxsantos.

Value

Transformed runoff data in the same format as input.

Note

Consider how to handle infinite values resulting from transformations.

Examples

transfo_q(array(0:10, c(2, 5)), "sqrt")
#>      [,1]     [,2]     [,3]     [,4]     [,5]
#> [1,]    0 1.414214 2.000000 2.449490 2.828427
#> [2,]    1 1.732051 2.236068 2.645751 3.000000