# Decision-Time Learning and Planning Integrated Control for the Mild Hyperbaric Chamber
## 3 Model Learning
### Model Output Optimization with Separated Uncertainties
According to [PERSON] theorem, the posterior probability distribution of the weights \(\mathcal{W}\) and perturbations \(\mathbf{z}\) is given by the following:  
\[p(\mathcal{W},\mathbf{z}\mid\mathcal{D})=\frac{p(\mathbf{Y}\mid\mathcal{W}, \mathbf{z},\mathbf{X})p(\mathcal{W})p(\mathbf{z})}{p(\mathbf{Y}\mid\mathbf{X })} \tag{14}\]  
where \(\mathcal{D}\) is the data formed by input value \(x_{t}\) and output value \(y_{t}\). Given a new input vector \(\hat{x}\), we can use the predictive distribution \(p(\hat{y}\mid\hat{x},\mathcal{D})\) to predict \(\hat{y}\):  
\[p(\hat{y}\mid\hat{x},\mathcal{D})=\int\biggl{[}\int\mathcal{N}(\hat{y}\mid f( \hat{x},\hat{z};\mathcal{W}),\Sigma)\mathcal{N}(z\mid 0,1)\mathrm{d}\hat{z} \biggr{]}p(\mathcal{W},\mathbf{z}\mid\mathcal{D})\mathrm{d}\mathcal{W}\; \mathrm{d}\mathbf{z} \tag{15}\]  
We approximate the exact posterior distribution \(p(\mathcal{W},\mathbf{z}\mid\mathcal{D})\) using a factorized Gaussian distribution:  
\[q(\mathcal{W},\mathbf{z})=\left[\prod_{l=1}^{L}\prod_{i=1}^{M_{t}}\prod_{j=1} ^{M_{t-1}+1}\mathcal{N}\Big{(}w_{ij,l}\mid m_{ij,l}^{w},n_{ij,l}^{w}\Big{)} \right]\left[\prod_{t=1}^{T}\mathcal{N}(z_{t}\mid m_{t}^{z},n_{t}^{z})\right] \tag{16}\]  
The parameters \(m_{ij,l}^{w},n_{ij,l}^{w}\) and \(m_{t}^{z},n_{t}^{z}\) are determined by minimizing the divergence between \(p(\mathcal{W},\mathbf{z}\mid\mathcal{D})\) and \(q\). After approximating \(q\), we substitute \(p(\mathcal{W},\mathbf{z}\mid\mathcal{D})\) with \(q\) and use the mean values from \(q\) to approximate the integral in Equation (15). We adjust the parameters by minimizing the \(\alpha\)-divergence between \(p(\mathcal{W},\mathbf{z}\mid\mathcal{D})\) and \(q(\mathcal{W},\mathbf{z})\) in Equations (15) and (16):  
\[D_{\alpha}[p(\mathcal{W},\mathbf{z}\mid\mathcal{D})\|q(\mathcal{W},\mathbf{z} )]=\frac{1}{\alpha(\alpha-1)}\biggl{(}1-\int p(\mathcal{W},\mathbf{z}\mid \mathcal{D})^{\alpha}q(\mathcal{W},\mathbf{z})^{(1-\alpha)}\mathrm{d} \mathcal{W}\;\mathrm{d}\mathbf{z}\biggr{)} \tag{17}\]  
The \(\alpha\)-divergence here is used to adjust the difference between distributions, allowing us to replace the posterior distribution with an approximate distribution \(q\), thereby achieving efficient prediction and parameter optimization. The parameter \(\alpha\) controls the properties of \(q\). When \(\alpha\geq 1,q\) tends to fit the entire posterior distribution \(p\). When \(\alpha\leq 0,q\) tends to fit the local regions of \(p\). Setting \(\alpha=0.5\) balances these two tendencies. We use the ensemble method to estimate epistemic uncertainty. The core idea is to leverage multiple stochastic models to represent the inherent randomness of the environment. The differences between models, which are constructed in the same manner, reflect the uncertainty caused by insufficient knowledge. We consider using the bootstrap ensemble method. Assume we perform bootstrap ensemble learning with \(K\) models, where \(\hat{E}_{k}\) represents the ensemble of estimated parameters, and \(\hat{f}_{k}(t,\hat{E}_{k})\) represents the estimate output of the \(k\)-th model. Basedon the Mean Squared Error (MSE) to evaluate model approximation quality, we assign a computational weight \(w_{k}\) for each model \(k\), satisfying the constraint \(\sum w_{k}=1\):  
\[w_{k}=\frac{\frac{1}{\text{MSE}_{k}}}{\frac{1}{MSE_{1}}+\frac{1}{MSE_{2}}+\cdots +\frac{1}{MSE_{k}}} \tag{18}\]  
where \(MSE_{k}\) represents the Mean Squared Error (MSE) of the \(k\)-th model, calculated as follows:  
\[y_{t}=f(x_{t},z_{t};\mathcal{W})+\epsilon_{t} \tag{11}\]0  
Thus, the ensemble model's average output estimate is given by the following:  
\[y_{t}=f(x_{t},z_{t};\mathcal{W})+\epsilon_{t} \tag{11}\]1  
Assuming that the output probability sequence follows a Gaussian distribution with a mean of \(f_{\text{ens}}\)\((t)\), we can use a parametric bootstrap ensemble method to construct a 95% confidence interval. Specifically, suppose the training sample size is \(T\), with time points \(t_{1},\ldots,t_{T}\).