## 3 DSPOT-Enhanced Self-Evolving Neural Networks
### DSPOT-Based Ramp Classifier
#### 3.1.1 Calculating \(z_{q}(t)\)  
We derive the log-likelihood of the GPD using the recent observations \(\{\Delta P^{l}_{\textit{class}}(t)\}_{d}\) in a moving window with size \(d\):  
\[\begin{split} L(\gamma,\xi;\{\Delta P^{l}_{\textit{class}}(t)\}_{d })=-d\log\xi\\ +(\frac{1}{\gamma}-1)\sum\limits_{i=t-d+1}^{l}\log(1-\frac{\gamma \Delta P^{l}_{\textit{class}}(i)}{\xi}),\end{split} \tag{2}\]  
where \(\gamma\) and \(\xi\) are the parameters of the GPD (\(\gamma\
eq 0\)). To estimate the parameters of the GPD, we find a solution \((\gamma^{*},\xi^{*})\) of \(L\) by solving the following two equations:  
\[\frac{\partial L(\gamma,\xi;\{\Delta P^{l}_{\textit{class}}(t)\}_{d})}{ \partial\gamma} =0, \tag{3}\] \[\frac{\partial L(\gamma,\xi;\{\Delta P^{l}_{\textit{class}}(t)\}_{d })}{\partial\xi} =0. \tag{4}\]  
[PERSON] [43] has shown that if a solution \((\gamma^{*},\xi^{*})\) is obtained in this equation, the argument \(\beta^{*}=\gamma^{*}/\xi^{*}\) is the solution to the scalar equation \(u(\beta)v(\beta)=1\), where  
\[u(\beta) =\frac{1}{|\mathcal{Y}_{q}|}\sum\limits_{i=1}^{|\mathcal{Y}_{q}|} \frac{1}{1+\beta Y_{i}}, \tag{5}\] \[v(\beta) =1+\frac{1}{|\mathcal{Y}_{q}|}\sum\limits_{i=1}^{|\mathcal{Y}_{ q}|}\log(1+\beta Y_{i}). \tag{6}\]  
Here, a set \(\mathcal{Y}_{q}=\{Y_{i}\}\) is defined for a given quantile \(q\), i.e., \(\text{Prob}(\Delta P^{l}_{\textit{class}}(i)>P^{\textit{th}}_{q})=q\), where \(P^{\textit{th}}_{q}>0\) is the threshold associated with the quantile \(q\). \(\mathcal{Y}_{q}\) contains all \(\Delta P^{l}_{\textit{class}}(i)\) larger than \(P^{\textit{th}}_{q}\) with \(Y_{i}=\Delta P^{l}_{\textit{class}}(i)-P^{\textit{th}}_{q}>0\). \(|\mathcal{Y}_{q}|\) denotes the cardinality of \(\mathcal{Y}_{q}\). Based on Grimshaw trick [43], \(\xi^{*}\) and \(\gamma^{*}\) can be obtained using \(\beta^{*}\) by  
\[\gamma^{*} =v(\beta^{*})-1, \tag{7}\] \[\xi^{*} =\gamma^{*}/\beta^{*}. \tag{8}\]  
As there are multiple possible solutions of \(\beta^{*}\), we need to find all the solutions in order to best estimate the GPD parameters \((\gamma,\xi)\) to fit the distribution of ramp events. It is noted that \(1+\beta Y_{i}\) must be strictly positive. As \(Y_{i}\) is positive, we have \(\beta^{*}\in(-\frac{1}{\gamma_{\text{max}}},+\infty)\). [PERSON] also shows an upper-bound \(\beta^{*}_{\text{max}}\) :  
\[\beta^{*}_{\text{max}}=2\frac{\bar{Y}-Y_{\text{min}}}{(Y_{\text{min}})^{2}}, \tag{9}\]  
where \(\bar{Y}\), \(Y_{\text{max}}\), and \(Y_{\text{min}}\) are the average amount, the maximum amount, and the minimum amount of \(\mathcal{Y}_{q}\), respectively. Therefore, we can perform a numerical root search and find all possible solutions in \((-\frac{1}{\gamma_{\text{max}}},\beta^{*}_  
As \(\text{Prob}(\Delta P^{l}_{class}(i)>P^{th}_{q})=q\), we can solve  
\[\text{Prob}(\Delta P^{l}_{class}(i)>z_{q}(t))=q(1+\gamma(\tfrac{z_{q}(t)-P^{th}_{ q}}{\xi}))^{-\frac{1}{\gamma}} \tag{11}\]  
based on Bayesian theorem. Using (11), we can obtain \(z_{q}(t)\) by  
\[z_{q}(t)=P^{th}_{q}+\frac{\xi}{\hat{\gamma}}\Bigg{(}\bigg{(}\frac{q\cdot d}{| \mathcal{Y}_{q}|}\bigg{)}^{-\hat{\gamma}}-1\Bigg{)}. \tag{12}\]