Source-linked AI summary

A Machine Learning Model for Stock Market Prediction

Osman Hegazy, Omar S. Soliman, Mustafa Abdul Salam

arXiv:1402.7351v1cs.CEcs.NE

TL;DR

Stock prediction is difficult because stock time series behave close to randomly, while LS-SVM requires careful selection of free parameters. The paper combines PSO with LS-SVM for daily stock-price prediction using historical data and technical indicators, and reports better performance than LS-SVM and ANN-LM benchmarks across tested sectors, especially in fluctuating series.

  • Problem

    Stock prediction is difficult because stock time series exhibit close to random-walk behavior, and LS-SVM performance depends on selecting its free parameters.

  • Method

    The paper uses PSO to optimize LS-SVM for daily stock-price prediction from historical data and technical indicators, with six input vectors and one next-price output.

  • Results

    LS-SVM optimized with PSO performs better than LS-SVM and ANN trained with LM across tested trends and sectors, especially for fluctuating time series.

  • Takeaways & Limitations

    The reported results support using PSO to optimize LS-SVM parameters for stock-price prediction across multiple market sectors.

Abstract

from arXiv · show

Stock market prediction is the act of trying to determine the future value of a company stock or other financial instrument traded on a financial exchange.

ISSN 2047-3338

The paper is authored by Osman Hegazy, Omar S. Soliman, and Mustafa Abdul Salam and focuses on stock prediction using LS-SVM, PSO, technical indicators, and related methods.

  • The paper lists Osman Hegazy, Omar S. Soliman, and Mustafa Abdul Salam as authors.
  • Its index terms include LS-SVM, PSO, technical indicators, and stock price prediction.

I. INTRODUCTION

Stock prediction is difficult because stock time series behave close to randomly, while neural networks can overfit. The paper therefore combines PSO with LS-SVM to optimize its free parameters.

  • Motivation: Stock prediction is challenging because stock time series exhibit close to random-walk behavior.
  • Motivation: Artificial neural networks can suffer from overfitting because they have many parameters and limited prior knowledge about input relevance.
  • Motivation: SVMs provide an alternative with theoretical foundations and globally optimal solutions rather than the local minima associated with ANNs.
  • Motivation: LS-SVM requires a methodology for selecting regularization and kernel parameters so its regression remains robust to noisy conditions without prior user knowledge.
  • Proposed approach: The proposed model uses PSO to find the best combination of LS-SVM parameters C, ϵ, and γ.

II. LEAST SQUARE SUPPORT VECTOR MACHINE

LS-SVM reformulates SVM regression with least-squares costs and equality constraints, solving a linear system instead of the quadratic programming problem used by classical SVMs.

  • LS-SVM formulation: LS-SVM analyzes patterns for classification and regression by solving linear equations instead of a classical SVM convex quadratic programming problem.
  • LS-SVM formulation: The LS-SVM goal is to construct a function f(x) representing the dependence of output y_i on input x_i.
  • LS-SVM formulation: The model represents f(x) as W^Tφ(x)+b, where W and φ(x) are vectors and b is a real-valued bias term.
  • Optimization: Unlike conventional SVM, LS-SVM uses equality constraints and a least-squares cost function, producing a linear optimization problem.
  • Kernel functions: The paper lists linear, polynomial, radial basis function, and MLP kernels, and uses the MLP kernel in this work.

III. PARTICLE SWARM OPTIMIZATION ALGORITHM

PSO is a heuristic search method inspired by social groups that updates particles using individual and swarm experience. It repeats velocity and position updates until a satisfactory solution is found.

  • PSO concept: PSO is a heuristic search method derived from the behavior of bird flocks and fish swarms.
  • PSO concept: Each particle uses memory of its previous successes and information about social-group successes to guide movement through the search space.
  • Particle updates: Particle velocities are updated using inertia, each particle’s best variable vector, and the swarm’s best vector, with random factors.
  • Particle updates: After velocity updates, each particle’s variable vector is modified, and evaluation, velocity, and position updates are repeated.
  • Algorithm presentation: The PSO algorithm is presented in Figure 1.

IV. THE PROPOSED MODEL

The proposed model predicts next-day stock prices from historical data and five technical indicators, using LS-SVM optimized with PSO and benchmarking against LM and LS-SVM. It uses six input vectors and evaluates companies spanning S&P 500 sectors.

  • Model architecture: The model uses six input vectors containing historical data and derived technical indicators to predict the next stock price.Its proposed architecture has one output representing the next price.
  • Prediction approach: LS-SVM optimized with PSO is used for daily stock-price prediction, with Levenberg-Marquardt and LS-SVM serving as comparison models.The approach combines historical data, technical indicators, and optimization of LS-SVM.
  • Evaluation scope: The algorithm was tested on companies spanning Information Technology, Financials, Health Care, Energy, Communications, Materials, and Industrials in the S&P 500.Examples include Adobe, American Express, Life Technologies, Exxon-Mobile, AT&T, FMC Corporation, and Honey Well.
  • Technical indicators: Five technical indicators are calculated from the raw datasets, including RSI and MFI.RSI compares recent gains with losses to indicate overbought and oversold conditions, while MFI measures money strength flowing into and out of a security.
  • Technical indicators: EMA returns an exponentially weighted moving average, using today’s close and yesterday’s close in the stated formulation.The passage defines T as today’s close and Y as yesterday’s close.
  • Technical indicators: The stochastic oscillator measures the current close relative to the period’s lowest and highest prices, while MACD compares short- and long-term moving averages.The supplied formulas express %K for the stochastic oscillator and MACD using EMAs of closing prices.

V. RESULTS AND DISCUSSION

Across companies and sectors, the proposed PSO-optimized LS-SVM generally produced the lowest errors and closest predictions to actual stock prices, outperforming LS-SVM and ANN-based alternatives. The advantage was especially evident for fluctuating time series.

  • Experimental setup: 70% training and 30% testing splits were used for datasets spanning January 2009 to January 2012.LS-SVM-PSO, LS-SVM, and ANN algorithms were trained and tested on these datasets.
  • Sector results: In information technology and financial companies, LS-SVM-PSO achieved the lowest error or closest predicted curve, followed by LS-SVM, while ANN-BP performed worst in the financial cases.The comparison covered Adobe, Oracle, HP, American Express, and Bank of New York.
  • Sector results: The proposed model achieved the best performance for Honeywell and improved error rates for Hospera and Life Technologies.These results cover industrials and health-sector companies.
  • Sector results: PSO-LS-SVM remained best for Exxon-Mobile and Duke Energy, particularly in cases involving fluctuations.These companies represent the energy sector.
  • Sector results: The proposed model showed promising results for FMC Corporation and reduced error rates for AT&T while overcoming local minima observed in ANN results.These findings cover materials and communications companies.
  • MSE comparison: Mean Square Error comparisons showed LS-SVM optimized with PSO advancing over LS-SVM and ANN trained with LM across performance functions, trends, and sectors.The advantage was especially pronounced for time series with fluctuations.

VI. CONCLUSIONS

The paper integrates PSO with LS-SVM for stock-price prediction and reports that the optimized model reaches the global minimum while improving performance over LS-SVM and compared algorithms.

  • PSO iteratively optimizes LS-SVM for stock-price prediction using financial technical indicators.The indicators include relative strength index, money flow index, exponential moving average, stochastic oscillator, and moving average convergence/divergence.
  • The proposed model is reported to converge to the global minimum and overcome ANN over-fitting, especially during stock-sector fluctuations.
  • LS-SVM-PSO achieves the lowest error value, followed by single LS-SVM, while ANN-BP performs worst among the compared algorithms.
Loading 1402.7351v1…