## 4 Experiment and Results
### Experiment Results  
#### 4.3.1 Stock Prediction Results  
At the beginning, portfolios \(P_{i}(i=1,\ldots,10)\) were constructed based on the stock prediction models. We evaluated LSTM and GRU prediction models as both are variations of RNN and able to prevent vanishing gradient problems. Table 3 summarized the detailed portfolio as well as the loss of error values for each stock in the constructed portfolios.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Period** & **Start** & **End** & **Days** \\ \hline
1 & 2017/11/22 & 2017/12/29 & 26 \\
2 & 2017/10/17 & 2017/12/29 & 51 \\
3 & 2017/09/12 & 2017/12/29 & 76 \\
4 & 2017/08/07 & 2017/12/29 & 100 \\
5 & 2017/06/30 & 2017/12/29 & 126 \\
6 & 2017/05/25 & 2017/12/29 & 151 \\
7 & 2017/04/19 & 2017/12/29 & 177 \\
8 & 2017/03/14 & 2017/12/29 & 202 \\
9 & 2017/02/06 & 2017/12/29 & 227 \\
10 & 2016/12/29 & 2017/12/29 & 252 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Prediction time horizon.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**P**} & \multicolumn{4}{c}{**LSTM**} & \multicolumn{4}{c}{**GRU**} \\ \cline{2-6}  & **Stock** & **MAE** & **MSE** & **Stock** & **MAE** & **MSE** \\ \hline \multirow{4}{*}{**1**} & **DVA** & 0.05965 & 0.00413 & **DVA** & 0.04731 & 0.00258 \\  & **FCX** & 0.01899 & 0.00064 & **FCX** & 0.02019 & 0.00067 \\  & **KSS** & 0.01364 & 0.00038 & **M** & 0.03484 & 0.00164 \\  & **LB** & 0.03459 & 0.00195 & **LB** & 0.02525 & 0.00092 \\ \hline \multirow{4}{*}{**2**} & **FL** & 0.04111 & 0.00279 & **FL** & 0.02515 & 0.00089 \\  & **NKTR** & 0.01227 & 0.00024 & **NKTR** & 0.01232 & 0.00028 \\  & **KSS** & 0.01403 & 0.00035 & **KR** & 0.04080 & 0.00197 \\  & **LB** & 0.02482 & 0.00105 & **LB** & 0.02604 & 0.00105 \\ \hline \multirow{4}{*}{**3**} & **MRO** & 0.04735 & 0.00376 & **MRO** & 0.01433 & 0.00035 \\  & **NKTR** & 0.04052 & 0.00236 & **NKTR** & 0.01565 & 0.00033 \\  & **NATP** & 0.02651 & 0.00124 & **SIVB** & 0.01357 & 0.00034 \\  & **LB** & 0.00850 & 0.00016 & **LB** & 0.04476 & 0.00302 \\ \hline \multirow{4}{*}{**4**} & **GPS** & 0.00321 & 0.00003 & GPS & 0.01324 & 0.00028 \\  & **NKTR** & 0.00205 & 0.00001 & **NKTR** & 0.01554 & 0.00032 \\  & **MU** & 0.00230 & 0.00001 & **MU** & 0.01201 & 0.00025 \\  & **URI** & 0.00360 & 0.00002 & **URI** & 0.01473 & 0.01554 \\ \hline \multirow{4}{*}{**5**} & **GPS** & 0.01071 & 0.00019 & GPS & 0.01130 & 0.00021 \\  & **NKTR** & 0.01347 & 0.00028 & **NKTR** & 0.01567 & 0.00035 \\  & **NRG** & 0.01485 & 0.00048 & **NRG** & 0.01461 & 0.00047 \\  & **URI** & 0.01726 & 0.00047 & **URI** & 0.01658 & 0.00046 \\ \hline \multirow{4}{*}{**6**} & **ALGN** & 0.01432 & 0.00043 & **ALGN** & 0.01034 & 0.00026 \\  & **NKTR** & 0.00267 & 0.00002 & **NKTR** & 0.00114 & 0.00000 \\  & **NRG** & 0.01930 & 0.00044 & **NRG** & 0.00597 & 0.00005 \\  & **TROW** & 0.01360 & 0.00027 & **URI** & 0.01389 & 0.00029 \\ \hline \multirow{4}{*}{**7**} & **ALGN** & 0.00514 & 0.00004 & **ALGN** & 0.00892 & 0.00019 \\  & **NKTR** & 0.00426 & 0.00004 & **NKTR** & 0.00367 & 0.00003 \\ \cline{1-1}  & **IPGP** & 0.00294 & 0.00002 & **NDVA** & 0.01476 & 0.00037 \\ \cline{1-1}  & **NDVA** & 0.00261 & 0.00002 & **TTWO** & 0.01806 & 0.00053 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Summarized prediction loss of error. LSTM, long short-term memory; GRU, gated recurrent unit; MAE, mean absolute error; MSE, mean square error.  
In general, both the LSTM and GRU models had low error values. The LSTM model was found more efficient than the GRU model by obtaining lower error rates. LSTM controls the exposure of memory content (cell state), while GRU exposes the entire cell state to other units in the network. The LSTM unit has separate input and forget gates, while the GRU performs both of these operations together via its reset gate.