A Stochastic Model To Study The Dynamics of Stock Prices in The Nairobi Securities Exchange For Forecasting

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 22

A STOCHASTIC MODEL TO STUDY THE

DYNAMICS OF STOCK PRICES IN THE


NAIROBI SECURITIES EXCHANGE FOR
FORECASTING.

BY: S U P E RV I S O R :
K E V I N G A C H AT H I K I B U G I D R . J O H N AW I N O.
SMPQ /00425/2016
INTRODUCTION
A stock market is a legal establishment surrounding the trade of securities of
companies and organizations.
It has become an essential market playing vital roles in economic prosperity by
fostering capital formation and sustaining economic growth in most economies,
when a stock market is on the rise, the economy is considered to be up and
coming.
Typically, stock market prices are the performance indicators of the entire
market and enables investors to get an idea about the performance of the entire
market
 Research has also been done in other markets where stock prices prediction was
attempted:
 Aghababaeyan et al (2011) undertook study on stock market prediction for
the Tehran Stock Exchange, where they developed a tool that was used for
prediction in the market, achieving an accuracy of 97%.
 Khan et al (2011) conducted a study on the Bangladesh Stock market where
they developed a tool with average error of 3.7% and 1.5% on two
simulations.
 None of these tools were developed commercially or targeted for the
respective stockbrokers.

 Many investors want a guaranteed and precise forecasting method so as to minimize


investment risk, this is a motivating factor for researchers in developing new models.
 Modelling of stock prices is an important topic since the prediction of share price is one
of the most difficult tasks to solve in the finance sector due to the complex characteristic
of the stock market
 Variation in stock prices and other phenomenon involving uncertain events when
modeled as a stochastic process, lead to Stochastic Differential Equations (SDE’s).

 A stochastic process is said to follow a Geometric Brownian Motion (GBM) if it satisfies


a Stochastic Differential equation.

 A Geometric Brownian motion is a continuous-time stochastic process.

 In this project, a stochastic model to simulate a portfolio that consists of three stock
prices in the Nairobi Securities Exchange, in which their historical prices are collected
and used as building blocks in the formation of Stochastic Differential Equations for the
model.
Problem Statement.
Trading in shares is a big business in many economies.
The current methods are somehow subjective and are limited to crunch numbers.
Individual investors who are looking forward to invest in the stock market rely on
experience or fundamental analysis (buy and hold) in picking out stocks.
Improper investments could easily mean great losses to investors, especially if
wrong decisions are repeated.
Therefore, it is important to develop a model to help in minimizing losses and
making any investment decisions.
The stochastic model predicts on whether what investors plan to invest in shall
appreciate in value or not thus the investor after observing the trend over a longer
period of time can invest in the stock that will yield the best returns.
Study Objectives.
 To develop a model that can be used by stockbrokers for forecasting prices of the
selected stocks in the NSE.

 To investigate the financial market prediction for the Kenyan market, by comparison
with actual prices after a short period of time.

 To evaluate the performance of the model in predicting share prices of selected


stocks in the NSE.
Assumptions.

 No external factors such as political, economic or social, whether locally or globally


has a direct effect on trading of shares.

 Trading of stocks is purely based on supply and demand, with willing buyers and
willing sellers.

 No event such as a financial crisis will happen in the foreseeable future which will
affect the stock market negatively.
Significance of the Study.

 The NSE plays a major role in the Kenyan economic growth.


 Investment in the stock exchange enables the movement of funds in the various
sectors of the economy since the listed firms represent the full spectrum of the
nation’s economy.
 By introducing a stochastic model, this adds up to the rest of the technical and
fundamental analysis already used and therefore, increasing the chances of
mitigating risk when investing stocks.
 Thus provides a link between complex computational applied mathematics from
theoretical considerations and its implementation on a practical industrial problem.
Justification of the Study.

 The purpose of this study is to come up with better ways of investing stocks which
involve analysis in order to mitigate risk.

 With many stockbrokers and individual investors in Kenya, using none-predictive


methods, this model can be used in studying and analysis of the stock prices and
giving an insight on investing wisely.
LITURATURE REVIEW.
 
The first quantitative work on Brownian motion was introduced in 1900 by the
French Mathematician Bachelier who used it in his dissertation to model the price
movements of stocks and commodities.
At the beginning of the twentieth century, Louis Bachelier in Paris and Filip
Lundberg in Uppsala (Sweden) developed sophisticated mathematical tools to
describe uncertain price and risk processes.
Since then, observations of prices of stocks, has been modeled as a stochastic
process.
Brownian motion was discovered by the biologist Robert Brown in 1827 (Feynman,
1964). The motion was fully captured by mathematician Norbert Wiener.
Brownian motion is often used to explain the movement of time series variables.

The Geometric Brownian Motion (GBM) model incorporates the idea of random
walks in stock prices through its uncertain component, along with the idea that stocks
maintain price trends over time as the certain component (Reddy et al, 2016).
METHODOLOGY.
In order to develop a stochastic model that captures the changes in the prices
of stocks, this approach involves:
 This involves studying the dynamics of a system of interest for a short time
interval ∆t .
 In which the information obtained from the short time study of the
dynamics of the system is used to formulate the mathematical model of
the system.
 Consider three selected stocks S1, S2 and S3 subjected to random changes by
market forces.
 We assume that in a small interval of time ∆t, a stock price may change by
losing one unit (-1), remaining stable (0) or gaining one unit (+1).
  Thereare possibilities by which the stocks may vary in the small time interval.
 These possibilities are indicated in table 3.1.

 Using the representations of Pi , we can derive the coefficients of our stochastic


differential equations which is the drift (expectation) and volatility (standard
deviation).

 The expectation vector is derived as follows:


  Find the standard deviation, we derive the covariance matrix as follows:

 Therefore, we obtain the SDE; dS(t)=μ(t, S1,S2,S3)dt + σ(t, S1,S2,S3)dW(t)

 Where; μ(t, S1,S2,S3) is the expectation vector and σ(t, S1,S2,S3) is the standard
deviation.
 Stock prices are published daily.
 The daily stock prices of three selected stocks namely KCB, SCOM and KQ were
observed for 30 days in the month of September and October 2019 (Table 3.2).
 The stock prices were used to characterize the drift and volatility which will form the
coefficients of the stochastic differential equations.
  From table 3.2 above, instances of loss, gain or unchanged are noted as shown in the
table 3.3
 The column named summary shows how the stock prices of each price vary relating
to the day before.
 From the table above, the probability of each event was determined by:
Pi =
 Table 3.4 shows patterns of change and their probabilities as calculated by formula
above.
 From table 3.4 above, the relevant variables of the drift and volatility are computed.
 Thus we obtain the SDE;
dS(t)=μ(t, S1,S2,S3)dt + σ(t, S1,S2,S3)dW(t)
dS(t)=
 This is an initial value problem.
RESULTS AND DISCUSSION.
Results.
The SDE obtained was solved using the multi-dimensional Euler-Maruyama
scheme for SDE’s and was achieved through a MATLAB script file.

The following graphs represent simulations on the three stocks shown from the
MATLAB script files.
Fig 4.1:
Fig 4.2:
Fig 4.3:
Discussions.

 Figure 4.1 shows fluctuations of stock 1(KCB) prices over the period of time. There is a
significant decrease in value of the stock at the middle of the time according to the
simulation which goes below the initial asset’s price. However, by the end of the year
the stock price increase significantly
 Figure 4.2 shows the changes of stock 2(SCOM) prices over a year period. The stock
prices rise high before the middle of the year and drop down significantly to almost
its initial price by mid-year. The stock however increases in prices significantly by the
end of the year
 Figure 4.3 shows stock 3 (KQ) prices fluctuations. The prices of this stock are not a
good investment as they reduce with respect to time. They only rise for a short
period of time which is insignificant in investment.
SUMMARY AND CONCLUSION
SUMMARY
A stochastic model is developed for the dynamics of change in prices of selected stocks.
Considering the three stocks subjected to random influence by the market forces, the
assumption is that in a small time interval ∆t, a stock price may change by losing one unit (-1),
remaining stable (0) or gaining one unit (+1).
Checking the probabilities of the gains and losses, the expectation vector and the covariance
matrix are derived, resulting in a Stochastic Differential Equation.
 Due to the difficulty in solving most non-linear Stochastic Differential Equations (SDE’s)
analytically, the Euler Maruyama Method for SDEs is used to solve and analyze the model with
the aid of MATLAB software.
CONCLUSION.
 Investors willing to invest in either the three stocks should only invest in stock 1 and
stock 2 according to the simulations of the Stochastic Differential Equations.

 The investor after observing the trend over longer period can invest in the stock
that will yield the best returns.

 This analysis enables analysts to compare as many stocks as possible in order to


advise the investor on where best to make investment with respect to the
randomness of the SDE’s simulation.

You might also like