# Parameter Estimation of a Class of Neural Systems with Limit Cycles
## 4 Parameter Estimation of the Spiking Neurons
### Stochastic Gradient Estimation Algorithms  
Let \(\|X\|^{2}:=\operatorname{tr}[XX^{\top}]\) denote the norm of the matrix \(X\). For the model (5), we present the following stochastic gradient (SG) parameter estimation formulas to estimate the parameter vector \(\theta(k)\)  
\[\left\{\begin{array}{rcl}\hat{\theta}(k)&=&\hat{\theta}(k-1)+\frac{1}{r(k)} \phi(k)\varepsilon(t),\\ \varepsilon(t)&=&\begin{bmatrix}y_{1}(k)-\phi_{1}^{\top}(k)\hat{\theta}(k-1) \\ y_{2}(k)-\phi_{2}^{\top}(k)\hat{\theta}(k-1)\end{bmatrix},\\ r(k)&=&\alpha r(k-1)+\|\phi(k)\|^{2},r(0)=1,\end{array}\right. \tag{10}\]  
where \(\alpha\) is the forgotten factor. Note that a smaller \(\alpha\) results in a faster convergence but the price we paid is a large parameter fluctuation. In this paper, since the SG algorithm converges slowly in parameter estimation of the FHN neuron, we choose a moderate \(\alpha=0.8\).  
The SG parameter estimation algorithm for the spiking neuron model is summarized in Algorithm 3.  
1. Discretize the FHN model based on the explicit forward Euler method with step size \(T\).
2. Initialization: set a small forgotten factor \(\alpha\in(0,1]\) and let \(k=1\), \(\hat{\theta}(0)=\mathbf{1}_{h}/p_{0}\), \(r(0)=1\), \(p_{0}=10^{6}\).
3. Collect the measurement state data and determine a data length \(L_{d}\). Then, form the output data \(y(k)\) and the information vector \(\phi(k)\).
4. Compute \(r(k)\) by \(r(k)=\alpha r(k-1)+\|\phi(k)\|^{2}\).
5. Update the estimate \(\hat{\theta}(k)\) by \(\hat{\theta}(k)=\hat{\theta}(k-1)+\phi(k)\varepsilon(t)/r(k)\), where \[\varepsilon(t)=\begin{bmatrix}y_{1}(k)-\phi_{1}^{\top}(k)\hat{\theta}(k-1) \\ y_{2}(k)-\phi_{2}^{\top}(k)\hat{\theta}(k-1)\end{bmatrix}.\]
6. If \(k=L_{d}/2\), reset a large forgotten factor \(\alpha\in(0,1]\) and go to step (7); otherwise, go to step (7).
7. If \(k<L_{d}\), increase \(k\) by \(1\) and go to step (3); otherwise, stop the procedure and output the estimate \(\hat{\theta}(L_{d})\) of the parameter vector \(\theta\).  
Similarly, to obtain better estimation accuracy, we can derive multiinnovation stochastic gradient (MISG) parameter estimation formulas [28] using the \(Y(p,k)\) and \(\Phi(p,k)\) in Section 4.1 as follows  
\[\left\{\begin{array}{rcl}\hat{\theta}(k)&=&\hat{\theta}(k-1)+\Phi(p,k)\mathcal{ E}(t)/r(k),\\ \mathcal{E}(k)&=&Y(p,k)-\Phi^{\top}(p,k)\hat{\theta}(k-1),\\ r(k)&=&\alpha r(k-1)+\|\Phi(p,k)\|^{2},r(0)=1.\end{array}\right. \tag{11}\]  
Comparing with the SG algorithm in (10) using only the current data, the innovation \(\Phi\) in (11) uses not only the current innovation, but also the past innovations, which thus can improve the convergence rates compared with the SG algorithm. Moreover, the available data are repeatedly used in the MISG algorithm, and such a treatment can enhance accuracy of the parameter estimation [24]. The MISG parameter estimation algorithm for the FHN model is summarized in Algorithm 4.  
```
1:Discretize the FHN model based on the explicit forward Euler method with step size \(T\).
2:Initialization: set a small forgotten factor \(\alpha\in(0,1]\) and let \(k=1\), \(\hat{\theta}(0)=\mathbf{1}_{h}/p_{0}\), \(r(0)=1\), \(p_{0}=10^{6}\).
3:Collect the measurement state data and determine a data length \(L_{d}\). Then, form the output data \(y(k)\) and the information vector \(\phi(k)\).
4:Given an innovation length \(p\), form \(Y(p,k)\) by (7) and \(\Phi(p,k)\) by (8).
5:Compute \(r(k)\) by \(r(k)=\alpha r(k-1)+\|\Phi(p,k)\|^{2}\).
6:Update the estimate \(\hat{\theta}(k)\) by \(\hat{\theta}(k)=\hat{\theta}(k-1)+\Phi(p,k)\mathcal{E}(t)/r(k)\), \[\mathcal{E}(k)=Y(p,k)-\Phi^{\top}(p,k)\hat{\theta}(k-1).\]
7:If \(k=L_{d}/2\), reset a large forgotten factor \(\alpha\in(0,1]\) and go to step (8); otherwise, go to step (8).
8:If \(k<L_{d}\), increase \(k\) by \(1\) and go to step (3); otherwise, stop the procedure and output the estimate \(\hat{\theta}(L_{d})\) of the parameter vector \(\theta\).
```  
**Algorithm 4** MISG algorithm