Stock Price Prediction Using Geometric Brownian Mo
Stock Price Prediction Using Geometric Brownian Mo
E-mail: [email protected]
Abstract. Geometric Brownian motion is a mathematical model for predicting the future price
of stock. The phase that done before stock price prediction is determine stock expected price
formulation and determine the confidence level of 95%. On stock price prediction using
geometric Brownian Motion model, the algorithm starts from calculating the value of return,
followed by estimating value of volatility and drift, obtain the stock price forecast, calculating
the forecast MAPE, calculating the stock expected price and calculating the confidence level of
95%. Based on the research, the output analysis shows that geometric Brownian motion model
is the prediction technique with high rate of accuracy. It is proven with forecast MAPE value ≤
20%.
1. Introduction
Capital market are markets for various long term financial instruments that can be traded. Capital
markets are vital for fuction of country economy since capital markets generate two functions, first as
decision variable for investor or as a facility for companies to get funding from investors, second as
capital markets become facility for society to invest on financial instruments and one of them is stock
[1].
Stock price index is indicator for stock price movement. The index is one of the references for
investor to invest in capital markets, especially stock. One of the stock price indexes in Indonesia
Stock Exchange (IDX) is Indeks Harga Saham Gabungan (IHSG) or Jakarta Composite Index. To be
able to describe reasonable market condition, IHSG use all companies registered as index calculation
components [2].
Stock is one of the popular instruments in financial market. It is because stock able to give high
rate of profit return which interest the investors. However, stock trading has high rate of risk. The
fluctuation of stock price affect the investor’s decision on investing their capital. Mistake in decision
making will result loss for investor. Thus, to minimize the high risk investor needs information as a
reference for decision making of which stock they should buy, sell, and maintain[3].
There are 2 factors that has significant influence in stock price modelling, which previous state of
stock that influence the current stock price and stock response towards latest information of stock [4].
Based on those factors, it can be concluded that the change of stock price follows the Markov chain.
The Markov chain process is a stochastic process which make current price has influence to forecast
the future stock price.
Forecasting is the best method to predict the future of stock price [5]. However, the rate of loss risk
using this method is relatively still high due to the innacurate forecast output. The forecasting method
used for forecast the fututre stock closing price for short term investment with low rate of. One of the
model that can be used for forecasting stock price is geometric Brownian motion model or as known
Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution
of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
Published under licence by IOP Publishing Ltd 1
International Conference on Mathematics: Pure, Applied and Computation IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 974 (2018)
1234567890 ‘’“”012047 doi:10.1088/1742-6596/974/1/012047
as Wiener process. Geometric Brownian motion model is stochastic model with continous time, where
the random variable follows the Brownian motion [5].
On the previous research the concept of geometric Brownian motion has been descibed by Dmouj
[4]. Based on [4] it is described the concept of random walk, Brownian motion and analytical solution
of model geometric Brownian motion model. In review [4] stated that the forecast of stock close price
is develop using confident level and mean function of lognormal distribution. Other research that
implement geometric Brownian motion model is research conducted by Omar dan Jaffar [5]. Their
research forecasted the stock close price for several small companies registered in Malaysia stock
exchange. The forecast is limited to short term investment. In their research it is proven that geometric
Brownian motion model is accurate in forecasting the stock close price for two weeks period. It is
proven by the small value of Mean Absolute Percetage Error (MAPE).
Based on that background, this research forecast the stock price of Jakarta Composite Index using
the geometric Brownian motion. With utilizing the daily stock close price during January 2014 to
December 2014 to forecast the stock price of January 2015. The stages for forecasting the stock price
are calculating return value, Estimating the parameter, result collection of stock price forecast, then
calculating the MAPE value. In this research 4 forecasts are obtained using geometric Brownian
motion. Based on analysis and discussion, the MAPE value ≤20%.
2. Research Methodology
The methodology in conducting this research as follows:
2.1. Data Collection
At this stage stock price data collection is conducted by using the source of yahoo finance. The stock
data that is used are several stock prices under the Jakarta Composite Index, which are: Charoen
Pokphand Indonesia Tbk, Harum Energy Tbk, Media Nusantara Citra Tbk, PP London Sumatra
Indonesia Tbk, Vale Indonesia Tbk, Indo Tambangraya Megah Tbk, Indocement Tunggal Prakasa
Tbk. The stock price data that is used are daily stock close price during January 2014 to December
2014. Then the normality test is conducted on the stock close price data using SPSS software with
Kolmogorov-Smirnov test.
2.2. Literature Study
At this stage, reference theories are collected for supporting fundamental, that is regarding the stock
price, random walk, Brownian motion, proses stokastik, lemma Ito and geometric Brownian motion.
2.3. Stock Price Forecasting
At this stage the expected stock price formulation is conducted, the formulation of 95% confidence
level and stock price forecasting using geometric Brownian motion. In forecasting the stock price the
common formula of volality and log volatility is used.
To obtain expected stock price with 95% confidence level, stages conducted as follow:
a. Determine pdf lognormal.
b. Determine the lognormal distribution mean function.
c. Determine new stock price model.
d. Determine 95% confidence level.
After the new stock price model is obtained then stock close price forecast is conducted on seven
stock. The stages in stock price forecasting as follow:
a. Normality test.
b. Calculate stock return.
c. Estimation of drift value (µ) and volatility (𝜎).
d. Forecast of stock price.
e. Calculate MAPE value.
f. Calculate 95% confidence level.
2.4. Conclusion
At this stage obtaining conclusion from analysis and discussion is done.
2.5. Simulation and Report Writing
2
International Conference on Mathematics: Pure, Applied and Computation IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 974 (2018)
1234567890 ‘’“”012047 doi:10.1088/1742-6596/974/1/012047
At this stage simulation from the research is done and report writing follows after the simulation.
2.6. A subsection
Some text.
Using the pdf from variable v pdf from variable 𝑞 is obtained. Based on one – one randomize
variable theorem, result variable 𝑞 pdf is obtained from the following equation [4]:
𝑓(𝑣)𝑑𝑣
ℎ(𝑞) = . (2)
𝑑𝑞
With substitution 𝑣 = 𝑙𝑛(𝑞),obtain
𝑑𝑣 = 𝑑(ln 𝑞),
1
= 𝑑𝑞.
𝑞
1
The with substitution of 𝑑𝑣 = 𝑑𝑞 to equation (2), obtain
𝑞
𝑓(𝑣) 𝑑𝑣
ℎ(𝑞) = , (3)
𝑑𝑞
2
1 ln 𝑞−µ
1 �−2� 𝜎 � � 1
𝑒 𝑑𝑞
𝜎√2𝜋 𝑞
= ,
𝑑𝑞
Thius pdf lognormal from variable 𝑞 as follow [4]:
1 ln 𝑞−µ 2
1 �− � � �
ℎ(𝑞) = 𝑒 2 𝜎 , (4)
𝑞𝜎√2𝜋
where:
µ ∶ mean distribution of variable 𝑞 lognormal
𝜎 2 ∶ variance of lognormal sitribution of variable 𝑞.
3.2. Lognormal mean distribution
Using the lognormal distribution pdf which obtained from equation (4) then finding the mean of
lognormal distribution is conductedsela. Lognormal distribution meand from variable Mean 𝑞 is
defined as [4]:
+∞
𝐸(𝑞) = ∫−∞ 𝑞ℎ(𝑞)𝑑𝑞 . (5)
1 ln 𝑞−µ 2
+∞ 1 �− � � �
= ∫−∞ 𝑒 2 𝜎 𝑑𝑞. (6)
𝜎√2𝜋
1
Suppose if 𝑦 = ln 𝑞 − µ then dy = dq. Integral ln 𝑞 = −∞ become 𝑦 = −∞ and ln 𝑞 = +∞
𝑞
become 𝑦 = +∞. Thus 𝐸(𝑞)can be written as:
𝑦2
+∞ 1 −
𝐸(𝑒 𝑦+µ ) = ∫−∞ 𝑒 𝑦+µ 𝑒 2𝜎2 𝑑𝑦, (7)
𝜎 √2𝜋
𝜎2 −(𝑦−𝜎2 )2
+∞ 1
= 𝑒 µ𝑒 2 ∫−∞ 𝑒 2𝜎2 𝑑𝑦. (8)
𝜎 √2𝜋
3
International Conference on Mathematics: Pure, Applied and Computation IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 974 (2018)
1234567890 ‘’“”012047 doi:10.1088/1742-6596/974/1/012047
𝑦−𝜎 2 1
Next, Suppose if 𝑧 = then 𝑑𝑧 = 𝑑𝑦. Integral 𝑦 = −∞ become 𝑧 = −∞ and 𝑦 = +∞ become
𝜎 𝜎
𝑦+µ
𝑧 = +∞. Thus 𝐸(𝑒 ) can be written as:
𝜎2 –𝑧2
2 +µ +∞ 1
𝐸�𝑒 𝑧𝜎+𝜎 � = 𝑒 µ+ 2 ∫−∞ 2𝜋 𝑒 2 𝑑𝑧. (9)
√
Integral on equation (9) is pdf from standard normal distribution and has value of 1, Thus mean
fuction of variable 𝑞 lognormal distribution is
𝜎2
𝐸(𝑞) = 𝑒 µ+ 2 , (10)
where:
µ ∶ mean distribution of variable 𝑞 lognormal
2
𝜎 ∶ variance of lognormal sitribution of variable 𝑞.
4
International Conference on Mathematics: Pure, Applied and Computation IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 974 (2018)
1234567890 ‘’“”012047 doi:10.1088/1742-6596/974/1/012047
Thus obtain:
𝑉𝑎𝑟(𝐵𝑡 ) = 𝐸[(µ𝑡 + 𝜎𝑊𝑡 )2 ] − [𝐸(µ𝑡 + 𝜎𝑊𝑡 )]2 ,
= (µ𝑡)2 + 𝜎 2 𝑡 − (µ𝑡)2 , (19)
= 𝜎 2 𝑡.
Based on the verification above, Brownian motion with drift is normal distributed equation with
𝜎2
mean µ𝑡 and variance 𝜎 2 𝑡 thus 𝑙𝑛 𝑆𝑡 normally distributed with mean 𝑙𝑛 𝑆𝑡−1 + �𝜇 − 2
�𝑡 and
variance 𝜎 2 𝑡 [4]. Thus expected 𝐸(𝑆𝑡 ) future stock price when 𝑡 is
𝜎2
ln 𝑆0 +�𝜇− �𝑡+𝜎 2 𝑡
𝐸(𝑆𝑡 ) = 𝑒 2 ,
𝜎2
�𝜇− �𝑡+𝜎 2 𝑡
= 𝑒 ln 𝑆0 𝑒 2 ,
𝜎2
��𝜇+ 2 �𝑡�
= 𝑆0 𝑒 (20)
where:
𝑆0 ∶ Actual beginning stock price
𝜇 ∶ drift of stock price
𝜎 ∶ volatility of stock price.
3.4. Confidence Level
For testing the forecast accuracy of geometric Brownian motion then 95% confidence level is
implemented. Based on the following equation:
1
ln 𝑆𝑡 = ln 𝑆0 + �µ − 𝜎 2 � 𝑡 + 𝜎𝐵𝑡 . (21)
2
With 𝑆𝑡 is actial stock price when 𝑡, µ and 𝜎 are estimated parameter from big sample from
population. Thus with 95% confidence level shows the actual stock price in 95% confidence level.
𝜎2
By using the parameter of mean 𝑙𝑛 𝑆0 + �𝜇 − � 𝑡 and variance of 𝜎 2 𝑡 which obtained form
2
previous discussion of expected stock price sub chapter, so that 95% confidence level and variable
𝑙𝑛 𝑆𝑡 as follow:
𝜎2 𝜎2
ln 𝑆0 + �𝜇 − � 𝑡 − 1,96𝜎√𝑡 ≤ 𝑙𝑛 𝑆𝑡 ≤ ln 𝑆0 + �𝜇 − � + 1,96𝜎√𝑡,
2 2
𝜎2 𝜎2
ln 𝑆0 +�𝜇− �𝑡−1,96𝜎√𝑡 ln 𝑆0 +�𝜇− �+1,96𝜎√𝑡
𝑒 2 ≤ 𝑆𝑡 ≤ 𝑒 , 2 (22)
where:
𝑆0 ∶ beginning stock price
𝑆𝑡 ∶ stock price when 𝑡
𝜇 ∶ stock price drift
𝜎 ∶ Stock price volatility
3.5. Normality test
At this stage, normality test of stock price data during January 1st 2014 to December 31st 2014 period
is conducted. Normality test is conducted to find whether the stock data is normally distributed or not.
Based on Kolmogorov – Smirnov normality test, shown 𝑝 ≥ 0,05, so it can be concluded that the
stock price is normally distributed and feasible to do stock price forecast on the data.
3.6. Stock price forecasting
At this stage stock price is forecasted on several registered companies, they are stock of Charoen
Pokphand Indonesia Tbk, Harum Energy Tbk, Media Nusantara Citra Tbk, PP London Sumatra
Indonesia Tbk, Vale Indonesia Tbk, Indo Tambangraya Megah Tbk and Indocement Tunggal Prakasa
Tbk. Data used to estimate the is daily stock close price during January 1st 2014 to December 31st
2014 period [6], whereas forecasting is done for January 1st 2015 period.
5
International Conference on Mathematics: Pure, Applied and Computation IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 974 (2018)
1234567890 ‘’“”012047 doi:10.1088/1742-6596/974/1/012047
6
International Conference on Mathematics: Pure, Applied and Computation IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 974 (2018)
1234567890 ‘’“”012047 doi:10.1088/1742-6596/974/1/012047
1
𝜎1 = � ∑𝑀 (𝑅 − 𝑅� )2 , (25)
(𝑀−1)𝛿𝑡 𝑡=1 𝑡
1
𝜎2 = �(𝑁−1)𝛿𝑡 ∑𝑁 2
𝑡=2(log 𝑆𝑡 − log 𝑆𝑡−1 ) , (26)
where:
𝜎1 ∶ volatility
𝜎2 ∶ log volatility
𝑅� ∶ mean of stock return
𝑀 ∶ amount of stock return data
𝑁 ∶ amount of stock data.
where:
𝐹𝑡 ∶ stock price forecast when 𝑡
𝑆𝑡−1 ∶ actual stock price when 𝑡 − 1
𝜇 ∶ drift
𝜎 ∶ volatility, where 𝜎 = 𝜎1 or 𝜎 = 𝜎2
𝐵𝑡 ∶ 𝜀 √𝑡
Where on forecast 3 and forecast 4 geometric Brownian motion model with common volatility
equation and log volatility, however to forecast stock price when 𝑡 use the beginning value which
taken from forecast 𝑡 − 1. Equation used for forecast 3 and forecast 4 as follow:
1
�µ− 𝜎 2 �𝑡+𝜎𝐵𝑡
𝐹𝑡 = 𝐹𝑡−1 + 𝑒 2 , (28)
with 𝐹0 is actual stock price.
On figure 2 and figure 3 show the graph of stock price forecast of Media Nusantara Citra Tbk using
geometric Brownian motion.
7
International Conference on Mathematics: Pure, Applied and Computation IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 974 (2018)
1234567890 ‘’“”012047 doi:10.1088/1742-6596/974/1/012047
Figure 2. Forecast graph based on beginning value which taken from previous actual stock price
Figure 3. Forecast graph based on beginning value which taken ftom previous forecast
On table 1 shown the MAPE value of forecasts.
Table 1. Forecast MAPE
MAPE value of each forecast
Stock Forecast Forecast Forecast Forecast
1 2 3 4
Charoen Pokphand
Indonesia 2,0935% 1,1675% 2,9320% 1,6933%
Indocement Tunggal
2,5349% 1,9187% 4,1217% 4,8249%
Prakasa
8
International Conference on Mathematics: Pure, Applied and Computation IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 974 (2018)
1234567890 ‘’“”012047 doi:10.1088/1742-6596/974/1/012047
9
International Conference on Mathematics: Pure, Applied and Computation IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 974 (2018)
1234567890 ‘’“”012047 doi:10.1088/1742-6596/974/1/012047
On table 2 and table 3 shown the confidence levelof 95% from seven stock price data.
10
International Conference on Mathematics: Pure, Applied and Computation IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 974 (2018)
1234567890 ‘’“”012047 doi:10.1088/1742-6596/974/1/012047
Based on table 2 and table 3, 95% confidence level using log volatility equation tends to have
narrow interval compared to 95% confidence level using common volatility equation. Thus on the
simulation there is several actual stock price located outside trajectory realization that may be from
geometric Brownian motion.
4. Conclusions
Based on the analysis and discussion, it can be concluded that short term forecasting which are
forecast 1 and forecast 2 have MAPE value of ≤ 𝟐𝟎%. Whereas long term forecast which are forecast
3 and forecast 4 are dissatisfactory because actual stock price located outside green line or outside the
area of forecast value.
References
[1] “http://www.idx.co.id/id/id-id/beranda/informasi/bagiinvestor/pengan tarpasarmodal.aspx”
accessed on 6 February 2015.
[2] “http://www.idx.co.id/id/id-id/beranda/informasi/bagiinvestor/indeks. aspx” accessed on 6
February 2015.
[3] “http://www.idx.co.id/id/id-id/beranda/informasi/bagiinvestor/saham. aspx” accessed on 6
February 2015.
[4] Dmouj, A. 2006. “Stock price modelling:Theory and Practice”. Vrije Universiteit Faculty of
sciences Amsterdam, The Netherlands.
[5] Omar, A., Jaffar, M.M., 2014. “Forecasting Share Price of Small Size Companies in Bursa
Malaysia Using Geometric Brownian Motion”. An Journal International, Applied Mathematics &
Information Sciences 8, No, 1:107-112. Faculty of Computer and Mathematical Sciences,
Universiti Teknologi MARA, 40450 Selangor, Malaysia.
[6] “finance.yahoo.com” accessed on 12 January 2015.
[7] Willmot, P., 2007. “Introduces Quabtitative Finance”. 2nd Edition, John Wiley & Son, Ltd,
Chichester.
[8] Lawrence, K. D., Klimberg R. K., & Lawrence S. M. 2009. “Fundamentals of forecasting using
excel”. Industrial Press Inc, America.
11