Since for both surveillance and operational monitoring, frequency of measurements of physiochemical quality elements is once a month, it is very difficult to estimate statistically sound and reliable probability distributions for TN and TP.

How to assess true status classes for both indicators could be also problematic. In order to overcome both difficulties, concentration time series for the SWAT-simulated models were applied.

### SWAT model and simulated data

Soil and Water Assessment Tool (SWAT) is a continuous-time, process-based, semi-distributed hydrological model simulating the water flow, sediment, and nutrients on a catchment scale. The basic calculation unit—hydrologic response unit (HRU) is created by an overlay of land use, soil, and slope maps. Water balance and water quality components are calculated separately for each HRU, then aggregated at the sub-basin level and routed through the stream network to the main river outlet [34].

In this study, the existing SWAT model of the Barycz catchment was used [35]. While the full description of model setup, calibration and validation was presented in the latter study, here a brief overview is provided, important in the context of water quality aspects tackled in this study. Delineation of the catchment based on the 10-m resolution digital elevation model resulted in division of the catchment into 503 sub-basins. The land cover map was a combination of CORINE Land Cover (CLC) 2006 and post-processed Landsat 8 high-resolution images. The interpolated daily precipitation and air temperature (minimum and maximum) data (1951–2018) were acquired from a 5-km resolution gridded dataset [36]. Sensitivity analysis, calibration and validation were performed with the help of SWAT-Calibration Uncertainty Procedures (SWAT-CUP; [37]), using the Sequential Uncertainty Fitting Procedure Version 2 (SUFI-2 algorithm; [38]). A multi-site calibration was performed for discharge, total suspended sediment, nitrates, total nitrogen, phosphates and total phosphorus loads. The model was calibrated and validated. For SWAT calibration, monitoring data from the State Monitoring Program were used together with flow data collected by the State Meteorological Hydrological Institute.

The Kling–Gupta efficiency (KGE) was used as a goodness-of-fit measure [39] to calibrate and validate the SWAT model. KGE is a function of the correlation term (linear regression coefficient between the measured and simulated variable), the variability term (the ratio between simulated and measured standard deviation), and the bias term (the ratio between simulated and measured mean). Among the water quantity and quality calibration points, there was one flow gauge and one water quality monitoring point directly located near the outlet of the Orla river. The discharge KGE values for the Orla were 0.77 and 0.83 for calibration and validation, respectively. For water quality parameters, KGE values were also reported to be good: for total nitrogen (0.89—calibration and 0.87—validation) and total phosphorus (0.65—calibration and 0.81—validation) [35].

Historical data on the loads of polluting substances emitted by treatment plants into the river network in the Orla subcatchment in years 2004 -2018 were collected from operators, especially from the two WWTPs in Krotoszyn and Rawicz which were used as important point sources in the SWAT model. As the data concerning the quality of effluents from the WWTPs were in the form of monthly volumes and monthly mean concentrations, they were converted into daily values by imposing certain stochastic fluctuations of magnitude up to 30% for both flow and concentrations.

Time series of concentration of TP and TN in the Orla river at the cross section just before the inflow into the Barycz river are presented in Figs. 2 and 3, respectively. As the period after modernization of the Rawicz WWTP was relatively short, water management decisions were analysed only for two periods: before the modernization of the Krotoszyn WWTP in 2012 and the period after modernization until the beginning of 2017 when upgrading of the Rawicz WWTP started.

### Bayesian approach

Bayesian decision theory is an important statistical method for quantification of the compromise between various decisions using probabilities and cost that accompany these decisions [40]. It allows for explicit consideration of the cost of uncertainty and worth of data in the process of taking decisions. The Bayesian model of decision-making is based on the probability of a result when some prior information, here the probability of a stochastic state **S**_{i} of the water body, i.e. historical ecological status of a wb, as well as new evidence/observations—monitoring data, are taken into consideration.

Game theory [24] defines a ‘game with Nature’ as a game in which one of the partners—Nature—does not set specific goals for himself and his strategy does not take into account possible future actions of the opponent. It means that the stochastic states of the water environment (**S**_{i}), i.e. Nature are characterized by a specific and unchanging probability distribution of occurrence until, as a result of human activity, sufficiently strong changes occur in the river or its catchment area. Bayesian decision theory allows for quantification of the compromise between various management decisions using probabilities and costs that accompany these decisions. Applying this theory, the problem of choosing the optimal decision from available remediation alternatives or paying fines as consequences of violating environmental objectives of water status can be solved. The result of this method in relation to corrective actions generates the so-called decision table assigned to a wb’s catchment in which, for any possible value of selected indicator, the best alternative of corrective action is indicated.

The chosen water quality elements, i.e. TP and TN, representing the state of the aquatic environment (Nature) are characterized by a specific and invariable distribution of the probability of occurrence. In the adopted methodology, using the simulation model of the river dynamics, probability distributions of the state **S**_{i} (represented by TP and TN) can be estimated based on the frequency of occurrence of status classes in the series of values simulated in time before and after the implementation of remedial actions.

The nine-step algorithm presented in Fig. 4 served as a framework for elaborating decision tables according to Bayesian decision theory for both water quality elements, i.e. TP and TN.

**Step 1:** (description of steps of Bayesian algorithm presented in Fig. 4). There are three possible stochastic states **S**_{i}, i.e. ecological status of wb (*w*_{i}** =1,…3**): high, good and below good.

**Step 2: **The annual mean values form the results of the simulated daily concentrations of TP and TN are assumed the ‘true’ states for the wbs, related separately for both status indicators. The a priori probability distribution of true states occurrence **g**(*w*) are/were estimated on the basis of SWAT’s simulations of physicochemical elements in the river with a time step of 1 day for the 15-year period 2004–2018.

**Step 3: **Defining a set of alternative remediation actions **d**_{i}, as modernization of WWTP or fallowing part of the area. A short discussion concerning remediation measures is presented in the section ‘Water management decisions—programmes of measures’.

**Step 4: **Evaluations of costs **c** related to various remediation action and evaluation of potential penalties charged in case of bgs leads to formulation of ‘pure costs/ losses function’.

**c = L**(**d**_{i},**w**)—deterministic cost/loss function defining the costs **c** borne by the decision-maker when making a decision **d**_{i} when the **S**_{i} is equal to **w**_{i}.

**Step 5: **The whole range of concentrations, of water quality elements TP and TN observed as results of the SWAT model (virtual monitoring data), was split into separate intervals (bins). The middle value of concentration for each interval was assigned as the representative value for this interval. In accordance with the Classification Regulation [41], the intervals of the concentration values were assigned to one of the status classes: high, good and below good.

**Step 6: **Determination of the conditional probability distribution **P**(\({\overline{x} }_{k}\)**|***w*_{i}) that is estimation of the probability that in a particular **S**_{i} the mean value \({\overline{{\varvec{x}}} }_{{\varvec{k}}}\) of the indicator belongs to a certain range of concentration. The adopted method of determining conditional probability of the TP or TN concentration consisted of sets of 12 random selections out of 365 values of the concentration, simulated for each year. This procedure was chosen to be analogous to the monthly monitoring measurements carried out. From the drawn values of simulated concentrations, the annual average value (\({\overline{{\varvec{x}}} }_{{\varvec{k}}}\boldsymbol{ },\) *k* = 1.2, …) was calculated and then used to determine the corresponding status class. Conditional probability distributions were based on 1000 sets of random selections. Every time the mean value of the twelve concentrations was assigned to one of three status classes, i.e. high, good or below good, split into narrow intervals within Step 5. The calculations were performed for the years selected to represent the appropriate **S**_{i}.

**Step 7: **The two-dimensional probability distribution of random variables, i.e. status **S**_{i} and concentration of TN or TP, is calculated from the formula:

$${\mathbf{P}}(\overline{x}_{k} ,{\varvec{w}}_{{\varvec{i}}} ) \, = \, {\mathbf{P}}(\overline{x}_{k} |{\varvec{w}}_{{\varvec{i}}} )*{\text{g(}}{\varvec{w}}_{{\varvec{i}}} ),\quad \left( {k = {1}, \ldots ;\;i = { 1},{2},{3}} \right).$$

(2)

The marginal distribution of the mean *f*(\({\overline{x} }_{k}\)) is then determined by summing up the values of the probability distribution P(\({\overline{x} }_{k}\)*,w*_{i}) over all **S**_{i}.

**Step 8: **Determination of the conditional a posteriori distribution **g(***w*_{i}| *x*_{k}**)** using the Bayesian formula:

$${\varvec{g}}\left({{\varvec{w}}}_{{\varvec{i}}}|{\overline{x} }_{k}\right)=\frac{{\varvec{P}}\left({\overline{x} }_{k}|{{\varvec{w}}}_{i}\right){\varvec{g}}({{\varvec{w}}}_{i})\boldsymbol{ }}{{\varvec{f}}({\overline{x} }_{k})}=\boldsymbol{ }\frac{{\varvec{P}}({\overline{{\varvec{x}}} }_{{\varvec{k}}}\boldsymbol{ },{{\varvec{w}}}_{{\varvec{i}}})\boldsymbol{ }}{{\varvec{f}}({\overline{x} }_{k})}.$$

(3)

**Step 9:** Creating a decision table:

$$\overline{k }\left({{\varvec{d}}}_{{\varvec{j}}};{\overline{x} }_{k}\right) \, = \, L({{\varvec{d}}}_{{\varvec{j}}}, {{\varvec{w}}}_{1})\bullet g\left({{\varvec{w}}}_{1}\right|{\overline{x} }_{k})+L({{\varvec{d}}}_{{\varvec{j}}}, {{\varvec{w}}}_{2})\bullet g\left({{\varvec{w}}}_{2}\right|{\overline{x} }_{k})\ + L({{\varvec{d}}}_{{\varvec{j}}}, {{\varvec{w}}}_{3})\bullet g\left({{\varvec{w}}}_{3}\right|{\overline{x} }_{k}).$$

(4)

The Bayesian decision table contains the results of estimating the average costs/losses that are incurred when the value of the annual mean of the indicator (based on measurements) is (\({\overline{{\varvec{x}}} }_{{\varvec{k}}}\boldsymbol{ },\) *k* = 1.2, …) and the decision-maker makes one of two or more decisions *d*_{j}, (*j* = 1, 2,…). For the mean value, average costs are calculated from the matrix of pure costs L (*d*_{j}, *w*) separately for each of the possible decisions d_{j}, according to formula (3). Thus, for a fixed \({\overline{{\varvec{x}}} }_{{\varvec{k}}}\) the optimal decision is the one for which the average costs are the lowest. For each of the possible average values of the indicator values measured during the year \({\overline{{\varvec{x}}} }_{{\varvec{k}}}\boldsymbol{ },\) (*k* = 1, 2,…), the decision table contains the values of average losses corresponding to decisions *d*_{j} (*j* = 1,2…).

Each ‘virtual’ measurement of a physicochemical element performed at a certain moment in time can be determined with certainty that it is performed under the conditions of occurrence of a certain **S**_{i}. This last observation has important consequences in risk analysis and decision-making under conditions of uncertainty of measurements and **S**_{i}.

It should be stressed that, in order to estimate a priori probabilities of states **S**_{i,} the monitoring historical time series could have been used instead of simulated concentrations by SWAT. However, this would increase the uncertainty of the final decision tables since, based on monitoring data of TN, the calculated probabilities of misclassification of the status class were high—up to 0.8 in 2004 and 0.5 in 2002, 2005, 2006, 2007 and 2013 [30].

### Analysis of water management decisions based on concentration of total phosphorus (TP)

On the basis of SWAT simulations of TP concentration presented in Fig. 2, for the period before 2012, a priori probabilities of each natural state were estimated as: high 0.25, good 0.375 and also 0.375 for below good status.

For the years 2004–2012, two variants of alternative decisions were analysed for the Orla River concerning decrease of pollution by phosphorus. Variant A) consists of altogether four alternative decisions presented in Table 3. Regarding the application of remediation measures in the form of modernizing only one WWTP (either Krotoszyn—decision d2 or Rawicz—d3) there was NO penalty included in the ‘function of clean costs/losses’ when bgs was assessed. Such an approach was justified on the basis that, although it may be insufficient, still some remediation action was undertaken. In case of the ‘no action’ scenario (code d1) the penalty value (BIG penalty) was based on the highest values of coefficients (WW = 2, WT = 5).

Variant B) consists of the same set of alternatives as variant A but is more restrictive: when only one WWTP is modernized (either Krotoszyn or Rawicz) there will be a penalty in bgs assessed but with the lowest values of both coefficients WW = 1, WT = 1). When both WWTPs are extended but the good status is not reached, no penalty will be imposed.

For the period after the modernization of Krotoszyn WWTP, a priori probabilities of each natural state were estimated as: high 0.2, good 0.2 and also 0.6 for below good status.

Two variants of alternatives sets of decisions were tested for the period after 2012. In both of them, the function of pure cost/losses for ‘no action’ included a penalty for bgs. In variant C1, failure to reach good status after implementing the modernization of Rawicz WWTP did not incur a penalty, as it would be difficult to introduce any other remediation measure. However, in variant C2 (modification of C1) in the same situation, the decision to modernize the WWTP did incur a penalty in the case of bgs .

The last variant attempted (Variant D), included additionally to variant C2 an alternative decision (d2) consisting of modernization of several small WWTPs located in this catchment (in small communities). The total cost of this would be similar to modernizing Krotoszyn WWTP. The last alternative decision (d4) consists of investments in those small WWTPs together with modernization of Rawicz WWTP. In a bgs situation, a penalty 10 times higher the ‘standard’ was included in the d1 costs function and smaller penalty d2 and d3 cost functions.

### Analysis of water management decisions based on concentrations of total nitrogen (TN)

Similarly to the analysis presented in the previous section, analyses related to nitrogen were conducted separately for the period before modernization of Krotoszyn WWTP, i.e. before 2012 and after that year. The water quality in the river in the monitored cross section did not improve after 2012 [42]. There was also no significant decrease in modelled nitrogen concentration in this period (Fig. 3). In the calculations of conditional probability (6th step in Fig. 4), updated modelled concentrations of TN were included but there was no need to change values of a priori probabilities of **S**_{i} and for both periods a priori probabilities of high and good status were estimated as very low and equal to 0.05. When analysing histograms representing conditional probability distributions (6th step), it was observed that they were considerably different for both periods, so specific and different distributions for both periods were applied**.**

Concerning the alternative decisions focused on decrease of TN concentration, basic two variants were tested. Within each variant, various surfaces being fallowed were considered. Alternative decisions d2 and d4 (Table 4) assumed that, when modernization of Krotoszyn or Rawicz WWTP was envisaged, there would not be any penalties in below good status. For the decision d3 (Table 4), when protective measures were reduced only to purely accidental decisions of farmers to fallow fraction of their arable lands, the function of clean costs/losses included the penalty for the bgs case. This can be understood as an attempt to enforce a more permanent solution to the problem.