Stock market speculation is captivating to many people. Millions of people worldwide sell and buy stocks in the hope of turning a profit. By using machine learning could Random Forest or Linear Regression estimate which direction the trend of the stock market is heading, and would Random Forest outperform Linear Regression since it involves more complex methods. To explore the subject, several stocks from Nasdaq and the index of Swedish OMX are studied and used to evaluate the machine learning models. The data was modified to measure the change in percentage to accommodate the Random Forests inability to extrapolate. The return on investment in percentage was chosen as a dependent variable. Without a technical analysis both models performed poorly, but when RSI 14, EMA 10 and SMA 10 was added, both models proved significant, while Random Forest proved the superior of them both. Hyperparameter optimization was applied on Random Forest to evaluate if it was possible to prove it even more superior to Linear Regression, but alas, it only gave an improvement in half of the datasets, which made it inconclusive. This thesis adds to the already existing papers of predicting stock prices, but goes into exploring the difference between Random Forest and Linear Regression to see if there are any obvious differences in their ability to estimate the direction of a stock’s price in a near future.
Identifer | oai:union.ndltd.org:UPSALLA1/oai:DiVA.org:umu-197844 |
Date | January 2022 |
Creators | Kastberg, Daniel |
Publisher | Umeå universitet, Institutionen för datavetenskap |
Source Sets | DiVA Archive at Upsalla University |
Language | English |
Detected Language | English |
Type | Student thesis, info:eu-repo/semantics/bachelorThesis, text |
Format | application/pdf |
Rights | info:eu-repo/semantics/openAccess |
Relation | UMNAD ; 1359 |
Page generated in 0.0016 seconds