Abstract
Stock price prediction is one of the most complex machine learning problems. It depends on a large number of factors which contribute to changes in the supply and demand. In this paper, we propose a stock prediction analysis using machine learning based on support vector machines (SVM), linear regression and reinforcement learning. SVM are favored in applications where text mining is used for market prediction. SVMs can be used for both linearly and non-linearly separable data sets. when the data is linearly separable, SVMs construct a hyperplane on the feature space to distinguish the training tuples in the data such that the margin between the support vectors is maximized. Correlation is used between stock prices of different companies to predict the price of a stock by using technical indicator of highly correlated stocks, not only stock to be predicted.
Introduction
Predicting the stock market is a notoriously difficult task, often characterized as a "wicked" problem due to the chaotic interplay of supply and demand, global news, investor sentiment, and technical indicators. Traditionally, investors have relied on manual technical analysis, which involves labor-intensive review of charts and microblogs. However, the immense volume of data makes human analysis prone to error and fatigue. This study, published in the International Journal of Scientific Research in Computer Science, Engineering and Information Technology, investigates how machine learning can automate pattern recognition in stock prices, thereby providing a more objective, statistical basis for decision-making and risk mitigation.
Methodology
The research explores three primary computational approaches to model and forecast stock market behavior:
Support Vector Machines (SVM)
SVM is a preferred method for market prediction, particularly when integrated with text mining. The algorithm works by identifying an optimal "hyperplane" that separates data classes, such as "price up" versus "price down." By adhering to the "structural risk minimization" principle, SVMs often achieve better generalization on new data compared to traditional neural networks.
Linear Regression
Linear regression is employed to model the relationship between a dependent variable (stock price) and various independent variables, such as time or other market indicators. The mathematical framework follows the standard linear equation $Y = \theta_1 X_1 + \theta_2 X_2 + ...
- \theta_n X_n$, where the model attempts to find the best-fit line through the data points.
Monte Carlo Methods
Rather than aiming for a single deterministic price, Monte Carlo simulations use repeated random sampling to generate thousands of potential future scenarios. This probabilistic approach helps in calculating "Value at Risk" (VaR), allowing investors to understand the range of possible outcomes and quantify uncertainty.
Datasets and Analysis
The study utilizes historical Open, High, Low, Close, and Volume (OHLCV) data for two major technology companies:
- Apple (AAPL): Used for demonstrating data framing and generating summary statistics.
- Google (GOOGL): Used for Monte Carlo simulations to forecast price distributions over a 365-day horizon.
Key Results and Insights
The analysis yielded several critical insights into market behavior and model performance:
- Statistical Summaries: A detailed breakdown of Apple’s stock behavior was conducted. The summary statistics provide a baseline for understanding the volatility and central tendencies of the stock during the study period, with a mean closing price of approximately $139.49.
- Risk Quantification: For the Google dataset, starting at a price of $830.09, the Monte Carlo simulation resulted in a mean final price of $831.26 after 365 days. Crucially, it identified a Value at Risk (VaR) of $17.98 at a 99% confidence interval, providing a concrete metric for potential loss.
- Generalization vs. Overfitting: SVMs were found to outperform Back Propagation Neural Networks (BPN) in financial contexts because their focus on margin maximization helps prevent overfitting to market noise.
Conclusion
While machine learning offers powerful tools for market analysis, limitations remain. SVMs can be computationally expensive on very large datasets and sensitive to noise when target classes overlap significantly. Future work will focus on combining these algorithms with "Boosting" techniques to enhance accuracy and better handle the complexities of real-time trading environments.
Summary updated