CalcModPerfMulti calculates model performance statistics for flux
1 2 3
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").
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").
The column name for the flux time series for the MODEL data (default="q_cms")
The column name for the flux time series for the OBSERVED data (default="q_cms")
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"))
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"))
character path/name for file to output the data frame constructed before calculating the statistics and various aggregations. NULL by default gives no output.
A to be inserted in the file name, just before the file extension.
CalcModPerfMulti reads a model flux time series (i.e., created using
ReadFrxstPts) and an observation time series (i.e., created
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).
CalcModPerfMulti calculates the same statistics as
CalcModPerf) but returns results as a single-row vs. multi-row
dataframe. This is intended to streamline compiling statistics for multiple
data runs or multiple sites.
(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).
errflash: Error in the Richards-Baker Flashiness Index
R-B Index = sum(abs(q_t - q_t-1)) / sum(q)
Time scales/Flux types:
t = native model/observation time step (e.g., hourly)
dy = daily time step
mo = monthly time step
yr = 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
## 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: CalcModPerfMulti(modStrd.chrt.fc, obsStr5min.fc) > Output: t_n t_nse t_nselog t_cor t_rmse t_rmsenorm t_bias t_msd t_mae t_errfdc t_errflash 116 0.81 0.67 0.91 0.211 8.48 7.1 0.0313 0.1385 0.04 0.0132 dy_n dy_nse dy_nselog dy_cor dy_rmse dy_rmsenorm dy_bias dy_msd dy_mae dy_errcom dy_errmaxt dy_errfdc dy_errflash 116 0.81 0.67 0.91 0.211 8.48 7.1 0.0313 0.1385 0 0 0.04 0.0092 mo_n mo_nse mo_nselog mo_cor mo_rmse mo_rmsenorm mo_bias mo_msd mo_mae mo_errcom mo_errmaxt yr_n 5 0.92 0.82 0.96 0.1073 10.35 9.1 0.0324 0.0833 -1.2 0.2 1 yr_bias yr_msd yr_mae yr_errcom yr_errmaxt max10_n max10_nse max10_nselog max10_cor max10_rmse max10_rmsenorm max10_bias max10_msd max10_mae 7.1 0.0313 0.0313 0 4 12 0.46 0.58 0.71 0.348 23.63 -2.8 -0.044 0.248 min10_n min10_nse min10_nselog min10_cor min10_rmse min10_rmsenorm min10_bias min10_msd min10_mae 12 -385.99 -14.59 0.35 0.1678 538.78 112.4 0.056 0.0592 ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.