## 5 Application: Iran Stock Market
It is crucial to distinguish that while the previous step established efficient shares considering all input and output constraints, we now simplify the problem by applying only the \(\sum_{i=1}^{n}\varepsilon_{i}=1,\varepsilon_{i}\geq 0\) constraint, thereby solving a dedicated portfolio optimization problem using these advanced methods. Neural networks, particularly multilayer perceptrons, exhibit substantial efficacy in discerning non-linear patterns and intricate interrelationships within financial datasets. They can effectively exploit the stock efficiency metrics derived from DEA to discern underlying regularities. We address the semivariance model for three efficient stocks using a neural network. We designed a feedforward neural network with three hidden layers. The input layer handles 1000 prospective weight vectors, while the output layer estimates portfolio semivariance. The mapping function from 1000 probable weight vectors to a portfolio's semivariance is inherently complex and non-linear. Consequently, the accurate learning of \begin{table}
\begin{tabular}{c c c c} \hline  & & **Inputs** & **Output** \\ \cline{2-4}
**Asset ID** & **Stock Companies** & \(\beta\) & **Semivariance** & **Expected Return** \\ \hline
1 & CHAR1 & 0.0329 & 0.0009 & 0.0019 \\
2 & FNAR1 & 0.0113 & 0.0013 & 0.0028 \\
3 & GOST1 & \(-\)0.0099 & 0.0019 & 0.0015 \\
4 & IKCO1 & 0.0269 & 0.0018 & 0.0019 \\
5 & KFAN1 & 0.0316 & 0.0020 & 0.0018 \\
6 & KHSH1 & 0.0323 & 0.0012 & 0.0020 \\
7 & KRIR1 & 0.1162 & 0.0017 & 0.0017 \\
8 & LENT1 & 0.0191 & 0.0012 & 0.0035 \\
9 & MESI1 & 0.0438 & 0.0018 & 0.0024 \\
10 & MHKM1 & 0.0583 & 0.0017 & 0.0013 \\
11 & MNSR1 & 0.0301 & 0.0018 & 0.0031 \\
12 & MSTI1 & 0.0383 & 0.0019 & 0.0003 \\
13 & NMOH1 & 0.2483 & 0.0026 & 0.0016 \\
14 & PKOD1 & 0.1452 & 0.0017 & 0.0014 \\
15 & RADI1 & 0.1694 & 0.0017 & 0.0024 \\
16 & RIR1 & 0.1490 & 0.0013 & 0.0017 \\
17 & RTIR1 & 0.0781 & 0.0017 & 0.0013 \\
18 & SIPA1 & 0.0488 & 0.0013 & 0.0014 \\
19 & SZPOL1 & 0.1102 & 0.0018 & 0.0019 \\
20 & TMKH1 & \(-\)0.0199 & 0.0018 & 0.0022 \\
21 & ZMYD1 & \(-\)0.0356 & 0.0010 & 0.0027 \\ \hline \end{tabular}
\end{table} 
Table 1: Input and output consist of the \(\beta\), semivariance, and expected return. \begin{table}
\begin{tabular}{c c c} \hline
**Asset ID** & **Stock Companies** & **Efficiency** \\ \hline
1 & CHAR1 & 1 \\
2 & FNAR1 & 0.8258 \\
3 & GOST1 & 0.5222 \\
4 & IKCO1 & 0.5355 \\
5 & KFAN1 & 0.5096 \\
6 & KISH1 & 0.8101 \\
7 & KRIR1 & 0.5607 \\
8 & LENT1 & 1 \\
9 & MESI1 & 0.6796 \\
10 & MHKM1 & 0.5606 \\
11 & MNSR1 & 0.8737 \\
12 & MSTI1 & 0.5080 \\
13 & NMOH1 & 0.4667 \\
14 & PKOD1 & 0.5607 \\
15 & RADI1 & 0.6928 \\
16 & RIIR1 & 0.7094 \\
17 & RTIR1 & 0.5546 \\
18 & SIPA1 & 0.7155 \\
19 & SZPOL 1 & 0.5493 \\
20 & TMKH1 & 0.7502 \\
21 & ZMYD1 & 1 \\ \hline \end{tabular}
\end{table} 
Table 2: Efficiency of any stock. this function necessitates a network architecture beyond one or two hidden layers. This intrinsic complexity, rather than input dimensionality, determines the requisite network depth. Insufficient depth, evidenced by unsatisfactory performance, signals underfitting, for which augmenting network depth by adding more hidden layers is a suitable solution. Three hidden layers were employed, providing sufficient depth to extract abstract features from weight combinations. Neuron counts of 30, 20, and 10 were selected for these layers, respectively. This decision stemmed from suboptimal performance with fewer neurons, as lower counts reduce model capacity, hindering accurate approximations of the semivariance function. A decreasing neuron count across layers is a common and effective neural network architecture. To prevent overfitting, early stopping was implemented; training halted if the validation error worsened for six consecutive epochs without improvement. Inherent in this design is the neural network's capacity to learn an approximation of the functional relationship between the input weights and the resultant semivariance, predicated on the provided 1000 data samples.