# Quantifying Uncertainties in OC-SMART Ocean Color Retrievals: A Bayesian Inversion Algorithm
## 3 Methodology for Quantifying Uncertainties
### Bayesian Inversion
#### 3.1.1 Convergence Check  
As alluded to above, sensor L1B Rayleigh-corrected radiances and sun-satellite geometry data comprise the measurement vector \(\mathbf{y}\) used as input to OC-SMART, which after processing, will return L2 data as retrievals as explained elsewhere [13]. Using MODIS as an example case, we used reflectance measurements in 8 channels (412, 443, 488, 531, 547, 667, 748, and 869 nm), and 3 geometry angles (solar zenith angle, sensor viewing angle, and relative azimuth angle) as the input layer elements (a total of 11 input elements). A specific MLNN was constructed  
Figure 2: The difference between simulated Rayleigh-corrected TOA radiances and measured Rayleigh-corrected TOA radiances from MODIS represented as a percentage for (**Top Left**) 412 nm, (**Top Right**) 531 nm, and (**Bottom Left**) 667 nm. (**Bottom Right**) A convergence map of OC-SMART output \(R_{\text{\tiny FS}}\). In this image, over 95% of the retrieved \(R_{\text{\tiny FS}}\) are converged (shown in blue color). Zones of non-convergence, shown in red, are primarily located in coastal bays and near areas of heavy cloud cover.  
and trained to retrieve \(R_{\text{rs}}\) estimates at these eight wavelengths. The transfer (activation) function of the neurons was taken to be the hyperbolic tangent function:  
\[f(x)=\frac{2}{1+\exp[-2x]}-1=\frac{e^{x}-e^{-x}}{e^{x}+e^{-x}}=\tanh(x). \tag{9}\]  
In the output layer, a linear transfer function is used to link the hidden layers to the output. The exact expression of this MLNN can be written as  
\[y_{m}=b_{4,m}+\sum_{l=1}^{N_{3}}w_{4,ml}\cdot f\bigg{\{}b_{3,l}+\sum_{k=1}^{ N_{2}}w_{3,lk}\cdot f\bigg{[}b_{2,k}+\sum_{j=1}^{N_{1}}w_{2,kj}\cdot f \Big{(}b_{1,j}+\sum_{i=1}^{N_{0}}w_{1,ji}\cdot x_{i}\Big{)}\bigg{]}\bigg{\}} \tag{10}\]  
where \(x_{i},i=1,\dots,N_{0}\) is an element in the input layer.  
It is important to note that if the goal is to make a retrieval of state parameters directly from TOA reflectance measurements, then the input parameters \(x_{i}\) in Equation (10) are the measured TOA reflectances at the chosen sensors channels plus the three solar/viewing geometry angles, while the output parameters \(y_{m}\) are the desired retrieval (state) parameters, which, in our above example case, are the \(R_{\text{rs}}\) estimates in the eight MODIS channels. We shall refer to this MLNN as R2P (Radiance \(\rightarrow\) Parameter) for short.  
On the other hand, if the goal is to use the MLNN [Equation (10)] as a fast interpolator to obtain the TOA radiances and associated Jacobians, then the input parameters \(x_{i}\) should be the state parameters and the solar/viewing geometry, and the output parameters \(y_{m}\) should be the TOA radiances [42]. We shall refer to this MLNN as P2R (Parameter \(\rightarrow\) Radiance) for short.  
In Equation (10), \(w_{1,ji}\), \(w_{2,kj}\), \(w_{3,lk}\), and \(w_{4,ml}\) are the weights of the three hidden layers and the output layer, and \(b_{1,j}\), \(b_{2,k}\), \(b_{3,l}\), and \(b_{4,m}\) are the biases of the three hidden layers and the output layer. The weights and biases are to be determined by the training. \(f\) is the hyperbolic tangent function in Equation (9). \(y_{m}\) is the \(m\)th element in the output layer, which, in the P2R case, consists of the atmospheric and water IOP retrieval parameters retrieved by OC-SMART. As explained at the end of Section 3.1, the P2R MLNN was used to compute TOA radiances from the retrieval parameters, and a comparison of these computed TOA radiances with the measured ones was used to check the convergence of the retrieval parameters produced by OC-SMART.