# Comparison of Financial Models for Stock Price Prediction

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Literature Review

## 3. Methodology

#### 3.1. Data

#### 3.2. Autoregressive Integrated Moving Average Process

#### 3.2.1. ARIMA(p,d,q) Models

#### 3.2.2. ARIMA(p,d,q) Model for S & P 500 Index

#### 3.3. Stochastic Model Geometric Brownian Motion

- $W\left(0\right)=0$
- It has independent increments. That is, for any ${t}_{1},{t}_{2},\cdots ,{t}_{n}$, $W\left({t}_{2}\right)-W\left({t}_{1}\right),W\left({t}_{3}\right)-W\left({t}_{4}\right)\cdots ,W\left({t}_{n}\right)-W\left({t}_{n-}\right)$ are independent random variables.
- For every $0\le s<t\le T,W\left(t\right)-W\left(s\right)\sim \mathbb{N}(0,t-s).$

#### 3.3.1. Geometric Brownian Motion (GBM) Model

#### 3.3.2. Geometric Brownian Motion Model for S & P 500 Index: GBM($\mu ,{\sigma}^{2}$) Simulation

#### 3.4. Artificial Neural Network

#### 3.4.1. Model Descriptions

#### 3.4.2. Artificial Neural Network for S & P 500 Index

## 4. Results

#### 4.1. Autoregressive Integrated Moving Average

#### 4.1.1. ARIMA Model Result

#### 4.1.2. ARIMA Model Diagnostics

#### 4.2. Stochastic Model

#### 4.2.1. Stochastic Model Result

#### 4.2.2. Stochastic Model Diagnostics

#### 4.3. Artificial Neural Network

#### 4.3.1. ANN(7-15-1) Results

#### 4.3.2. ANN(7-15-1) Model Diagnostics

#### 4.4. Comparison

## 5. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Adebiyi, Ayodele Ariyo, Aderemi Oluyinka Adewumi, and Charles Korede Ayo. 2014. Comparison of arima and artificial neural networks models for stock price prediction. Journal of Applied Mathematics 2014: 614342. [Google Scholar] [CrossRef][Green Version]
- Agustini, W. Farida, Ika Restu Affianti, and Endah R. M. Putri. 2018. Stock price prediction using geometric brownian motion. Journal of Physics: Conference Series 974: 012047. [Google Scholar]
- Avcı, Emin. 2007. Forecasting daily and sessional returns of the ise-100 index with neural network models. Dogus Universitesi Dergisi 8: 128–42. [Google Scholar] [CrossRef]
- Chen, An-Sing, Mark T. Leung, and Hazem Daouk. 2003. Application of neural networks to an emerging financial market: Forecasting and trading the taiwan stock index. Computers & Operations Research 30: 901–23. [Google Scholar]
- Cheung, Yin-Wong, and Kon S. Lai. 1995. Lag order and critical values of the augmented dickey–fuller test. Journal of Business & Economic Statistics 13: 277–80. [Google Scholar]
- Cryer, Jonathan D., and Natalie Kellet. 1991. Time Series Analysis. Berlin and Heidelberg: Springer. [Google Scholar]
- Dmouj, Abdelmoula. 2006. Stock Price Modelling: Theory and Practice. Masters’s thesis, Vrije Universiteit, Amsterdam, The Netherlands. [Google Scholar]
- Estember, Rene D., and Michael John R. Maraña. 2016. Forecasting of stock prices using brownian motion–monte carlo simulation. Paper presented at the 2016 International Conference on Industrial Engineering and Operations Management Kuala Lumpur, Kuala Lumpur, Malaysia, March 8–10; pp. 704–13. [Google Scholar]
- Hassan, Md Rafiul, and Baikunth Nath. 2005. Stock market forecasting using hidden markov model: A new approach. Paper presented at the International Conference on Intelligent Systems Design and Applications (ISDA’05), Pretoria, South Africa, December 3–5; Piscataway: IEEE, pp. 192–96. [Google Scholar]
- Hassan, Md Rafiul, Baikunth Nath, and Michael Kirley. 2007. A fusion model of hmm, ann and ga for stock market forecasting. Expert Systems with Applications 33: 71–80. [Google Scholar] [CrossRef]
- Khashei, Mehdi, and Mehdi Bijari. 2010. An artificial neural network (p, d, q) model for timeseries forecasting. Expert Systems with Applications 37: 479–89. [Google Scholar] [CrossRef]
- Lee, Kyungjoo, Sehwan Yoo, and John Jongdae. 2007. Neural network model versus sarima model in forecasting korean stock price index (kospi). Issues in Information System 8: 372–8. [Google Scholar]
- Makridakis, Spyros, and Michele Hibon. 1997. Arma models and the box–jenkins methodology. Journal of Forecasting 16: 147–63. [Google Scholar] [CrossRef]
- Merh, Nitin, Vinod P. Saxena, and Kamal Raj Pardasani. 2010. A comparison between hybrid approaches of ann and arima for indian stock trend forecasting. Business Intelligence Journal 3: 23–43. [Google Scholar]
- Meyler, Aidan, Geoff Kenny, and Terry Quinn. 1998. Forecasting Irish Inflation Using Arima Models. Dublin: Central Bank of Ireland. [Google Scholar]
- Neath, Andrew A., and Joseph E. Cavanaugh. 2012. The bayesian information criterion: Background, derivation, and applications. Wiley Interdisciplinary Reviews: Computational Statistics 4: 199–203. [Google Scholar] [CrossRef]
- Nguyet Nguyen, Dung Nguyen, and Thomas P. Wakefield. 2018. Using the hidden markov model to improve the hull-white model for short rate. International Journal of Trade, Economics and Finance 9. [Google Scholar] [CrossRef]
- Rathnayaka, R. M. Kapila Tharanga, Wei Jianguo, and DMK N. Seneviratna. 2014. Geometric brownian motion with ito’s lemma approach to evaluate market fluctuations: A case study on colombo stock exchange. Paper presented at the 2014 International Conference on Behavioral, Economic, and Socio-Cultural Computing (BESC2014), Shanghai, China, October 30–November 2; Piscataway: IEEE, pp. 1–6. [Google Scholar]
- Ryan, Jeffrey A., Joshua M. Ulrich, Wouter Thielen, Paul Teetor, Steve Bronder, and Maintainer Joshua M. Ulrich. 2020. Package ‘quantmod’. Available online: https://cran.r-project.org/web/packages/quantmod/quantmod.pdf (accessed on 14 August 2020).
- Ševcovic, Daniel, B. Stehlıková, and K. Mikula. 2011. Analytical and Numerical Methods for Pricing Financial Derivatives. Hauppauge: Nova Science. [Google Scholar]
- Tambi, Mahesh Kumar. 2005. Forecasting exchange rate: A univariate out of sample approach. The IUP Journal of Bank Management 4: 60–74. [Google Scholar]
- White, Halbert. 1988. Economic prediction using neural networks: The case of ibm daily stock returns. Paper presented at the IEEE 1988 International Conference on Neural Networks, San Diego, CA, USA, July 24–27; vol. 2, pp. 451–58. [Google Scholar]
- Yang, Zhijun, and D. Aldous. 2015. Geometric Brownian Motion Model in Financial Market. Berkeley: University of California. [Google Scholar]
- Yao, Jingtao, Chew Lim Tan, and Hean-Lee Poh. 1999. Neural networks for technical analysis: A study on klci. International Journal of Theoretical and Applied Finance 2: 221–41. [Google Scholar] [CrossRef][Green Version]
- Zhang, Guoqiang, B. Eddy Patuwo, and Michael Y. Hu. 1998. Forecasting with artificial neural networks: The state of the art. International Journal of Forecasting 14: 35–62. [Google Scholar] [CrossRef]
- Zhang, Yudong, and Lenan Wu. 2009. Stock market prediction of S & P 500 via combination of improved bco approach and bp neural network. Expert Systems with Applications 36: 8849–54. [Google Scholar]

Model | AIC | BIC | AICc |
---|---|---|---|

ARIMA(0,2,0) | $-7144.11$ | $-7139.03$ | $-7144.11$ |

ARIMA(0,2,1) | $-7981.48$ | $-7971.31$ | $-7981.47$ |

ARIMA(0,2,2) | $-7979.84$ | $-7964.59$ | $-7979.82$ |

ARIMA(0,2,3) | $-7981.77$ | $-7961.43$ | $-7981.73$ |

ARIMA(0,2,4) | $-7980.02$ | $-7954.61$ | $-7979.97$ |

ARIMA(1,2,0) | $-7455.29$ | $-7445.12$ | $-7455.28$ |

ARIMA(1,2,1) | $-7979.81$ | $-7964.56$ | $-7979.79$ |

ARIMA(1,2,2) | $-7982.16$ | $-7961.83$ | $-7982.13$ |

ARIMA(1,2,3) | $-7983.04$ | $-7957.62$ | $-7982.98$ |

ARIMA(1,2,4) | $-7981.53$ | $-7951.03$ | $-7981.45$ |

ARIMA(2,2,0) | $-7631.73$ | $-7616.48$ | $-7631.71$ |

ARIMA(2,2,1) | $-7981.50$ | $-7961.16$ | $-7981.46$ |

ARIMA(2,2,2) | $-7982.88$ | $-7957.46$ | $-7982.83$ |

ARIMA(2,2,3) | $-7982.62$ | $-7952.12$ | $-7982.55$ |

ARIMA(2,2,4) | $-7979.91$ | $-7944.32$ | $-7979.81$ |

ARIMA(3,2,0) | $-7692.63$ | $-7672.30$ | $-7692.60$ |

ARIMA(3,2,1) | $-7979.84$ | $-7954.42$ | $-7979.79$ |

ARIMA(3,2,2) | $-7981.50$ | $-7951.00$ | $-7981.43$ |

ARIMA(3,2,3) | $-7977.84$ | $-7942.25$ | $-7977.74$ |

ARIMA(3,2,4) | $-7978.07$ | $-7937.40$ | $-7977.95$ |

ARIMA(4,2,0) | $-7738.80$ | $-7713.39$ | $-7738.75$ |

ARIMA(4,2,1) | $-7980.13$ | $-7949.63$ | $-7980.06$ |

ARIMA(4,2,2) | $-7978.69$ | $-7943.11$ | $-7978.60$ |

ARIMA(4,2,3) | $-7978.28$ | $-7937.61$ | $-7978.15$ |

ARIMA(4,2,4) | $-7984.84$ | $-7939.09$ | $-7984.69$ |

Model | Arima(x = tr.stock, order = c(0, 2, 1)) | ||||||
---|---|---|---|---|---|---|---|

MA(1) Coefficient | −1.00 | ||||||

Standard Error | 0.0027 | ||||||

Sigma-squared estimated as | 0.0000718 | ||||||

Log likelihood | 3992.74 | ||||||

AIC | −7981.48 | ||||||

AICc | −7981.47 | ||||||

BIC | −7971.31 | ||||||

Training set error measures | ME | RMSE | MAE | MPE | MAPE | MASE | ACF1 |

0.00013 | 0.00846 | 0.00573 | 0.00220 | 0.10561 | 0.99516 | −0.01682 |

MODEL | ${\mathit{R}}^{2}$ | APE | AAE | ARPE | RMSE |
---|---|---|---|---|---|

7-2-1 | 0.3137 | 0.0231 | 7.0435 | 0.1118 | 0.3344 |

7-3-1 | 0.4158 | 0.0211 | 6.412 | 0.1018 | 0.319 |

7-4-1 | 0.0422 | 0.028 | 8.5128 | 0.1351 | 0.3676 |

7-5-1 | 0.0368 | 0.0292 | 8.8796 | 0.1409 | 0.3754 |

7-6-1 | 0.3716 | 0.0215 | 6.5496 | 0.104 | 0.3224 |

7-7-1 | 0.3431 | 0.0226 | 6.8687 | 0.109 | 0.3302 |

7-8-1 | 0.3907 | 0.0219 | 6.6781 | 0.106 | 0.3256 |

7-9-1 | 0.4036 | 0.0212 | 6.4713 | 0.1027 | 0.3205 |

7-10-1 | 0.4108 | 0.0214 | 6.5237 | 0.1036 | 0.3218 |

7-11-1 | 0.5155 | 0.0195 | 5.9284 | 0.0941 | 0.3068 |

7-12-1 | 0.5392 | 0.0187 | 5.6802 | 0.0902 | 0.3003 |

7-13-1 | 0.4777 | 0.0194 | 5.8945 | 0.0936 | 0.3059 |

7-14-1 | 0.4676 | 0.0196 | 5.9702 | 0.0948 | 0.3078 |

7-15-1 | 0.6216 | 0.0167 | 5.0928 | 0.0808 | 0.2843 |

7-16-1 | 0.5701 | 0.0182 | 5.5382 | 0.0879 | 0.2965 |

Date | Actual | Predicted | Error |
---|---|---|---|

11-12-2019 | 305.69 | 305.17 | 0.17 |

11-13-2019 | 305.79 | 305.81 | 0.01 |

11-14-2019 | 306.23 | 305.91 | 0.10 |

11-15-2019 | 308.45 | 306.35 | 0.68 |

11-18-2019 | 308.68 | 308.57 | 0.04 |

11-19-2019 | 308.59 | 308.80 | 0.07 |

11-20-2019 | 307.44 | 308.71 | 0.41 |

11-21-2019 | 306.95 | 307.56 | 0.20 |

11-22-2019 | 307.63 | 307.07 | 0.18 |

11-25-2019 | 310.01 | 307.75 | 0.73 |

11-26-2019 | 310.72 | 310.14 | 0.19 |

11-27-2019 | 312.10 | 310.85 | 0.40 |

11-29-2019 | 310.94 | 312.23 | 0.41 |

12-2-2019 | 308.30 | 311.07 | 0.90 |

12-3-2019 | 306.23 | 308.43 | 0.72 |

12-4-2019 | 308.12 | 306.36 | 0.57 |

12-5-2019 | 308.68 | 308.25 | 0.14 |

12-6-2019 | 311.50 | 308.81 | 0.86 |

12-9-2019 | 310.52 | 311.64 | 0.36 |

12-10-2019 | 310.17 | 310.65 | 0.15 |

12-11-2019 | 311.05 | 310.30 | 0.24 |

12-12-2019 | 313.73 | 311.18 | 0.81 |

12-13-2019 | 313.92 | 313.86 | 0.02 |

12-16-2019 | 316.08 | 314.05 | 0.64 |

12-17-2019 | 316.15 | 316.21 | 0.02 |

12-18-2019 | 316.17 | 316.29 | 0.04 |

12-19-2019 | 317.46 | 316.31 | 0.36 |

12-20-2019 | 318.86 | 317.60 | 0.40 |

12-23-2019 | 319.34 | 319.00 | 0.11 |

12-24-2019 | 319.35 | 319.48 | 0.04 |

12-26-2019 | 321.05 | 319.49 | 0.49 |

12-27-2019 | 320.97 | 321.20 | 0.07 |

12-30-2019 | 319.20 | 321.12 | 0.60 |

MODEL | APE | AAE | ARPE | RMSE |
---|---|---|---|---|

ARIMA(0,2,1) | 0.0044 | 1.3651 | 0.0217 | 0.1472 |

Date | Actual | Predicted | Error |
---|---|---|---|

11-12-2019 | 305.69 | 305.17 | 0.17 |

11-13-2019 | 305.79 | 305.81 | 0.01 |

11-14-2019 | 306.23 | 305.91 | 0.10 |

11-15-2019 | 308.45 | 306.35 | 0.68 |

11-18-2019 | 308.68 | 308.59 | 0.03 |

11-19-2019 | 308.59 | 308.80 | 0.07 |

11-20-2019 | 307.44 | 308.71 | 0.41 |

11-21-2019 | 306.95 | 307.58 | 0.21 |

11-22-2019 | 307.63 | 307.06 | 0.19 |

11-25-2019 | 310.01 | 307.74 | 0.73 |

11-26-2019 | 310.72 | 310.15 | 0.18 |

11-27-2019 | 312.10 | 310.86 | 0.40 |

11-29-2019 | 310.94 | 312.23 | 0.41 |

12-2-2019 | 308.30 | 311.09 | 0.90 |

12-3-2019 | 306.23 | 308.43 | 0.72 |

12-4-2019 | 308.12 | 306.36 | 0.57 |

12-5-2019 | 308.68 | 308.25 | 0.14 |

12-6-2019 | 311.50 | 308.82 | 0.86 |

12-9-2019 | 310.52 | 311.63 | 0.36 |

12-10-2019 | 310.17 | 310.64 | 0.15 |

12-11-2019 | 311.05 | 310.30 | 0.24 |

12-12-2019 | 313.73 | 311.21 | 0.80 |

12-13-2019 | 313.92 | 313.88 | 0.01 |

12-16-2019 | 316.08 | 314.06 | 0.64 |

12-17-2019 | 316.15 | 316.21 | 0.02 |

12-18-2019 | 316.17 | 316.27 | 0.03 |

12-19-2019 | 317.46 | 316.31 | 0.36 |

12-20-2019 | 318.86 | 317.59 | 0.40 |

12-23-2019 | 319.34 | 319.00 | 0.11 |

12-24-2019 | 319.35 | 319.47 | 0.04 |

12-26-2019 | 321.05 | 319.51 | 0.48 |

12-27-2019 | 320.97 | 321.20 | 0.07 |

12-30-2019 | 319.20 | 321.11 | 0.60 |

MODEL | APE | AAE | ARPE | RMSE |
---|---|---|---|---|

GBM | 0.0044 | 1.3341 | 0.0212 | 0.1455 |

Date | Actual | Predicted | Error |
---|---|---|---|

11-12-2019 | 305.69 | 302.13 | 1.17 |

11-13-2019 | 305.79 | 302.52 | 1.07 |

11-14-2019 | 306.23 | 302.26 | 1.30 |

11-15-2019 | 308.45 | 302.39 | 1.97 |

11-18-2019 | 308.68 | 303.56 | 1.66 |

11-19-2019 | 308.59 | 304.19 | 1.43 |

11-20-2019 | 307.44 | 303.54 | 1.27 |

11-21-2019 | 306.95 | 302.52 | 1.44 |

11-22-2019 | 307.63 | 302.86 | 1.55 |

11-25-2019 | 310.72 | 305.06 | 1.82 |

11-27-2019 | 312.10 | 305.81 | 2.02 |

11-29-2019 | 310.94 | 306.38 | 1.47 |

12-2-2019 | 308.30 | 306.02 | 0.74 |

12-3-2019 | 306.23 | 303.59 | 0.86 |

12-4-2019 | 308.12 | 301.63 | 2.11 |

12-5-2019 | 308.68 | 304.03 | 1.51 |

12-6-2019 | 311.50 | 304.28 | 2.32 |

12-9-2019 | 310.52 | 306.05 | 1.44 |

12-10-2019 | 310.17 | 306.07 | 1.33 |

12-11-2019 | 311.05 | 305.23 | 1.87 |

12-12-2019 | 313.73 | 305.55 | 2.61 |

12-13-2019 | 313.92 | 306.48 | 2.37 |

12-16-2019 | 316.08 | 306.73 | 2.96 |

12-17-2019 | 316.15 | 307.56 | 2.72 |

12-18-2019 | 316.17 | 308.05 | 2.57 |

12-19-2019 | 317.46 | 308.40 | 2.85 |

12-20-2019 | 318.86 | 308.04 | 3.39 |

12-23-2019 | 319.34 | 306.20 | 4.11 |

12-24-2019 | 319.35 | 308.94 | 3.26 |

12-26-2019 | 321.05 | 309.71 | 3.53 |

12-27-2019 | 320.97 | 310.31 | 3.32 |

12-30-2019 | 319.20 | 309.93 | 2.90 |

MODEL | APE | AAE | ARPE | RMSE |
---|---|---|---|---|

ANN(7-15-1) | 0.0167 | 5.09279 | 0.08084 | 0.28432 |

Date | Actual | ARIMA | GBM | ANN |
---|---|---|---|---|

11-12-2019 | 305.69 | 305.17 | 305.17 | 302.13 |

11-13-2019 | 305.79 | 305.81 | 305.81 | 302.52 |

11-14-2019 | 306.23 | 305.91 | 305.91 | 302.26 |

11-15-2019 | 308.45 | 306.35 | 306.35 | 302.39 |

11-18-2019 | 308.68 | 308.57 | 308.59 | 303.56 |

11-19-2019 | 308.59 | 308.80 | 308.80 | 304.19 |

11-20-2019 | 307.44 | 308.71 | 308.71 | 303.54 |

11-21-2019 | 306.95 | 307.56 | 307.58 | 302.52 |

11-22-2019 | 307.63 | 307.07 | 307.06 | 302.86 |

11-25-2019 | 310.01 | 307.75 | 307.74 | 303.50 |

11-26-2019 | 310.72 | 310.14 | 310.15 | 305.06 |

11-27-2019 | 312.10 | 310.85 | 310.86 | 305.81 |

11-29-2019 | 310.94 | 312.23 | 312.23 | 306.38 |

12-2-2019 | 308.30 | 311.07 | 311.09 | 306.02 |

12-3-2019 | 306.23 | 308.43 | 308.43 | 303.59 |

12-4-2019 | 308.12 | 306.36 | 306.36 | 301.63 |

12-5-2019 | 308.68 | 308.25 | 308.25 | 304.03 |

12-6-2019 | 311.50 | 308.81 | 308.82 | 304.28 |

12-9-2019 | 310.52 | 311.64 | 311.63 | 306.05 |

12-10-2019 | 310.17 | 310.65 | 310.64 | 306.04 |

12-11-2019 | 311.05 | 310.30 | 310.30 | 305.23 |

12-12-2019 | 313.73 | 311.18 | 311.21 | 305.55 |

12-13-2019 | 313.92 | 313.86 | 313.88 | 306.48 |

12-16-2019 | 316.08 | 314.05 | 314.06 | 306.73 |

12-17-2019 | 316.15 | 316.21 | 316.21 | 307.56 |

12-18-2019 | 316.17 | 316.29 | 316.27 | 308.05 |

12-19-2019 | 317.46 | 316.31 | 316.31 | 308.40 |

12-20-2019 | 318.86 | 317.60 | 317.59 | 308.04 |

12-23-2019 | 319.34 | 319.00 | 319.00 | 306.20 |

12-24-2019 | 319.35 | 319.48 | 319.47 | 308.94 |

12-26-2019 | 321.05 | 319.49 | 319.51 | 309.71 |

12-27-2019 | 320.97 | 321.20 | 321.20 | 310.31 |

12-30-2019 | 319.20 | 321.12 | 321.11 | 309.93 |

MODEL | APE | AAE | ARPE | RMSE |
---|---|---|---|---|

ARIMA(0,2,1) | 0.00438 | 1.33476 | 0.02119 | 0.14556 |

GBM | 0.00438 | 1.33426 | 0.02118 | 0.14553 |

ANN(7-15-1) | 0.01672 | 5.09279 | 0.08084 | 0.28432 |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Islam, M.R.; Nguyen, N. Comparison of Financial Models for Stock Price Prediction. *J. Risk Financial Manag.* **2020**, *13*, 181.
https://doi.org/10.3390/jrfm13080181

**AMA Style**

Islam MR, Nguyen N. Comparison of Financial Models for Stock Price Prediction. *Journal of Risk and Financial Management*. 2020; 13(8):181.
https://doi.org/10.3390/jrfm13080181

**Chicago/Turabian Style**

Islam, Mohammad Rafiqul, and Nguyet Nguyen. 2020. "Comparison of Financial Models for Stock Price Prediction" *Journal of Risk and Financial Management* 13, no. 8: 181.
https://doi.org/10.3390/jrfm13080181