## 2 Methods
### Decision Support in Environmental Monitoring under Uncertainty  
In context of decision-making, we need to define a posterior summary function \(\Gamma\) that summarizes the posterior distribution. Examples of posterior summary functions are the expectation and the maximum a posterior (MAP) of the predictive posterior distribution generated from the BCNN. The posterior predicted expectation can be approximated as the average of the realizations  
\[P(c_{j}|\mathbf{x})=\Gamma(\{P_{t}(c_{j}|\mathbf{x})\}_{1\leq t\leq T})\approx \frac{1}{T}\sum_{t=1}^{T}P_{t}(c_{j}|\mathbf{x}). \tag{5}\]  
Alternatively, we can use the mode or maximum a posterior probability (MAP) of the sample distribution, i.e., the probability that most often occur in the predictive posterior distribution. The posterior predictive distribution do not have a uniform discretization, and each sample may be unique. A function \(\mathcal{H}\) takes \(P_{t}(c_{j}|\mathbf{x})\) as input and maps the realizations \(t\) into \(K\) bins with consecutive, non-overlapping intervals such that \(\mathcal{H}(P_{t}(c_{j}|\mathbf{x}))=P_{k}(c_{j}|\mathbf{x})\), where \(k=1,\ldots,K\). An estimate of the predictive posterior distribution through the mode/MAP is then to find the bin with most counts and its associated probability  
\[P(c_{j}|\mathbf{x})=\Gamma(\{P_{t}(c_{j}|\mathbf{x})\}_{1\leq t\leq T})\approx \mathcal{H}(P_{t}(c_{j}|\mathbf{x}))\approx\operatorname*{arg\,max}_{k\in\{1,\ldots,K\}}P_{k}(c_{j}|\mathbf{x})/K \tag{6}\]  
With Equations (5) and (6) in mind, we present a three-step procedure for probabilistic decision support in environmental monitoring which is presented in pseudo-code in Algorithm 1.  
Step 1 in Algorithm 1 is costly; however, this is not the case of step 2 and 3. The majority of the time will be devoted to optimizing the weights of the BCNN. When step 1 first has been performed, that is training of the BCNN, step 2 and step 3 can be conducted independent of step 1.  
```
0: - Training set \(\mathbf{X},\mathbf{y}\)  - Unlabeled time series \(\mathbf{x}^{*}\)  - Number of realizations in posterior sampling \(T\)  - Number of classes \(C\)  - CCN model \(\mathbf{f}^{\omega}\) with weights \(\omega\)  - Posterior summary function \(\Gamma(\{P_{t}(c_{j}|\mathbf{x})\}_{1\leq t\leq T})\)  - \(\lambda(\alpha_{i}|c_{j})\) cost associated with taking action \(\alpha_{i}\) if the class is \(c_{j}\)
1: Optimize CNN model weights with MC dropout algorithm \(p(\omega|\mathbf{X},\mathbf{y})\leftarrow\) Optimize BCNN model
2: Generate posterior predictive distribution from optimized BCNN \(\widehat{\omega}_{t}\sim p(\omega|\mathbf{X},\mathbf{y})\leftarrow\) Simulate \(T\) samples from the posterior distribution of the weights \(p(\mathbf{y}^{*}|\mathbf{x}^{*},\mathbf{X},\mathbf{Y})\approx\widehat{\mathbf{ f}}^{\widehat{\omega}_{t}}(\mathbf{x}^{*})\in\mathbb{R}^{C\times T}\leftarrow\) Estimate posterior predictive distribution for all classes \(P_{t}(c_{j}|\mathbf{x}^{*})=\left(\widehat{\mathbf{f}}^{\widehat{\omega}_{t}}( \mathbf{x}^{*})\right)_{j}\in\mathbb{R}^{T}\leftarrow\) Extract the posterior distribution for class \(c_{j}\) with \(T\) samples \(P(c_{j}|\mathbf{x}^{*})=\Gamma(\{P_{t}(c_{j}|\mathbf{x})\}_{1\leq t\leq T}) \leftarrow\) Approximate \(P(c_{j}|\mathbf{x}^{*})\) with e.g., (5) or (6)
3: Make optimal decision based on posterior predictive distribution \(\alpha^{*}=\operatorname*{arg\,min}\limits_{a_{i}}\sum\limits_{j=1}^{C}\lambda (\alpha_{i}|c_{j})P(c_{j}|\mathbf{x}^{*})\leftarrow\) Minimize the conditional risk. return\(\alpha^{*}\leftarrow\) Optimal decision \(\alpha_{i}\) based on \(P(c_{j}|\mathbf{x}^{*})\) and cost function \(\lambda(\alpha_{i}|c_{j})\)
```  
**Algorithm 1** Algorithm for decision support in environmental monitoring under uncertainty