A Methodology For Stochastic Analysis of Share Prices As Markov Chains With Finite States
A Methodology For Stochastic Analysis of Share Prices As Markov Chains With Finite States
Abstract
Price volatilities make stock investments risky, leaving investors in critical position when uncertain decision is made.
To improve investor evaluation confidence on exchange markets, while not using time series methodology, we
specify equity price change as a stochastic process assumed to possess Markov dependency with respective state
transition probabilities matrices following the identified state pace (i.e. decrease, stable or increase). We established
that identified states communicate, and that the chains are aperiodic and ergodic thus possessing limiting
distributions. We developed a methodology for determining expected mean return time for stock price increases
and also establish criteria for improving investment decision based on highest transition probabilities, lowest mean
return time and highest limiting distributions. We further developed an R algorithm for running the methodology
introduced. The established methodology is applied to selected equities from Ghana Stock Exchange weekly
trading data.
Keywords: Markov process; Transition probability matrix; Limiting distribution; Expected mean return time;
Markov chain
© 2014 Mettle et al.; licensee Springer. This is an Open Access article distributed under the terms of the Creative Commons
Attribution License (http://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction
in any medium, provided the original work is properly credited.
Mettle et al. SpringerPlus 2014, 3:657 Page 2 of 11
http://www.springerplus.com/content/3/1/657
portfolio allocation. Building on existing literature, we equations (2) and (4) are known as the Chapman-
assume that stock price fluctuations exhibit Markov’s Kolmogorov equations for the process.
dependency and time-homogeneity and we specify a three
state Markov process (i.e. price decrease, no change and n-step transition probability matrix and n-step transition
price increase) and advance the methodology for determin- probabilities
ing the mean return time for equity price increases and If P is the transition probability matrix of a Markov chain
their respective limiting distributions using the generated {Xn, n = 0, 1, 2, …} with state space S, then the elements of
state-transition matrices. We further replicate the case for ðn Þ
Pn (P raised to the power n), Pij i; jS are the n-step transi-
a two-state space i.e. decrease in price and increase in tion probabilities where Pij(n) is the probability that the
price. Based on the methodology, we hypothesize that; process will be in state j at the nth step starting from state i.
Equity with the highest state transition probability and The above statement can clearly be shown from the
least mean return time will remain the best choice for Chapman-Kolmogorov equation (4) as follows; for a
an investor. given r and s, write
We explore model performance using weekly historical
ðsþr Þ
X ðr Þ ðSÞ
data from the Ghana Stock Exchange (GSE); we set up Pij ¼ Pik P kj
the respective transition probability matrix for selected k∈s
stocks to test the model efficiency and use.
Set r = 1, s = 1 in the above equation to get
Review of theoretical framework ð2Þ
X
Definition of the Markov process Pij ¼ Pjk Pkj
k∈s
The stochastic process {X (t), tϵT} is said to exhibit
Markov dependence if for a finite (or countable infinite) Clearly, Pij(2) is the (i, j)th element for the matrix prod-
set of points (t0, t1, … , tn, t), t0 < t1 < t2 < … < tn < t where t, uct P × P = P2. Now suppose Pij(r) (r = 3, 4, …, n) is the
trϵT (r = 0, 1, 2, …, n). (i, j)th of Pr then by the Kolmogorov equation, the
PðX ðt Þ ≤ xjX ðt n Þ ¼ xn ; X ðt n−1 Þ ¼ xn−1 ; …; X ðt n Þ ¼ x0 Þ
ðrþ1Þ
X ðr Þ
¼ P½X ðt Þ ≤ xjX ðt n Þ ¼ xn ¼ F ½X n ; x ; t n ; t Pij ¼ Pik Pkj
k∈S
ð1Þ
From the property given by equation (1), the following
relation suffices which again can be seen as the (i, j)th element of the
Z matrix product PrP = Pr+1. Hence by induction, Pij(n) is
F ðX n ; x; t n ; t Þ ¼ F ðy; x; τ; t ÞdF ðX n ; y; t n ; τ Þ ð2Þ the (i, j)th element of Pn n = 2, 3, ….
y∈S To specify the model, the underlying assumption is
stated about the identified n-step transition probability
where tn < τ < t and S is the state space of the process {X (t)}.
(stating without proof ).
When the stochastic process has discrete state and
The transition probability matrix is accessible with
parameter space, (2) takes the following form: for n >
existing state communication. Further, there exists recur-
n1 > n2 > … > nk and n, nrϵT (r = 1, 2, …, k)
rence and transience of states. States are also assumed to
PðX n ¼ jjX n1 ¼ i1 ; X n2 ¼ i2 ; …; X nk ¼ ik Þ ð3Þ be irreducible and belong to one class with the same
period which we take on the value 1. Thus the states are
ðn ;nÞ
¼ P X n ¼ jjX n1 ¼ i1 Þ ¼ Pij k aperiodic.
A stochastic process with discrete state and parameter
Limiting distribution of a Markov chain
spaces which exhibits Markov dependency as in (3) is
If P is the transition probability matrix of an aperiodic,
known as a Markov Process.
irreducible, finite state Markov chain, then
From the Markov property, for nk < r < n we get
2 3
ðn ;nÞ
α
P ij k ¼ PðX n ¼ jjX nk ¼ iÞ 6α7
lim P ¼ π ¼ 6
t
4⋮5
7 ð5Þ
X t→∞
¼ PðX n ¼ jjX r ¼ mÞPðX r ¼ mjX nk ¼ iÞ α
m∈S
X ðn ;r Þ ðr;nÞ Where α = [α1, α2, …, αm] with 0 < αj < 1 and
¼ Pij k P mj
X
m
m∈S
αj ¼ 1. See Bhat (1984). The chain with this property
ð4Þ j¼1
Mettle et al. SpringerPlus 2014, 3:657 Page 3 of 11
http://www.springerplus.com/content/3/1/657
8
is said to be ergodic and has a limiting distribution π. <0 if dt < 0 decrease in equity price from t−1 to t
The transition probability matrix P of such a chain is Xt ¼ 1 if dt ¼ 0 no change in equity price from time t−1 to t
:
primitive. 2 if dt > 0 increase in equity price from time t−1 to t
ðt Þ
ð9Þ
f ij ¼ P½X t ¼ j; X r ≠ j; r ¼ 1; 2; 3; …; t−1jX 0 ¼ i
ð6Þ Then clearly for the outcome of Xt we have
Thus the probability that the chain ever returns to
state j is X
n
ni ¼ I i;t f or i ¼ 0; 1; 2 ð10Þ
t¼1
X
∞
f ij ¼ f ij ðt Þ
t¼1 X
2
where n ¼ ni . Hence estimates of the probability
i¼0
X
∞
ðt Þ that the equity price reduce, did not change and increased
and μij ¼ tf ij is the expected value of first passage
t¼1
can be obtained respectively by
time. Further, if i = j, then;
n0 n1 n2
ðt Þ
P^ 0 ¼ ; P^ 1 ¼ and P^ 2 ¼ ð11Þ
f ii ¼ P½X t ¼ i; X r ≠ i; r ¼ 1; 2; 3; …; t−1jX 0 ¼ i n n n
ð7Þ
X
∞ For the stochastic process Xt obtained above for t =
ðt Þ
and μii ¼ μi ¼ tf ii is the mean recurrence time of 1, 2, …, n we can obtained estimates of the transition
t¼1 probabilities Pij = Pr (Xt = j|Xt−1 = i) for j = 0, 1, 2 by
state i if state i is recurrent. defining
A state i is said to be recurrent (persistent) if and only
if, starting from state i, eventual return to this state is 8
certain. Thus state i is recurrent if and only if >
>
<
ði;jÞ 1 if X t ¼ i and X tþ1 ¼ j
δt ¼ f or t ¼ 1; 2; …; n−1
>
> 0 otherwise
X
∞ :
f ii ¼
ðt Þ
f ii ¼ 1 ð8Þ and i; j ¼ 0; 1; …; k
t¼1
For a two-state Markov process ^ P^ 01
^ ¼ P 00
P
We maintain the above defined terms and set P^ 10 P^ 11
without loss of generality, suppose Xt has state space
0 if dt ≤ 0 no increase in equity price from t−1 to t s = {0, 1} and transition probability matrix
Xt ¼
1 if dt > 0 increase in equity price from time t−1 to t
1−θ θ
P¼ ; 0 < α; β < 1 ð13Þ
β 1−β
further set i, j = 0, 1, (for k = 1) and apply (9), (10), (11),
(12a), and (12b) sequentially, we obtain Then, f00 (1)
= 1 − θ and for n ≥ 2, we have;
Mettle et al. SpringerPlus 2014, 3:657 Page 5 of 11
http://www.springerplus.com/content/3/1/657
Table 1 Summary statistics on the weekly trading price change over the study period
Number of weekly price change Weekly price change summary
Decrease No change Increase Mean SD Max Min Skew. Kurt. Count
ALW 15 77 12 0.00 0.01 0.01 −0.04 −2.30 14.23 104
AYRTN 8 89 7 0.00 0.00 0.01 −0.01 −0.10 4.39 104
BOPP 26 45 33 0.01 0.13 0.44 −0.62 −1.80 11.79 104
CAL 27 40 37 0.00 0.03 0.12 −0.07 1.69 7.26 104
EBG 30 44 30 0.00 0.19 0.50 −1.60 −5.65 51.32 104
EGL 21 46 37 0.01 0.06 0.39 −0.25 1.05 15.79 104
ETI 18 59 27 0.00 0.01 0.04 −0.04 −0.71 5.62 104
FML 22 38 44 0.03 0.12 0.85 −0.19 4.08 25.22 104
GCB 25 37 42 0.02 0.13 0.79 −0.41 1.68 12.51 104
GGBL 5 51 48 0.04 0.10 0.73 −0.20 3.84 22.70 104
GLD 7 79 18 0.04 0.34 3.13 −0.72 7.22 64.43 104
GOIL 16 53 35 0.00 0.03 0.12 −0.23 −2.99 23.63 104
HFC 8 75 21 0.01 0.03 0.27 −0.08 5.76 47.80 104
MLC 7 75 22 0.00 0.01 0.05 −0.03 1.04 5.42 104
PBC 13 81 10 0.00 0.01 0.04 −0.02 1.53 11.02 104
PZC 22 55 27 0.01 0.38 3.02 −1.00 4.78 39.15 104
SCB 38 40 26 0.14 1.30 9.54 −4.19 4.45 30.38 104
SCBPREF 11 87 6 0.00 0.01 0.01 −0.03 −2.35 9.67 104
SIC 19 67 18 0.00 0.02 0.16 −0.06 5.55 50.15 104
SOGEGH 12 89 3 0.00 0.02 0.01 −0.18 −6.56 50.60 104
SWL 9 84 11 0.01 0.45 3.15 −2.00 2.28 27.27 104
TBL 21 62 21 0.02 0.62 2.99 −3.00 0.16 12.33 104
TLW 16 56 32 0.23 0.97 6.56 −1.97 3.77 19.38 104
TOTAL 16 66 22 0.01 0.08 0.52 −0.16 4.89 29.16 104
TRANSOL 12 63 29 0.04 0.18 1.26 −0.50 4.24 24.87 104
UNIL 3 76 25 0.03 0.23 1.79 −0.77 5.23 38.66 104
UTB 12 87 5 0.00 0.01 0.02 −0.02 −1.30 6.18 104
ðt Þ
f 00 ¼ P½X t ¼ 0; X r ≠ 0; r ¼ 1; 2; 3; …; t−1jX 0 ¼ 0 X
∞
ðt Þ
X∞
μ0 ¼ μ00 ¼ tf 00 ¼ 1−θ þ tθβð1−βÞt−2
¼ P½X t ¼ 0; X r ¼ 1; r ¼ 1; 2; 3; …; t−1jX 0 ¼ 0 t¼1
t¼2
θþβ
¼ ð15Þ
β
Figure 1 A plot of mean and standard deviation of weekly price changes of equities. The plot indicates a very volatile weekly market price
fluctuation for any market participating investor. This indicates high level of risk associated with equity purchase decision. We consider that the
rational investor would basically seek to maximize purchasing decisions faced with this risk.
Table 2 Entries of the limiting distribution at for Table 3 Entries of two-state transition matrices for
respective equities selected equities
Equity Limiting distribution Equities P00 P01 P10 P11
α1 α2 α3 1−θ θ β 1−β
ALW 0.141509 0.745283 0.113208 ALW 0.133333 0.866667 0.142857 0.857143
CAL 0.244980 0.406396 0.348625 CAL 0.296296 0.703704 0.227848 0.772152
EBG 0.269568 0.443025 0.287407 EBG 0.433333 0.566667 0.210526 0.789474
ETI 0.168470 0.586912 0.244618 ETI 0.166667 0.833333 0.170455 0.829545
FML 0.198113 0.386792 0.415094 FML 0.380952 0.619048 0.152941 0.847059
Empirical results on model application (three-state time-homogeneity. This shows linear plot of transition
Markov chain) probabilities for P22(t) for each selected stock as com-
For the five randomly selected equities, the transition puted above. It measures the probability that a share
probabilities of the equities are presented as follows. at initial state (i. e. state 2) at inception transited to
These were obtained from equation (12a) defining state 2 again after t weeks. Regarding the plot of the
n
P ij ¼ niji w.r.t. the three-state space Markov process. transition probabilities, the logical reasoning is to
A 3 × 3 transition matrix is obtained for respective equities choose the equity which has the highest P22.
as defined by (12b). From the plot, FML share is the best choice for the
From the results of the algorithm, we select 5 equities investor since the probability that it increases from a
with which we implement the hypothesis. They include; high price to another higher price is higher when
compared to the other selected stocks. ALW recorded
ALW transition probability matrix the least probability of transition within the period.
2 3
0:133333 0:666667 0:200000 Comparing CAL to EBG, the methodology shows that
^ ¼ 4 0:139241 0:759494 0:101266 5
P CAL shares maintain high probability of moving to
0:166667 0:750000 0:083333 higher prices as compared to EBG shares although
the later started with high prices at inception.
CAL transition probability matrix Using equation (5), the limiting distributions of the
2 3
0:296296 0:407407 0:296296 respective equities were computed. These probabilities
P^ ¼ 4 0:261905 0:476190 0:261905 5 measure the proportions of times the equity states within
0:189189 0:324324 0:486486 a particular state in the long run. From Table 2, ALW
equity has 14% chance of reducing and 11% chance of
EBG transition
2 probability matrix 3 increasing in the long run. It however has 75% chance of
0:433333 0:366667 0:200000 no change in price. Similarly, in the long run, FML equity
^ ¼ 4 0:255319 0:553191 0:191489 5
P has 20% chance of reducing, 39% chance of experiencing
0:137931 0:344828 0:517241 no change in price and 42% chance of increasing in price.
It is easily seen that for this instance, FML equity has the
ET I transition
2 probability matrix 3 highest probability of price increase in the long run.
0:166667 0:611111 0:222222
^ ¼ 4 0:131148 0:639344 0:229508 5
P Empirical model application (the two-state Markov process)
0:259259 0:444444 0:296296 Defining a two-state space Markov process following from
equation (13), we derive the state transition probabilities.
FML transition
2 probability matrix 3 The two-state transition probability matrix entries are
0:380952 0:523810 0:095238 indicated in Table 3 below;
P^ ¼ 4 0:170732 0:487805 0:341463 5
0:136364 0:227273 0:636364 Table 4 Expected mean return time for respective stocks
Equity μ00 μ11
Clearly, P^ ij > 0 for all i, j = 0, 1, 2 indicating irreducibility
ðθþβÞ θþβ
β θ
of the chains for all equities. Hence state 0 for all the ALW 1.1555556 7.4285714
equities is aperiodic and since periodicity is a class CAL 1.3837280 3.6060127
property, the chains are aperiodic. These imply that EBG 1.5488889 2.8218623
the chains are ergodic and have limiting distributions. ETI 1.2009132 5.9772727
Figure 2 presents the t − step transition probabilities
FML 1.4497355 3.2235294
for share price increases based on the assumption of
Mettle et al. SpringerPlus 2014, 3:657 Page 10 of 11
http://www.springerplus.com/content/3/1/657
Applying equations (15) and (16) to the transition that the proposed method of using Markov chains as
probabilities, we obtain the respective mean return time a stochastic analysis method in equity price studies
of the selected equities. These are shown in Table 4 below; truly improves equity portfolio decisions with strong
Mean return time is measured in weeks with μij as statistical foundation. In our future work, we shall explore
defined in (15) and (16). The mean return time measures the case of specifying an infinite state space for the
the expected time until the equity price’s next return to Markov chains model in stock investment decision making.
the state it was initially in at time 0. Figure 3 presents a
plot of expected return time of the selected stocks at μ11. Additional files
This determines the expected time until the next increase
in share. We expect that the choice of share should not Additional file 1: Weekly Price Change Data for GSE.
only have the highest transition probability, but should Additional file 2: R algorithm for respective methodologies.
relatively possess a lower mean return time. Possessing
the least mean return time for μ11 signifies the shortest Competing interests
return time to a price increase. The authors declare that they have no competing interests.
creases i.e. Pij transition from state 2 to state 2) that the Received: 19 August 2014 Accepted: 24 October 2014
investor gains good knowledge about the characteris- Published: 6 November 2014
tics of the respective equities hence improving deci-
sion making in the light return maximization. With References
Aguilera MA, Ocaña AF, Valderrama JM (1999) Stochastic modeling for evolution
regards to the selected stocks, FML equity recorded the of stock prices by means of functional principal component analysis, Applied
highest state transition probabilities, highest limiting dis- stochastic models in business and industry. John Wiley & Sons, Ltd., New
tribution but the second lowest mean return time to price York
Ammann M, Verhofen M (2006) The effect of market regimes on style allocation,
increases (i.e. 3.224 weeks). Working paper series in Finance. No. 20., http://www.finance.unisg.ch
Our suggested use of Markov chains as a tool for Bhat UN (1984) Elements of applied stochastic processes, 2nd edn, Wiley series in
improving stock trading decisions indeed aids in improving Probability & Mathematical Statistics
Bulla J, Mergner S, Bulla I, Sesboüé A, Chesneau C (2010) Markov-switching asset
investor knowledge and chances of higher returns given allocation: do profitable strategies exist? Munich Personal RePEc Archive.,
risk minimization through best choice decision. We showed MPRA Paper no. 21154. http://mpra.ub.uni-muenchen.de/21154/
Mettle et al. SpringerPlus 2014, 3:657 Page 11 of 11
http://www.springerplus.com/content/3/1/657
doi:10.1186/2193-1801-3-657
Cite this article as: Mettle et al.: A methodology for stochastic analysis
of share prices as Markov chains with finite states. SpringerPlus
2014 3:657.