# Natural Brain-Inspired Intelligence for Non-Gaussian and Nonlinear Environments with Finite Memory
## 4 Design of CDS Architecture for Finite Memory NGLNE
### Executive
#### 4.3.2 Learning Using Prediction  
(a) Executive actions  
The actions space in the executive can be classified as the environmental actions and internal CDS commands. Therefore, we define the actions space as follows:  
\[C=\left\{c_{k}\right\rvert\ c_{k}=\begin{array}{c}\mathit{Environmental actions,\ or}\\ \mathit{Internal commands}=\begin{cases}\mathrm{Increase\ }m,&m<M\\ \mathrm{Decrease\ }m,&m\geq 1\end{cases}\end{array}\right\}, \tag{16}\]  
where \(c_{k}\) is the action in the current \(\mathit{PAC}\) number \(k\) and \(\boldsymbol{C}\) is set of all possible actions in the actions space.  
The posteriori due to the virtual environmental action of \(c_{k+1}^{t}\) (see Table 1) can be predicted virtually using:  
\[ratio^{k+1,t}=\underset{s=1,2,\ldots,S}{\max}\Bigg{\{}\frac{std(\hat{Y}_{n}^{k,m} |\hat{\mathbf{X}}_{n}^{k}=X_{s})}{std(\hat{Y}_{n}^{k-1,m}|\hat{\mathbf{X}}_{n}^{ k-1}=X_{s})}\Bigg{\}}, \tag{17}\]  
\[\hat{\mathbf{Y}}_{n}^{(k+1),t,m}=\hat{\left(\hat{\mathbf{Y}}_{n}^{k,m},\ \ ratio^{k+1,t},c_{k},c_{k-1},t,m\right)}, \tag{18}\]  
\[P(\hat{\mathbf{X}}_{n}^{(k+1),t}|\hat{\mathbf{Y}}_{n}^{(k+1),t,m})=\frac{p( \hat{\mathbf{Y}}_{n}^{(k+1),t,m}\hat{\mathbf{X}}_{n}^{(k+1),t})p(\hat{\mathbf{ X}}_{n}^{(k+1),t})}{p(\hat{\mathbf{Y}}_{n}^{(k+1),t})}, \tag{19}\]  
or  
\[q_{k}\;(\hat{\mathbf{X}}_{n}^{(k+1),t}|\hat{\mathbf{Y}}_{n}^{(k+1),t,m})=P( \hat{\mathbf{X}}_{n}^{(k+1),t}|\hat{\mathbf{Y}}_{n}^{(k+1),t,m}).\]  
Here, \(t\in\{1,2,\ldots,T\}\) and \(T\) is a total number of desired virtual actions that the \(k\)th model is still valid for predicting the \(T^{\text{th}}\) virtual action. Also, in Equation (19), \(q_{k}(\cdot)\) and \(b_{k}(\cdot)\) (see Equations (10) and (11)) are received through the internal feedback from the perceptor. Therefore, the predicted assurance factor can be calculated as:  
\[AF_{n}^{(k+1),t}=\frac{\sum\limits_{o=n-L}^{n}P(\hat{\mathbf{X}}_{o}^{(k+1),t} |\hat{\mathbf{Y}}_{o}^{(k+1),t,m})}{L},\qquad n-L\geq m, \tag{20}\]  
and  
\[\Delta_{k+1,t}^{n}=AF_{n}^{k+1,t}-AF_{n}^{k+1,t-1}. \tag{21}\]  
Then, the predicted internal rewards for the desired virtual action \(c_{k+1}^{t}\) can be calculated using Equation (15) as follows:  
\[rw_{n}{}^{(k+1),t}=\begin{cases}h_{(k+1)}(AF_{n}^{(k+1),t},\ \ \Delta_{k+1,t}^{n}),&t\in\{1,2,\ldots,T\}\\ rw_{n}{}^{k}&t=0\end{cases}. \tag{22}\]  
Therefore, we can find the action \(c_{k+1}^{T}\) that brings the minimum internal reward as:  
\[T^{\prime}=\underset{t\in[0,1,2,\ldots,T]}{\operatorname{argmin}}(rw_{n}{}^{( k+1),t}). \tag{23}\]  
As a result, the actions to be applied on the environment can be selected as:  
\[c_{k+1}=\ c_{k+1}^{T^{\prime}},\qquad for\ \ T^{\prime}\geq 1. \tag{24}\]  
Therefore, \(c_{k+1}\) is the best action to be applied on the environment to improve the decision-making performance. Algorithm 1 shows the outline of the main processes for the global PAC of our CDS. In some applications, the policy may update the \(\textit{Threshold}^{m}\) for more accuracy (or even higher complexity with acceptable accuracy).  
(b) Internal Commands  
As mentioned before, some actions apply on the environment and the CDS receives the internal reward through the global PAC using the main feedback channel. However, the actions can be the internal commands such as the increase or decrease the focus level, which is a trade-off between the computational cost and CDM accuracy (see Equations (4), (8), and (16)).