# Natural Brain-Inspired Intelligence for Non-Gaussian and Nonlinear Environments with Finite Memory
## 4 Design of CDS Architecture for Finite Memory NGLNE
### Bayesian Equation and Maximum Posteriori Selection
#### 4.2.2 Feedback Channel, Assurance Factor, and Internal Rewards  
Typically, the CDS uses the Kalman filter and Shannon theory [3] to calculate the entropic state at time \(n\). The technique based on Kalman filter and Shannon theory is applied to a linear and Gaussian environment. However, in a NGNLE, the complexity of using this algorithm is higher than in the LGE. For our application, the algorithm should be simple, straightforward, and fast. Thus, we would like to avoid using extra logarithms, complicated functions, and integrals required in the entropic state calculation associated with Kalman filter. Therefore, here, the internal reward is inspired by the human decision-making approach with lower computational cost. Most of the time, we make the wrong decision when we assure about something whose occurrence is less than 100% (e.g., gambling). Similarly, the CDS makes a decision using Equation (12), and selects the maximum probability using the maximum a posteriori probability (MAP) rule. Therefore, the CDM error is proportional to the assurance of the decision. Consequently, we define the average assurance factor (AF) as:  
\[AF_{n}^{k}=\frac{\sum\limits_{\alpha=n-L}^{n}P(\overline{\mathbf{X}}_{0}^{k}| \hat{\mathbf{Y}}_{\alpha}^{k,m})}{L},\ \ \ \ \ n-L\geq m \tag{13}\]  
Here, \(L\) is an arbitrary time discrete interval to calculate the assurance factor. Also, we calculate the incremental of the assurance factor in the \(k\)th PAC using:  
\[\Delta_{k}^{n}=AF_{n}^{k}-AF_{n}^{k-1} \tag{14}\]where the \(AF_{n}^{k-1}\) and \(AF_{n}^{k}\) are the assurance factors that can be calculated at the (\(k\)-1) and \(k\)th PAC, respectively. The internal reward, denoted as the \(rw_{n}^{k}\), can be defined as the arbitrary function of \(AF_{n}^{k}\) and \(\Delta_{k}^{n}\) and from the function:  
\[rw_{n}^{k}=h_{k}(AF_{n}^{k},\ \ \Delta_{k}^{n}) \tag{15}\]  
where the \(h_{k}(\cdot)\) is an arbitrary function. The \(h_{k}(\cdot)\) can be defined based on the environment type (e.g., the human body or a fiber optic channel) or the perceptor configurations such as desired computational cost or accuracy. The perceptor sends \(rw_{n}^{k}\) to the executive by the global feedback channel. In addition, the perceptor sends the estimated Bayesian model and evidence through the internal feedback channel (see Figure 7). Also, the perceptor receives the modeling configurations such as \(\mathbf{PF}^{k,m}\) (see Equation (4)) through internal feedforward channel that are internal commands from the executive. Here, \(PF_{m}^{k}\) is the precision factor at the \(k\)th PAC and focus level \(m\). Therefore, the executive uses this information and it can find the proper action for applying on NGNLE. Also, for easy reference, we provide a list of the important notations and their meanings in Table 2.  
Now, we provide Algorithm 1 to compute environment actions through the global feedback. In this Algorithm, we include several heading comments, so that it is easy to follow.