(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
Stock Market Prediction Using Regression Techniques
1. TRIBHUVAN UNIVERSITY
INSTITUTE OF ENGINEERING
PASHCHIMANCHAL CAMPUS
A Thesis final Presentation
on
Performance Analysis and Prediction of Stock Market for
Investment Decision using Regression Techniques.
Supervised by: Presented by:
Er. Sharan Thapa Hari K.C.
072/MSCK/403 1
2. Outline
• Introduction
• Problem statement
• Objective
• Literature Review
• Methodology
• Data collection and Tools used
• Result and Discussion
• References
2
3. Introduction
• This thesis focus on study of Stock Market and its performance over
different time period.
• The core of the study is to determine the effective regression
technique to predict the stock price for four different companies.
• These companies are randomly selected from the different sectors
such as Banking sector, Insurance sector, Hydropower and Hotels
• Also, this thesis helps in identifying the investment decision before
investing on different companies.
3
4. Introduction (contd...)
Stock Market
• Share or Stock is an indivisible unit of capital that represent the equal
proportion of a company capital.
• The more a share is transacted, the more it is valuable.
• Stock Market stock values varies based on “Demand and Supply strategy”
• Stock Market is widely used investment scheme promising high returns but it
has risks.
4
5. Problem Statement
• Stock values are changing depending on the market conditions day
by day.
• The challenge is to guide the investors for the right time to buy and
sell the shares.
• There are many regression and classifiers available for the prediction.
• Need for determining the best technique that provide better result in
predicting the stock prices and give accurate trends.
5
6. Objective
• To analyze and predict the stock price for investment decision using
regression techniques
• To compare the accuracy of different Machine Learning regression
techniques.
• To compare the actual and predicted stock price
6
7. Literature Review
7
Date 2012 A.D 2014 A.D 2016 A.D
Research Forecasting of Stock
market of NASDAQ and
S&P 500
Prediction of Bombay
Stock Exchange Market
Returns (BSE)
Prediction of Stock
Market of Karachi
Stock Exchange
Research paper
writer
S. Shen, T. Zheng Y. Perwej and A. Perwej Kamran Raza
Features in Research Uses SVM Uses ANN and GA Used ARIMA and SVR
Parameters used in
Research
Gold and silver rates +
Oil rates+ Historical
stock price
Historical stock price Different oil rates+
gold and silver rates+
historical stock price +
Foreign exchange
9. Methodology
• Preprocessing
• Stock data are incomplete and noisy so, stock data are cleaned and outliers
are removed.
• Interest Rate Correlation is performed to find the relation of Interest rate to
stock closing price.
• Stock Data moving Average and Deviation are also performed to see previous
stock market performance.
• Stock News of different companies are pre-processed to determine the
positive and negative sentiment .
9
10. Methodology
10
Deviation curve of Agricultural Development Bank Ltd
Figure: Deviation Curve of ADBL.
Lots of Fluctuations is seen from 2013 to 2017. During 2016-07 to 2017-01 , the deviation
constantly decreasing which is due to the uniform decrement in Stock Closing Price. In this
time period, right share has been issued to shareholders .
11. Methodology
11
Table: Correlation Coefficient of Agricultural Development Bank Ltd
This table shows the correlation of Stock Price of different Companies with the Interest Rate.
Three Companies Agricultural Development Bank Ltd, Asian Life Insurance , TaraGaon Regency
Hotels have Negative correlation Coefficient . It means during five years time period, they follows
the statement “ Decrease in Interest rate is directly proportional to increase in stock investment.”
But Arun Hydro power do not follow this since it has positive correlation coefficient.
Company Correlation Coefficient with Interest Rate
ADBL -0.609354
ALICL -0.859071
AHPC 0.620511
TRH -0.026552
12. Methodology
12
Sentiment Index of Agricultural Development Bank Ltd
This Pie chart shows that almost 58.8 percent news are positive and sentiment index is
also quite good. This indicate that the investors feel no risk to invest their money in
ADBL with positive response.
Figure: Pie Chart for Agricultural Development Bank Ltd.
13. Methodology
13
Moving Average of Agricultural Development Bank Ltd
This graph shows the change of trend in two major time period (2014 A.D) and
(2016 A.D) . At this time, more share transactions takes place. Trade the share
when 50 MA crosses the 100 MA but exit the trade if next time 50MA again
crosses the 100 MA.
Figure: Moving Average graph for Agricultural Development Bank Ltd.
14. Methodology
• Normalization
• Suitable data and feature is generated using Normalization.
• After preprocessing ,Normalization involves making the interest rate and
stock sentiment data suitable to adjust with stock closing price.
• And finally , feature vector is developed which represent the standard form of
data.
• This feature vector represent the final dataset for prediction.
14
16. Methodology
• Linear Regression
• Supervised Machine Learning Technique.
• A commonly used predictive analysis.
• It gives best predicted output for linear set of data but not for nonlinear data.
Y=m*X +C
• Regression Line fits the data to predict the stock price
• Best fit slope : m=average(X) * average(Y)
C= average(Y) – m * average(X)
16
17. Methodology
• Linear Regression(contd...)
• Linear regression can provide reasonable and fair results after normalization
with no parameter tuning.
• Linear regression is good for an ideal training window.
• It gives good result for relatively short periods.
• It is sensitive to window size changes.
17
18. Methodology
• Polynomial Regression
• Supervised Machine Learning Technique.
• Polynomial is a kernel of Support vector regression to fits data representing curve.
Y = a + ß1*X + ß2* X^2 + ß3* X^3 (degree is set to 3)
• Multiple trials can be performed in polynomial regression.
• Better prediction of subset of testing data but tends to diverged abruptly at
different time periods.
• It is sensitive to window size changes.
18
19. Methodology
• RBF Regression
• Radial Basis Function (RBF) tends to fix the divergent behaviour which is
constantly seen in Polynomial kernel.
• It fits data representing gaussian function.
g(n) = Wt * f(n) , f(n) =exp[- (X(n) – Ck )2 / w]
where W= Width and w = spread
• The RBF kernel performed the best on average for each month that it was
tested on.
• RBF kernel is not sensitive to window size changes.
19
20. Data Collection and Tools Used
20
• Stock datasets from Nepal Stock Exchange(NEPSE).
• Interest Rate data from Nepal Rastra Bank.
• Stock News from ShareSansar and Nepal Stock Exchange(NEPSE)
• Use of Python Programming Language.
21. Result and Discussion (Data fitting)
21Data fitting by RBF regression is best than that of linear and Polynomial regression.
22. Result and Discussion (Comparision)
22
NEPSE stock exchange Karachi stock exchange
Regression/Companies Linear Accuracy RBF Accuracy Polynomial Accuracy RBF Accuracy
1) ADBL 14% 80% 38%
63%
(Data sets of KSE-100 index)
2) ALICL 5% 77% 47%
3) AHPC 21% 85% 67%
4) TRH 14% 80% 78%
In 2016/2017 , Karachi Stock Exchange currently known as Pakistan Stock exchange
accuracy is 63 percent using Radial Basis Function .
23. Result and Discussion (Validation)
23
NEPSE stock exchange S&P 500 (Data set of GOOGLE)
Regression/Companies
Linear Accuracy RBF
Accuracy
Polynomial
Accuracy
Linear RBF Polynomial
1) ADBL 14% 80% 38%
12% 66% 22%
2) ALICL
5% 77% 47%
3) AHPC 21% 85% 67%
4) TRH
14% 80% 78%
28. Result and Discussion( Summary )
28
Public Companies/
Parameter
ADBL ALICL AHPC TRH
1) Stock Sentiment Index 64.70 % 72.72% 78.94% 64.28 %
2)Moving Average 100MA <50MA 100MA <50MA 100MA =50MA 100 <50MA
3) Regression Accuracy 80% 77% 85% 80%
4) InterestRate Correlation -0.609354 -0.859071 0.62051 -0.026552
5)MaximumAverage Prediction Error 2.08% 13.65% 26.17% 11.18%
ADBL has low prediction error than others and its other parameters are quite
good. So, first investment priority is given to ADBL.
30. Conclusion
• It has been concluded that predicting the stock price using RBF
regression gives maximum accuracy and less prediction error than
other regressions .
• RBF kernel is the most consistent for accurate prediction than linear
and polynomial kernel.
• The four companies listed in NEPSE are compared with number of
parameters to set the investment priority for the investors.
• According to experiment conducted , ADBL has the highest
investment priority compared to other companies.
30
31. Future Work
• In future, Optimized RBF technique can also be used that optimize
spread and width parameter to decrease error rate.
• The new kernel function or technique can be designed which gives
better performance with low error rate and high accuracy.
31