Calculates model performace metrics from the netcdf file generated by running `run_ensemble`
Usage
calc_fit(
ncdf,
list = NULL,
model,
var = "temp",
dim = "model",
dim_index = 1,
qualfun = qual_fun,
avfun = "mean"
)
Arguments
- ncdf
Path to the netcdf file generated by running `run_ensemble`
- list
Alternatively to `ncdf` a list of siimulated variables, as returned by `run_ensemble()` when argument `return_list = TRUE`
- model
Vector of models for which to calculate the performance measures
- var
Variable for which to calculate the performance measures. Defaults to "temp".
- dim
character; NetCDF dimensions to extract. Must be either "member" or "model". Defaults to "model". Only used if using the netCDF file. Currently only works with "model".
- dim_index
numeric; Index of dimension chosen to extract from. Defaults to 1. Only used if using the netCDF file.
- qualfun
Function to calculate the performance measures. Per default calculates root mean suqared error (rmse), Nash-Shutcliff efficiency (nse), Pearson correlation (r), bias (bias), mean absolute error (mae), normalized mean absolute error (nmae), and bias. Can be any function that takes observed data as first, and simulated data at the same time and depth as the second argument.
- avfun
Name of the function to calculate the ensemble average, defaults to "mean"
Examples
if (FALSE) { # \dontrun{
# using standard quality measures
calc_fit(ncdf = "output/ensemble_output.nc",
model = c("FLake", "GLM", "GOTM", "Simstrat", "MyLake"),
var = "temp")
# using own performance measure
calc_fit(ncdf = "output/ensemble_output.nc",
model = c("FLake", "GLM", "GOTM", "Simstrat", "MyLake"),
var = "temp", qualfun = function(O, S) mean(O - S, na.rm = TRUE))
} # }