# A Novel Approach to Short-Term Stock Price Movement Prediction using Transfer Learning
## 5 Deep Transfer with Related Stock Information (DTRSI) Framework
### Training the Prediction Model  
In this subsection, we discuss how to train the prediction model. This model has the same architecture as the base model, and initial values of parameters are set to parameter values found for the base model. The prediction model takes data from only the COI stock for training task. Moreover, six different sets of input features (\(si_{t}^{COI}\), \(si_{t}^{CI}\), \(si_{t}^{CI+CS}\), \(si_{t}^{CI+SF}\), \(si_{t}^{CI+HMC}\), and \(si_{t}^{CI+RND}\)) are considered, which are fed into the prediction model to predict COI stock price movement on day \(t+1\). Table 3 defines the notations that are used in this subsection.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Notation** & **Meaning** \\ \hline \(s_{t}^{COI}\) & Input using only one-day returns of COI stock on day \(t\) \\ \(s_{t}^{CI}\) & Input using one-day returns of the COI stock and the index on day \(t\) \\ \(s_{t}^{CI}\) & Input using one-day returns of the COI stock, the index, and the company with the highest cosine similarity to the COI on day \(t\) \\ \(s_{t}^{CI+SF}\) & Input using one-day returns of the COI stock, the index, and the company from a field similar to the COI on day \(t\) \\ \(s_{t}^{CI+HMC}\) & Input using one-day returns of the COI stock, the index, and the company with the highest market capitalization on day \(t\) \\ \(s_{t}^{CI+RND}\) & Input using one-day returns of the COI stock, the index, and the company chosen randomly on day \(t\) \\ \(R_{t}^{COI}\) & Feature vector of the COI stock on day \(t\) \\ \(R_{t}^{KL}\) & Feature vector of the index on day \(t\) \\ \(R_{t}^{KL}\) & \(R_{t}^{KCs}\) & Feature vector of \(m\) stocks with the highest cosine similarity to the COI on day \(t\) \\ \(R_{t}^{KL}\) & \(R_{t}^{KL}\) & Feature vector of \(m\) stocks from a field similar to the COI on day \(t\) \\ \(R_{t}^{RND}\) & \(R_{t}^{RND}\) & Feature vector of \(m\) stocks with the highest market capitalization on day \(t\) \\ \(R_{t}^{RND}\) & \(r_{t}^{RND}\) & Feature vector of \(m\) stocks chosen randomly on day \(t\) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Definitions of notations.  
Each input vector is formed as follows:  
\[s_{t}^{COI}=\{R_{t}^{COI}\} \tag{7}\]  
\[s_{t}^{CI}=\{R_{t}^{COI},R_{t}^{index}\} \tag{8}\]  
\[s_{t}^{CI+CS}=\{R_{t}^{COI},R_{t}^{index},R_{t}^{CS_{1}},...,R_{t}^{CS_{m}}\} \tag{9}\]  
\[s_{t}^{CI+SF}=\{R_{t}^{COI},R_{t}^{index},R_{t}^{SF_{1}},...,R_{t}^{SF_{m}}\} \tag{10}\]  
\[s_{t}^{CI+HMC}=\{R_{t}^{COI},R_{t}^{index},R_{t}^{HMC_{1}},...,R_{t}^{HMC_{m}}\} \tag{11}\]  
\[s_{t}^{CI+RND}=\{R_{t}^{COI},R_{t}^{index},R_{t}^{RND_{1}},...,R_{t}^{RND_{m}}\}. \tag{12}\]  
In training the prediction model, six dimensional tensors, \(\mathbb{SI}_{1}\), \(\mathbb{SI}_{2}\), \(\mathbb{SI}_{3a}\), \(\mathbb{SI}_{3b}\), \(\mathbb{SI}_{3c}\), and \(\mathbb{SI}_{3d}\), with dimensions of \(n_{samp}\times 20\times k\) are constructed as the training data for six types of input vectors, \(s_{t}^{COI}\), \(s_{t}^{CI}\), \(s_{t}^{CI+CS}\), \(s_{t}^{CI+SF}\), \(s_{t}^{CI+HMC}\), and \(s_{t}^{CI+RND}\), respectively. Thus, we train six different prediction models using six different types of training data. Note that the base model and the prediction model have the same feature space. All training data of the prediction model are fed into the base model correspondingly, as shown in Table 4.  
The learning rate and the maximum number of epochs are 0.0005 and 500, respectively. A small learning rate is chosen to avoid distorting pre-trained parameters too quickly.