Modelling shares choice to enter in a portfolio using artificial neural networks (ANN)

Shares choice to enter a portfolio is a good topic in finance and management, as it affects the portfolio performance which is managed by a Fund Manager. In this research, we aim to create an artificial neural network model to choose a share to enter a portfolio based on its financial factors and big data about the financial condition of companies. The artificial neural network model has 15 input nodes of attributes associated with a company’s financial situation, 8 hidden layer nodes, and 1 output node. The accuracy of the model is 85.71%, with a learning rate of 0.05 trained over 2000 iterations.

enter into a portfolio. Jones [4] introduced a network analysis to build a portfolio. Reily and Brown ([13], 272) stated that an optimal portfolio is an efficient portfolio to have the highest utility for the investor's certainty.
Previous research used risk and return to choose a share enter in a portfolio, but it never discusses characteristics of the companies whose shares were entered into a portfolio, for example, market capitalization and financial ratio company. Farrell [3] investigated stock to enter in a portfolio using homogeneous stock grouping. Based on some previous researches, Common stocks tend to group naturally, according to their price behavior [8] and also P/E [10]. Wainscott [16] found that the changing of correlation between assets will significantly affect mixed-asset portfolio from one period to another period. Peritt and Lavine [11] stated that asset allocation is very important to build a portfolio. Marmer [9] explored an efficient frontier for Canadian's Portfolio. Fama and French [2] explored another factor to affect portfolio return. Reinganum [14] did research and stated that market capitalization has an impact on managing portfolio. Manurung [6] used the Logit Method to choose a share to enter into a portfolio using financial ratios.
Shares choice to enter in a portfolio is still developed for research, especially to explore new methods. Recently, a research on Shares choice to enter in a portfolio was conducted using Artificial Neural Networks (ANN). Ashwood [1] explored ANN as a method to predict stock prices in shares portfolio, with a result of better than 50% accuracy for almost all of the stocks and portfolios tested. Rasekhschaffe and Jones [12] used Machine Learning to select stocks for building portfolio using deep neural networks (DNN). This paper explores the usage of ANN to choose a share to enter in a portfolio using financial situation data of several Indonesian companies.
Meanwhile, big data techniques, especially the volume of data, can be used in modeling shares choice to gather data to use as training and testing data for the ANN. Zhang et al. [18] stated that ANNs can extract features from raw data while big data provides tremendous training samples for the ANN, creating a mutual reinforcement. Thus, the use of big data is beneficial to improve this experiment in the future.

Proposed methods
The algorithms used for building the ANN was supervised stochastic learning with backpropagation and steepest gradient descent, with bias nodes at the hidden and output layer. The 31 data rows gathered were split into 80% training set and 20% test set. The model of the ANN was as shown in Fig. 1.
The ANN takes 15 input data, X, of attributes associated with a company's financial situation: The hidden layer, H, which consists of 8 nodes, then extracts features from these data and sends a signal to the output layer, Y. The result is the probability of the company being bankrupt or not. To calculate the accuracy of the model, the test set is fed into the trained network, and if the probability is above 70%, then the company is bankrupt (Y = 1), otherwise, it is not bankrupt (Y = 0). This output is then compared with the actual labels of the test set.
The equations used in this research are as follows: Linear combinations:

Fig. 1 The proposed model of ANN used in this research
with: o j , p n as linear combination results for the hidden layer nodes and output layer nodes respectively; w ij as weights from the input layer to the hidden layer; u kl as weights from the hidden layer to the output layer; x i as input nodes; h m as hidden layer nodes; b 1 , b 2 as biases of the hidden layer and the output layer respectively; i, k as the index of nodes in the input layer and the hidden layer respectively; j, l as the index of nodes in the hidden layer and the output layer respectively; a, b as the number of nodes in the input layer and the hidden layer respectively.
Sigmoid activation function: with: h j as the hidden layer nodes' output; y as the output layer node's output; o j , p l as linear combination results for the hidden layer nodes and output layer nodes respectively.
Mean squared error: with: E as error (or loss); t as the target output; y as the output layer node's output Steepest gradient descent: with: w new as the new weight value; w old as the current weight value; w as the adjustment made to the current weight value; α as learning rateg n (w) as a function of weight; b new as the new bias value; b old as the current bias value; y as a vector of the output layer nodes' output; t as a vector of the target output. Chain rule for the hidden layer → output weights (u): (2) with: g n (u) as a function of the hidden layer → output layer weights; ∂E ∂u as the partial derivative of Error against the hidden layer → output layer weights; ∂E ∂y as the partial derivative of Error against the output layer; ∂y ∂q as the partial derivative of the output layer against the output layer's linear combination; ∂q ∂u as the partial derivative of the output layer's linear combination against the hidden layer → output layer weights.
Chain rule for the input layer → hidden layer weights (w): with: g n (w) as a function of the input layer → hidden layer weights; ∂E ∂w as the partial derivative of Error against the input layer → hidden layer weights; ∂q ∂h as the partial derivative of the output layer's linear combination against the hidden layer; ∂h ∂p as the partial derivative of the hidden layer against the input layer's linear combination; ∂p ∂w as the partial derivative of the hidden layer's linear combination against the input layer → hidden layer weights.
Meanwhile, the pseudocode of the algorithm used in this experiment is:

Experimental results
We used a total of 31 lines of data for training and testing. The data was split into 80% training set and 20% test set prior to executing the training algorithm using the architecture defined in Fig. 1. It was trained with various learning rates: 0.5, 0.1 and 0.05. It was also trained with various amounts of iterations.
The test results can be seen in Fig. 2, while the error vs. iteration graph for each learning rate for 2000 iterations can be seen in Figs. 3, 4, 5.

Discussion
As can be seen in Fig. 2

Conclusion
The data in this research are real data from some Indonesian companies. With these results, it can be said that the data used can be used to predict which shares are best for a portfolio. The algorithms used for building the ANN were supervised stochastic learning with backpropagation and steepest gradient descent, with the optimal parameters of 0.05 learning rate trained over 2000 iterations. These algorithms run with these parameters were able to predict if a company will go bankrupt with good success, that is, with 85.71% accuracy. The accuracy may be improved by obtaining more real data to be used in training the ANN, so it can learn from more examples. Big data techniques will be very helpful in this matter.
Abbreviation ANN: Artificial neural network.