CaseStudy XXII: Limits of Acceptability: NashCascade model
The twentysecond case study considers the modeling of the instantaneous unit hydrograph using the ordinates of Nash (1960) defined as (see case study thirteen)
(22.01) 
where (mm/day) is the simulated streamflow at time t (days), g () denotes the number of reservoirs, (days) signifies the recession constant, and is the gamma function

(22.02) 
which satisfies the recursion .
A n = 25day period with synthetic daily streamflow data was generated by driving Equation (22.01) with an artificial precipitation record using g = 2 reservoirs, and a recession constant of days. This artificial data set is subsequently perturbed with a heteroscedastic measurement error (nonconstant variance) with standard deviation equal to 10% of the original simulated discharge values. We store this record in the nvector, and use data set to derive the posterior distribution of the two NashCascade parameters of Equation (22.01).
We do not use a likelihood function herein (see case study XIII) but rather apply the concept of limits of acceptability. We define these limits to be for all the different observations, and use the following goodnessoffit function to differentiate between behavioral and nonbehavioral solutions
, 
(22.03) 
where is an indicator function that returns one if the condition a is satisfied and zero otherwise. Parameter values whose NashCascade simulation leads to a score of Equation (22.03) equal to , honor the limits of acceptability of each discharge observation, and are called behavioral solutions.
We now explore the behavioral solution space (might not exist!) with DREAM. We assume a bivariate uniform prior distribution, [1,10], for the parameters and g and draw the initial position of the N = 8 different Markov chains using Latin hypercube sampling. Default values of the algorithmic variables are used.
Implementation of plugin functions
The complete source code can be found in DREAM SDK  Examples\D3\Drm_Example22\Plugin\Src_Cpp