Description Usage Arguments Details Value See Also Examples

View source: R/calculate_stats.R

`CalcModPerf`

calculates model performance statistics for flux output.

1 2 3 | ```
CalcModPerf(flxDf.mod, flxDf.obs, flxCol.mod = "q_cms",
flxCol.obs = "q_cms", stdate = NULL, enddate = NULL,
subdivisions = 1000)
``` |

`flxDf.mod` |
The flux output dataframe (required). Assumes only one forecast point per file, so if you have multiple forecast points in your output dataframe, use subset to isolate a single forecast point's data. Also assumes model output and observation both contain POSIXct fields (called "POSIXct"). |

`flxDf.obs` |
The observed flux dataframe. Assumes only one observation point per file, so if you have multiple observation points in your dataframe, use subset to isolate a single point's data. Also assumes model output and observation both contain POSIXct fields (called "POSIXct"). |

`flxCol.mod` |
The column name for the flux time series for the MODEL data (default="q_cms") |

`flxCol.obs` |
The column name for the flux time series for the OBSERVED data (default="q_cms") |

`stdate` |
Start date for statistics (DEFAULT=NULL, all records will be used). Date MUST be specified in POSIXct format with appropriate timezone (e.g., as.POSIXct("2013-05-01 00:00:00", format="%Y-%m-%d %H:%M:%S", tz="UTC")) |

`enddate` |
End date for statistics (DEFAULT=NULL, all records will be used). Date MUST be specified in POSIXct format with appropriate timezone (e.g., as.POSIXct("2013-05-01 00:00:00", format="%Y-%m-%d %H:%M:%S", tz="UTC")) |

`subdivisions` |
Number of subdivisions used in flow duration curve integration (DEFAULT=1000); increase value if integrate function throws an error. |

`CalcModPerf`

reads a model flux time series (i.e., created using
`ReadFrxstPts`

) and an observation time series (i.e., created
using `ReadUsgsGage`

) and calculates model performance statistics
(Nash-Sutcliffe Efficiency, Rmse, etc.) at various time scales and for low
and high fluxes. The tool will subset data to matching time periods (e.g., if
the observed data is at 5-min increments and modelled data is at 1-hr
increments, the tool will subset the observed data to select only
observations on the matching hour break).

Performance Statistics:

(mod = model output, obs = observations, n =
sample size)

n: sample size

nse: Nash-Sutcliffe Efficiency

*nse = 1 - ( sum((obs - mod)^2) / sum((obs - mean(obs))^2) )*nselog: log-transformed Nash-Sutcliffe Efficiency

*nselog = 1 - ( sum((log(obs) - log(mod))^2) / sum((log(obs) - mean(log(obs)))^2) )*-
cor: correlation coefficient

*cor = cor(mod, obs)* rmse: root mean squared error

*rmse = sqrt( sum((mod - obs)^2) / n )*-
rmsenorm: normalized root mean squared error

*rmsenorm = rmse / (max(obs) - min(obs))* bias: percent bias

*bias = sum(mod - obs) / sum(obs) * 100*msd: mean signed deviation

*msd = mean(mod - obs)*mae: mean absolute error

*mae = mean(abs(mod - obs))*errcom: error in the center-of-mass of the flux, where center-of-mass is the hour/day when 50% of daily/monthly/water-year flux has occurred. Reported as number of hours for daily time scale and number of days for monthly and yearly time scales.

errmaxt: Error in the time of maximum flux. Reported as number of hours for daily time scale and number of days for monthly and yearly time scales).

errfdc: Error in the integrated flow duration curve between 0.05 and 0.95 exceedance thresholds (in native flow units).

Time scales/Flux types:

ts = native model/observation time step (e.g., hourly)

daily = daily time step

monthly = monthly time step

yearly = water-year time step

max10 = high flows; restricted to the portion of the time series where the observed flux is in the highest 10% (native time step)

min10 = low flows; restricted to the portion of the time series where the observed flux is in the lowest 10% (native time step)

A new dataframe containing the model performance statistics.

Other modelEvaluation: `CalcModPerfMulti`

,
`CalcNoahmpFluxes`

,
`CalcNoahmpWatBudg`

,
`CalcStatCategorical`

,
`CalcStatCont`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
## Take forecast point model output for Fourmile Creek (modStrh.mod1.fc) and a
## corresponding USGS gage observation file (obsStrh.fc), both at an hourly time step,
## and calculate model performance statistics. The model forecast point data was
## imported using ReadFrxstPts and the gage observation data was imported using
## ReadUsgsGage.
## Not run:
CalcModPerf(modStrd.chrt.fc, obsStr5min.fc)
> Output:
n nse nselog cor rmse rmsenorm bias msd mae errcom errmaxt errfdc
units count unitless unitless unitless flux units unitless percent flux units flux units hours|days hours|days flux units
t 116 0.81 0.67 0.91 0.211 8.48 7.1 0.0313 0.1385 <NA> <NA> 0.04
daily 116 0.81 0.67 0.91 0.211 8.48 7.1 0.0313 0.1385 0 0 0.04
monthly 5 0.92 0.82 0.96 0.1073 10.35 9.1 0.0324 0.0833 -1.2 0.2 <NA>
yearly 1 <NA> <NA> <NA> <NA> <NA> 7.1 0.0313 0.0313 0 4 <NA>
max10 12 0.46 0.58 0.71 0.348 23.63 -2.8 -0.044 0.248 <NA> <NA> <NA>
min10 12 -385.99 -14.59 0.35 0.1678 538.78 112.4 0.056 0.0592 <NA> <NA> <NA>
## End(Not run)
``` |

mccreigh/rwrfhydro documentation built on May 12, 2018, 3:08 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.