Stock prediction using 3 methods LSTM, ARIMA And MCMC
During the course of my bachelor’s thesis, I tested various stock prediction methods and made mistakes along the way.
Most of you are probably familiar with LSTM, ARIMA (and its variations) and MCMC (Markov Chain Monte Carlo). Stock prices are usually a bit harder to forecast due to market volatility and social influences on the trend. So, my research focused on combining such methods in order to make my predictions flexible, depending on the historical data of each stock. It is my hope that you will find this notebook useful.
Installing Packages
For data scraping I use yfinance package, it is easy to install and use.
Yfinance is an open source library developed by Ran Aroussi for accessing Yahoo Finance’s financial data. Yahoo Finance provides excellent market data on stocks, bonds, currencies, and cryptocurrencies. Also, it provides market news, reports, and analysis, as well as options and fundamentals data- setting it apart from some of its competitors.
!pip install yfinance --quiet
!pip install pmdarima --quiet
Python package installer “pip” is used to install two libraries: “yfinance” and “pmdarima”.
Installing the “yfinance” library is achieved with the first line “!pip install yfinance — quiet”. Using this library, you can retrieve financial data from Yahoo! Finance. In order to suppress the output messages generated during installation, use the “ — quiet” flag.
This article does not have an external file to download.