objective_fun: Calculate statistical measures of goodness of fit for...

View source: R/Fun_Objective-func.R

objective_funR Documentation

Calculate statistical measures of goodness of fit for DYRESM-CAEDYM model simulations.

Description

calculate the below five objective functions that are commonly used to measure goodness of fit: 1) Nash-Sutcliffe Efficiency coefficient (NSE), 2) Root Mean Square Error (RMSE), 3) Mean Absolute Error (MAE), 4) Relative Absolute Error (RAE), and 5) Pearson's r (Pearson).

Usage

objective_fun(
  sim,
  obs,
  fun = c("NSE", "RMSE"),
  start.date,
  end.date,
  min.depth,
  max.depth,
  by.value
)

Arguments

sim

a matrix of a simulated water quality variable values with column of time and row of depth. This matrix can be generated by running the "interpol" function.

obs

a data frame having three columns to describe observed values of a water quality variable. These three columns are 'Date' (as '%Y-%m-%d'), 'Depth', and the designated variable name which can be found from the var.name column of 'data(output_name)'. An example of such a data frame can be found with 'data(obs_temp)'

fun

objective function(s) to be calculated. Select any from 'NSE', 'RMSE', 'MAE', 'RAE', and 'Pearson'. Multiple selections are allowed.

start.date, end.date

the start and end simulation dates for the DYRESM-CAEDYM model run. The date format must be "%Y-%m-%d".

min.depth, max.depth

the minimum and maximum depths of the simulation matrix.

by.value

the value of increment at which the depth of layers increases from the mim.depth to max.depth in the simulation matrix.

Value

a list of objective function values.


dycdtools documentation built on Nov. 22, 2022, 1:12 a.m.