hydroStats: Calculates Goodness of Fit statistics for MESH output

Description Usage Arguments Value Author(s) See Also Examples

View source: R/hydroStats.R

Description

This function is a wrapper for the function gof in the package hydroGOF. It computes several Goodness of Fit statistics for each station. The output of this function may be used on its own, or to annotate a hydrograph.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
hydroStats(
  MESHvals,
  stationNames = "",
  calStart = "",
  calEnd = "",
  removeMissing = TRUE,
  doSpearman = FALSE,
  doPBFDC = FALSE,
  doLogNSE = TRUE,
  epsilon = "Pushpalatha2012",
  digits = 2,
  j = 1,
  norm = "sd",
  s = c(1, 1, 1),
  method = c("2009", "2012"),
  lQ.thr = 0.7,
  hQ.thr = 0.2
)

Arguments

MESHvals

Required. A data frame of output from a MESH run, as produced by readOutputTimeseriesCSV.

stationNames

Optional. A vector of strings holding station names. If specified, the station names will be used in the returned data frame, otherwise the MESH station numbers will be used.

calStart

Optional. The start date of the calibration period. Must be a string in the format yyyy-mm-dd. If specified, values on and after this date will be designated as the Calibration period. The remaining values will be designated as the Validation period.

calEnd

Optional. The start date of the calibration period. Must be a string in the format yyyy-mm-dd. If specified, values on and after this date will be designated as the Calibration period. The remaining values will be designated as the Validation period.

removeMissing

Required. Should rows with missing values be removed before statistics are calculted? Default is TRUE

doSpearman

Optional. Should Spearman correlation be computed? Default is FALSE.

doPBFDC

Optional. Should percent bias of slope of the midsegment of the FDC be computed? Default is FALSE.

doLogNSE

Optional. Should the NSE of the log-transformed flows be calculated? Default is TRUE.

epsilon

Optional. Value to be added to flows when calculating LogNSE, to prevent calculating the log of zero. The default is Pushpalatha2012, which is 1 percent of the mean observed values. A number may aslo be specified.

digits

Optional. The number of decimal places for rounding goodness of fit statistics. If 0 the default, then it is not set. Default value is 2. Note that percentages like NRMSE and PBIAS will only use a maximum of one decimal place.

j

Optional. Argument passed to the mNSE function in hydroGOF.

norm

Optional. Argument passed to the nrmse function in hydroGOF.

s

Optional. Argument passed to the KGE function in hydroGOF.

method

Optional. Argument passed to the KGE function in hydroGOF.

lQ.thr

Optional. Argument passed to the pbiassfdc function in hydroGOF.

hQ.thr

Optional. Argument passed to the pbiassfdc function in hydroGOF.

Value

Returns a data frame with the following variables: #'

station

station name or number

me

Mean Error

mae

Mean Absolute Error

mse

Mean Squared Error

rmse

Root Mean Square Error

nrmse

Normalized Root Mean Square Error ( -100% <= nrms <= 100% )

PBIAS

Percent Bias

pbiasfdc

PBIAS in the slope of the midsegment of the Flow Duration Curve, if selected

RSR

Ratio of RMSE to the Standard Deviation of the Observations, RSR = rms / sd(obs). ( 0 <= RSR <= +Inf )

rSD

Ratio of Standard Deviations, rSD = sd(sim) / sd(obs)

NSE

Nash-Sutcliffe Efficiency ( -Inf <= NSE <= 1 )

mNSE

Modified Nash-Sutcliffe Efficiency

rNSE

Relative Nash-Sutcliffe Efficiency

d

Index of Agreement ( 0 <= d <= 1 )

d1

Modified Index of Agreement

rd

Relative Index of Agreement

cp

Persistence Index ( 0 <= PI <= 1 )

r

Pearson Correlation coefficient ( -1 <= r <= 1 )

r.Spearman

Spearman Correlation coefficient ( -1 <= r.Spearman <= 1 ), if selected

R2

Coefficient of Determination ( 0 <= R2 <= 1 ).
Gives the proportion of the variance of one variable that is predictable from the other variable

bR2

R2 multiplied by the coefficient of the regression line between sim and obs
( 0 <= bR2 #' <= 1 )

KGE

Kling-Gupta efficiency between sim and obs
( 0 <= KGE <= 1 )

VE

Volumetric efficiency between sim and obs
( -Inf <= VE <= 1)

LogNSE

NSE of log-transformed flows, if selected

If the calibration period is specified, then statistics will be computed separately for the Calibration and Validation periods. The period names and dates will be specified in additional columns.

Author(s)

Kevin Shook

See Also

simpleHydrograph gof

Examples

1
2
3
4
stats <- hydroStats(MESH_streamflows)
stats$NSE
periodStats <- hydroStats(MESH_streamflows, calEnd = "2010-01-01")
periodStats[,1:7]

CentreForHydrology/MESHr documentation built on Jan. 11, 2021, 8:34 p.m.