The Time Is Now
The Time Is Now
Jedidiah Waweru
and
Felix Kimanthi
Bachelor of Science
in
Actuarial Science
2024
Declaration by the Students
“We, Jedidiah Waweru and Felix Kimanthi, declare that this research project entitled, ‘Predicting
Stock Returns using Arbitrage Pricing Theory Model’ submitted in partial fulfilment of the degree
of Bachelor of Science in Actuarial Science, is a record of original work carried out by us under the
guidance of Dr. Antony Ngunyi, and has not formed a basis for the award of any other degree or
diploma, in this or any other Institution or University. In line with the ethical practice in reporting
scientific information, due acknowledgements have been made wherever the findings of others have
been cited.”
Signature Signature
Date Date
i
Declaration by the Supervisor
This is to certify that the research project entitled ‘Predicting Stock Returns using Arbitrage Pricing
Theory Model’ submitted by Jedidiah Waweru and Felix Kimanthi to the Dedan Kimathi University
of Technology, in partial fulfilment for the award of the degree of Bachelor of Science in Actuarial
Science, is a bona-fide record of research work carried out by them under my supervision. The con-
tents of this project, in full or in parts, have not been submitted to any other Institution or University
for the award of any degree.
Signature Signature
Date Date
ii
Acknowledgement
First we would like to thank God for giving us good health and guidance throughout the period w
were working on this project. Sincere thanks to Dedan Kimathi University of Technology for the
opportunity and also to all academic and non-academic staff. Many individuals have made this project
feasible including my supervisor Dr. Antony Ngunyi, Dr. Cyprian Omari and the project coordinator
Dr. Maina Mundia, without their input this project would not have been a success, my sincere regards.
Lastly, we want to acknowledge our family and friends for their encouragement moral and intellectual
contributions towards the success of this project. You have been a source of strength and inspiration
that has seen us come this far.
iii
Dedication
Dedicated to our families and friends for the support they offered throughout the project.
iv
Contents
Declaration by the Students i
Acknowledgement iii
Dedication iv
Table of Contents v
Abbreviations viii
Symbols ix
Abstract x
1 Introduction 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Background of the study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Statement of the Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Justification of the Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 Objectives of the Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5.1 General objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5.2 Specific objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.6 Significance of the Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Literature Review 7
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Empirical Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 Methodology 11
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Arbitrage Pricing Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.1 Model Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3 Parameter Estimation of the Arbitrage Pricing Theory Model . . . . . . . . . . . . . 13
3.4 Adequacy of the model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4.1 Test for Normality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4.2 Durbin-Watson test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.4.3 F test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.4.4 T -test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5 Predicting The Stock Returns using the model . . . . . . . . . . . . . . . . . . . . . 17
3.6 Accuracy of predicted returns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.6.1 Root Mean Squared Error . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.6.2 Mean Absolute Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
v
Contents vi
References 35
A Appendix 37
A.1 R Program Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
List of Tables
4.1 Descriptive statistics for monthly stocks returns starting from January 1, 2013 to De-
cember 31, 2023 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.2 Coefficient Estimates for EQTY APT model . . . . . . . . . . . . . . . . . . . . . . 21
4.3 Coefficient Estimates for KCB APT model . . . . . . . . . . . . . . . . . . . . . . . 21
4.4 Coefficient Estimates for EABL APT model . . . . . . . . . . . . . . . . . . . . . . 22
4.5 Coefficient Estimates for KEGN APT model . . . . . . . . . . . . . . . . . . . . . . 23
4.6 Coefficient Estimates for NMG KNRE model . . . . . . . . . . . . . . . . . . . . . 23
4.7 Coefficient Estimates for SCOM APT model . . . . . . . . . . . . . . . . . . . . . . 23
4.8 Coefficient Estimates for NMG APT model . . . . . . . . . . . . . . . . . . . . . . 24
4.9 Coefficient Estimates for SASN APT model . . . . . . . . . . . . . . . . . . . . . . 24
4.10 Durbin-Watson Test Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.11 Analysis of variance table for KCB . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.12 Analysis of variance table for EQTY . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.13 Analysis of variance table for EABL . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.14 Analysis of variance table for SASN . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.15 Analysis of variance table for KEGN . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.16 Analysis of variance table for SCOM . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.17 Analysis of variance table for NMG . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.18 Analysis of variance table for KNRE . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.19 Predicted stock returns for the next two years. . . . . . . . . . . . . . . . . . . . . . 32
4.20 Root Mean Squared Error (RMSE) for different stocks . . . . . . . . . . . . . . . . 33
4.21 Mean Absolute Error (MAE) for different stocks . . . . . . . . . . . . . . . . . . . 33
vii
Abbreviations
APT Arbitrage Pricing Theory
APM Arbitrage Pricing Model
ACF Auto Correlation Function
CAPM Capital Asset Pricing Model
CBR Central Bank Rtes
CMA Capital Market Authority
CRRR Cash Reserve Requirements Rates
EAC East African Community
EQTY Equity Group Holdings
EAT East African Time
EABL East African Breweries Limited
GMES Growth Enterprise Market Segment
IBR Interbank Rates
INFER Inflation
KCB Kenya Commercial Bank
KEGN Kenya Electricity Generating
KNRE Kenya Reinsurance
NSE Nairobi Security Exchange
NBV Nairobi Business Venture
NMG Nation Media Group
OLS Ordinary Least Square
RMSE Root Mean Square Error
SASN Sasini
SCOM Safaricom
SML Security Market Line
SSE Sum of Square Residuals
SMEs Small Sized Enterprise
USD United States Dollar
TB 91 Day Treasury Bills
viii
Symbols
E expected return
βi sensitivity factors
Ri return on asset i
Rf risk free rate
Rit return of the stock i for a period t
λk risk premium factor
tb treasury bill rate
λ0 return on the riskless asset
Pi market price of the stock i
εi unsystematic risk
δi source of systematic risk
Ω positive definite symmetric matrix
D diagonal matrix
ix
Abstract
Accurate stock return predictions are of paramount importance in the world of finance. Traditional as-
set pricing models like the Capital Asset Pricing Model face challenges in predicting stock returns due
to oversimplified assumptions and the neglect of intricate dynamics in the modern financial landscape.
The study objective was to predict the stock returns at the Nairobi Securities Exchange. The Arbitrage
Pricing Theory was used as a solution, because it offers a multifactorial approach that accommodates
more factors such as macroeconomic indicators, industry-specific variables, and technological ad-
vancements, providing a more nuanced framework for accurate stock return predictions. The Least
Squares Estimation, were applied to estimate the coefficients in the arbitrage pricing theory model,
providing insights into the relationships between systematic factors and stock returns. The United
states dollar variable consistently emerges as the most significant and negatively impactful factor on
the returns of all the observed stocks. Conversely, variables Cash Reserve Requirement Rates or In-
fation rates consistently show a positive relationship with returns across all models. Additionally, the
variables 91 day treasury bills or Central Bank rates exhibit the least impact in some cases, being
statistically insignificant at the 1% significance level. The Durbin-Watson test results indicated vary-
ing levels of autocorrelation across the models, with Eastern African Breweries limited exhibiting the
largest Durbin-Watson statistic, suggesting a higher level of independence between consecutive errors,
while Sasini had the lowest Durbin-Watson statistic, indicating a lower likelihood of independence.
The analysis of table tables for each model showed that the models were appropriate for the data, with
p-values of 0, signifying significance. In all cases, the computed F-values were less than the critical
value, leading to the rejection of the null hypothesis and concluding the significance of the respective
models. Moreover, the T-test results indicated that all independent variables in the models were statis-
tically significant, as their t-statistics were greater than the critical value of the t-distribution at a 5%
significance level. Additionally, the p-values of 0 for all variables in all models led to the rejection of
the null hypothesis that the betas were zero, implying the statistical significance of all coefficients to
their respective models. The root mean squared error and mean absolute error values were lower than
1, they signified higher accuracy, indicating that the model’s predictions aligned closely with actual
observed returns.
x
Chapter 1
Introduction
1.1 Introduction
Predicting stock returns is a critical aspect of financial analysis and investment decision-making, as
it holds significant importance for investors, portfolio managers, and financial institutions. Accurate
predictions of stock returns can help individuals and organizations make informed investment choices,
optimize their portfolios, and manage risk effectively. Understanding the potential returns on various
stocks enables investors to maximize their profits and minimize losses, which is particularly crucial
in today’s dynamic and highly competitive financial markets. However, predicting stock returns is a
complex endeavor that comes with various challenges, including market volatility, economic uncer-
tainties, and unforeseen events.
Stock return is one of the factors that motivates investors to invest and is also a reward for investors’
courage to bear the risk of investing. It is a yield obtained by investors from the capital invested in
the stock market. Stock returns are obtained by comparing the difference between the stock price and
the closing price in the previous period. The difference in share prices is obtained by subtracting the
closing price of the current stock from the closing price of the previous period. The results of the
calculation of stock returns can be positive and negative. The higher the value of the company’s stock
return, the better the company’s image and can attract investors to invest in the company.
There are two types of stock returns, namely realized returns and expected returns. Realized returns,
also known as historical returns, are the actual returns that an investor has earned or lost on an in-
vestment over a specific period. These returns are based on the actual performance of the investment
during that time frame. They were calculated by measuring the change in the value of the investment,
including dividends or interest received, over the holding period. Realized returns provide a retro-
spective view of how an investment has performed. Expected returns, on the other hand, represent the
anticipated or forecasted future returns that an investor or analyst expects to earn from an investment.
These returns are estimated based on various factors, including the investor’s assumptions about fu-
ture market conditions, economic trends, company performance, and risk factors. Expected returns
1
Chapter 1. Introduction 2
are forward-looking and are often used in financial modeling, portfolio management, and investment
decision-making.
Inflation risk is a combination of the unexpected components of short- and long-run inflation rates.
Expected future inflation rates are computed at the beginning of each period from the available infor-
mation: historical inflation rates, interest rates, and other economic variables that influence inflation.
For any month, inflation risk is the surprise that is computed at the end of the month the differ-
ence between the actual inflation for that month and what had been expected at the beginning of
the month.Because most stocks have negative exposures to inflation risk, a positive inflation surprise
causes a negative contribution to return, whereas a negative An inflation surprise, and a deflation
shock, contribute positively toward return. Luxury product industries are most sensitive to inflation
risk. Consumer demand for luxury goods plummets when real income is eroded through inflation, thus
depressing profits for industries such as retailing, services, eating places, hotels and motels, and toys.
In contrast, industries least sensitive to inflation risk tend to sell necessities, the demands for which
are relatively insensitive to declines in real income.Also, companies that have large asset holdings
such as real estate or oil reserves may benefit from increased inflation
Predicting stock returns is a crucial aspect of financial decision-making, influencing investors, portfo-
lio managers, and financial institutions. Accurate predictions empower stakeholders to make informed
investment choices, optimize portfolios, and manage risks effectively in the dynamic financial mar-
kets. However, this task is fraught with challenges, including market volatility and economic uncer-
tainties. Stock returns, a key motivator for investors, reflect the yield from invested capital. There are
two types: realized returns, based on actual investment performance, and expected returns, forecasted
using factors like market conditions and economic trends. Inflation risk further complicates predic-
tions, with unexpected inflation changes impacting stock returns. Positive inflation surprises often
result in negative returns, particularly affecting luxury product industries. Conversely, industries sell-
ing necessities or holding substantial assets may benefit from increased inflation. Understanding these
complexities is essential for navigating the intricacies of stock market dynamics.
Chapter 1. Introduction 3
In response to these limitations, the Arbitrage Pricing Model (APT) was developed. Proposed by
(Ross, 1976), the APT offers a more flexible and sophisticated framework for forecasting stock re-
turns. APT considers multiple macroeconomic and market factors, recognizing that stock returns
are influenced by a range of variables, including interest rates, inflation, GDP growth, and industry-
specific trends. By capturing these diverse influences, APT provides a more comprehensive tool for
modeling the complexities of financial markets.
The foundation of the Arbitrage Pricing Model (APT) lies in the fundamental principle that investors
ought to be rewarded for assuming additional risk. At its core, the APT asserts that the anticipated
return on a stock can be expressed as a linear combination of numerous risk factors, where each
factor’s significance, or sensitivity, is dictated by its influence on the stock’s return. This model’s
remarkable adaptability enables it to incorporate a multitude of factors, ranging from macroeconomic
indicators to industry-specific trends, depending on the intricacies of the context and market under
scrutiny. By embracing this comprehensive approach, the APT transcends the limitations of traditional
models like the Capital Asset Pricing Model (CAPM), offering analysts and investors a more nuanced
framework for understanding and predicting stock returns in an ever-evolving financial landscape.
The application of APT has gained attention in recent years due to its potential to enhance the accuracy
of stock return predictions. Its ability to adapt to different markets and incorporate a range of factors
makes it a valuable tool for addressing the shortcomings of the CAPM. This study seeks to further
explore the practicality and effectiveness of APT in the context of predicting stock returns, with a
particular focus on its application in specific stock exchanges, such as the Nairobi Securities Exchange
(NSE). By considering the unique dynamics of the NSE and its surrounding economic environment,
this research aims to provide valuable insights into the potential of APT as a robust model for stock
Chapter 1. Introduction 4
return forecasting. Ultimately, this study contributes to the ongoing evolution of financial modeling
and investment strategies in the face of ever-changing market conditions.
Stock markets are dynamic and complex, reflecting the interplay of numerous factors that influence
asset prices. Accurate stock return predictions are of paramount importance to investors, financial
analysts, and fund managers. Traditionally, the Capital Asset Pricing Model (CAPM) has been the
go-to model for estimating expected stock returns. However, the CAPM has limitations, primarily
because it relies on a single factor, the market risk premium, to explain returns. This approach does
not account for the multifaceted nature of stock markets, leaving room for significant errors in return
predictions.
In response to these limitations, the Arbitrage Pricing Model (APT) was developed, it offers a more
flexible and sophisticated framework for forecasting stock returns. Unlike the CAPM, APT considers
multiple macroeconomic and market factors, recognizing that stock returns are influenced by a range
of variables, including interest rates, inflation, GDP growth, and industry-specific trends. By capturing
these diverse influences, APT provides a more comprehensive tool for modeling the complexities of
financial markets.
The APT is based on the concept that investors should be compensated for taking on additional risk.
It posits that the expected return on a stock is a linear function of multiple risk factors, with each
factor’s weight (sensitivity) determined by its impact on the stock’s return. This model is highly
adaptable, allowing for the inclusion of various factors depending on the specific context and market
being analyzed.
The application of APT has gained attention in recent years due to its potential to enhance the accuracy
of stock return predictions. Its ability to adapt to different markets and incorporate a range of factors
makes it a valuable tool for addressing the shortcomings of the CAPM. This study seeks to further
explore the practicality and effectiveness of APT in the context of predicting stock returns, with a
particular focus on its application in specific stock exchanges, such as the Nairobi Stock Exchange
(NSE). By considering the unique dynamics of the NSE and its surrounding economic environment,
this research aims to provide valuable insights into the potential of APT as a robust model for stock
return forecasting. Ultimately, this study contributes to the ongoing evolution of financial modeling
and investment strategies in the face of ever-changing market conditions.
Chapter 1. Introduction 5
Literature Review
2.1 Introduction
The Arbitrage Pricing Model (APM) has been a transformative force in financial economics, offering
a multi-factorial approach, unlike earlier models like the Capital Asset Pricing Model (CAPM). This
literature review examines a series of studies investigating the predictive power of various asset pricing
models, with a focus on the APT, in forecasting stock returns.
Riro and Wambugu (2017), the main aim of this study was to test three asset pricing models using
monthly price data of the Nairobi Securities Exchange. The three models are CAPM, the Fama three-
factor model, and the four-factor model. What they discovered was that the predictive power of CAPM
and FF3F models was weak. They created six portfolios that returned R-square ranging between 11
% and 50 % for CAPM and 13% to 58% for the Fama-French three-factor model. In both cases,
the intercept coefficients were statistically significant implying the models were not quite efficient
in capturing all sources of risk for the portfolios. According to their finding, momentum effects
were more significant in improving model efficiency. However, momentum effects are criticized
for being temporal and thus not fit for inter-temporal forecasting of returns. As a result, a more
permanent and efficient model is sought to help market players in predicting changes and movements
of macroeconomic aggregate variables that are often faced by various countries, which are also related
to stock returns.
7
Chapter 2. Literature Review 8
Magut and Bogonko (2017) conducted research on the evaluation of CAPM in predicting securities
returns at the NSE, the main purpose of this paper was to determine the impact of CAPM systematic
risk on securities returns and to determine the linearity of the risk and the returns. This study was
guided by asset pricing theories in place which included the Arbitrage Pricing Model and Markowitz’s
modern portfolio theory. This study targeted all agricultural companies listed and quoted under the
NSE of which weekly prices for five years from January 2011 to December 2015 were used. In
utilizing the NSE 20 share index to represent the major stocks for agricultural firms, the findings have
tried to provide significant findings that support the CAPM. Thus, for future research, it would be
of interest to use other asset pricing models to compare the findings with those found on the CAPM
under this study to compare and contrast. In addition, since this study was only centered on historical
data from agricultural sector companies listed on the NSE, it will be of great importance to confirm
the findings of this study by carrying out the methodology on non-agricultural sector companies listed
on the NSE separately on a sector by sector basis.
Amtiran et al. (2017) found out that a decline in economic growth, as measured by gross domestic
product (GDP), was responded to negatively by investors, thereby reducing stock returns. Meanwhile,
inflation and depreciation of the rupiah had a significant negative impact on stock returns. The level
of stock returns of companies listed on the Indonesia Stock Exchange differences in macroeconomic
factor beta value, i.e. GDP, inflation, interest rate, and exchange rate where there is a return of
stocks that have a high level of sensitivity to one of the macroeconomic factors, but on the other hand
there is the stock return which has a low sensitivity to other macroeconomic macroeconomic factors
and stock returns in APT framework. This is caused by their surprise at both positive and negative
values of macroeconomic factors on stock returns. GDP has a positive relationship with stock returns,
inflation has a negative correlation with stock returns, interest rates have a positive relationship with
stock returns, and exchange rates have a positive relationship with stock returns. Market conditions
in Indonesia is strongly influenced by macroeconomic factors, especially interest rates and exchange
rates. Investors will invest in a country if that country has stable macroeconomic conditions. Model
APT one factor is valid more than multi-factor APT.
Barillas and Shanken (2018) highlighted that the Capital Asset Pricing Model (CAPM) model of
Sharpe and Litner led to a theory of asset pricing commonly used to estimate a firm’s cost of capital.
emphasized that Valuation confirms the performance of its investment portfolio. CAPM states that
only systematic or market risk impacts investment returns. This is because unsystematic or asset
Chapter 2. Literature Review 9
risk can be eliminated through investment diversification. CAPM can be used to estimate the cost
of capital and measure the performance of an asset or portfolio. The recommendation was to use a
multi-factorial model in further research done in the future.
(Kiboi and Katuse, 2019) conducted a study on the determinants of the market index for the Nairobi
Stock Exchange (NSE) by examining the period from January 2008 to December 2010. The study
identified money supply, inflation rates, exchange rates, and interest rates as significant factors influ-
encing the market index. Utilizing data from both the NSE and the Central Bank of Kenya, the study
employed multiple regression analysis to assess the impact of these factors on stock values, with the
market index serving as the primary indicator. Concentrating solely on four macroeconomic factors
associated with stock prices - money supply, interest rates, foreign exchange rates, and inflation - the
study focused exclusively on the financial market dynamics of the Nairobi Stock Exchange. Conse-
quently, the generalizability of the findings to other financial markets with varying levels of efficiency
and liquidity may be limited. To enhance the robustness of empirical research, future studies are en-
couraged to explore a broader array of macroeconomic factors and replicate similar analyses across
diverse financial markets
Wanjiku et al. (2021) also conducted a study to determine the impact of CAPMs systematic risk on
securities returns and to determine the linearity of the risk and the returns. This study was guided by
asset pricing theories in place which included the Arbitrage Pricing Model and Markowitz’s modern
portfolio theory. This study targeted all agricultural companies listed and quoted under the NSE of
which weekly prices for five years from January 2011 –December 2015 were used. In utilizing the
NSE 20 share index to represent the major stocks for agricultural firms, the findings have tried to
provide significant findings that support the CAPM. Thus, for future research, it would be of interest
to use other asset pricing models to compare the findings with those found on the CAPM under this
study to compare and contrast. In addition, since this study was only centered on historical data from
agricultural sector companies listed on the NSE, it will be of great importance to confirm the findings
of this study by carrying out the methodology on non-agricultural sector companies listed on the NSE
separately on a sector by sector basis.
Alfredo (2023) researched the use of Arbitrage Pricing Theory to analyze stock returns on banking
sub-sector companies listed on the Indonesia Stock Exchange for the period 2015 – 2022. The results
of the study using simultaneous hypothesis testing showed that inflation, exchange rates, and Gross
Chapter 2. Literature Review 10
Domestic Product (GDP) had a significant influence on stock returns. Partial testing of the hypoth-
esis shows that the exchange rate negatively affects stock returns. inflation and GDP do not have a
significant influence on stock returns.
Akel and Cisse (2023) investigated the validity of the Arbitrage Pricing Theory (APT) on the Istanbul
Stock Exchange over the period from January 2009 to March 2020, using BIST100 as the sample.
It sought to establish the relationship between security returns and various macroeconomic factors,
to provide insights for other emerging economies. The research employed a Vector Error Correction
Model, a member of the VAR family, with five macroeconomic variables: GDP, interest rate, inflation
rate, exchange rate, and production indexes. The resulting model indicated a negative Error Correction
Term , confirming the applicability of APT within the Turkish stock exchange.
Hussein and Mohammed (2023) addressed the challenge of predicting stock returns and tested the ef-
fectiveness of both the Capital Asset Pricing Model (CAPM) and the Arbitrage Pricing Theory (APT).
Analyzing a sample of 10 banks listed on the Iraq Stock Exchange from 2012 to 2021, the study con-
cluded by rejecting the original hypotheses and accepting alternative ones based on analytical results.
It found evidence challenging the predictive power of CAPM and APT in the context of these banks,
along with differences in the required rate of return calculated by these models compared to actual
market returns. These findings emphasize the complexities involved in predicting stock returns and
their implications for financial analysts and decision-makers.
In conclusion, this literature review explains ATP’s pivotal role in financial modeling and the inad-
equacies of traditional models like CAPM. The studies reviewed highlight the significance of incor-
porating macroeconomic factors, industry-specific variables, and firm-specific attributes in predicting
stock returns. The gaps identified in the research encompass the limited scope to agricultural com-
panies, underscoring the necessity to broaden the analysis to non-agricultural sectors. Additionally,
crucial macroeconomic and non-macroeconomic factors were omitted, indicating the need for a more
comprehensive examination in future studies. To address these gaps, this research has extended the
analysis to non-agricultural sectors, and diverse markets, thereby enhancing the understanding and
application of APM in predicting stock returns.
Chapter 3
Methodology
3.1 Introduction
This chapter presents the methods that will be used in this research proposal. Section 3.2 covers
an introduction to the Arbitrage Pricing Theory, assumptions, and other concepts used in Arbitrage
Pricing Theory, Section 3.3 covers the parameter estimation using Least Square Estimates, Section
3.4 covers the criteria in which the adequacy of the model will be checked, Section 3.5 covers the
prediction of stock returns, Section 3.6 involves checking the accuracy of the predicted stock returns.
where Rit is the return on security i between time t − 1 and time t for i = 1, . . . , n, Ei is the expected
return on security i, δkt is the realization of the kth common factor i.e source of systematic risk
between time t − 1 and t, βik is the sensitivity of the return of security i to the kth common factor
called the factor loading and εit is the idiosyncratic or residual risk of the return on the ith security
between time t − 1 and time t. Equation (3.2.1) can be rewritten in more compact matrix notation:
R1t β1,1 β1,2 . . . β1,k δ1t ε1t
R2t β2,1 β2,2 . . . β2,k δ2t ε2t
=
.. .. .. .. .. + .. (3.2.2)
..
. . . . . . .
Rnt βn,1 βn,2 . . . βn,k δkt εnt
11
Chapter 3. Methodology 12
Rt = βδt + ϵt (3.2.3)
The random factors δt (a k × 1 vector) and the corresponding elements of the factor loading matrix, β
( which is a n × Kk), have been normalized so that,
E[δt ] = 0 (3.2.4)
Ross (1976), argued that investors should be compensated only for bearing the systematic risk inher-
ent in the K common factors since idiosyncratic risk can be virtually eliminated in large and well-
diversified portfolios. Suppose we examine zero net investment portfolios and, in particular, the set
of such portfolios that are constructed to be well-diversified and to contain no systematic risk. As the
number of securities grows large, these portfolios will contain no risk at all and so should earn zero
profits to prevent the occurrence of riskless arbitrage opportunities. Since in these circumstances, the
number of such arbitrage portfolios tends toward infinity as well, Ross and many others proved that
to ensure that these arbitrage portfolios do not earn positive profits, expected returns must satisfy:
where R f is the intercept in the pricing relation (the risk-free rate) and δk is the risk premium on the
kth common factor, k = 1 . . . n. The observed stock prices will be used to calculate the rates of return
using the formula ;
Rit = [ln(Pt ) − ln(Pt−1 )] (3.2.9)
Chapter 3. Methodology 13
where; Rit return of the stock i for the period t, Pt market price of the stock at the end of the period,
andPt−1 market price of the stock at the beginning of the period. The weekly risk-free rates were
found by first annualizing the 91Day T-Bill rate before reducing it to a weekly rate. This was done
using
1
R f = (1 + Tb ) 52 − 1 (3.2.10)
where, R f - The weekly risk-free return rate,b is the 91 Day Treasury bill rate.
n
S= ∑ ϵt2
t=1
= ϵT ϵ (3.3.3)
= (Rt − βδt )⊤ (Rt − βδt )
Differentiating equation (3.3.3) with respect to β and equating to zero to obtain the regression esti-
mates: The solution is given by:
∂S
=0 ⇒ −2δt⊤ Rt + 2δt⊤ δt β̂ = 0
∂β (3.3.4)
⇒ δt⊤ δt β̂ = δt⊤ Rt
β̂ = (δt⊤ δt ) δt⊤ Rt
−1
(3.3.5)
where δt⊤ δt is an n × n symmetric matrix and Rt is an n × 1 matrix of the observed return values.
Residual plots
A residual plot is a graphical representation used in regression analysis to assess the adequacy of a
model by visualizing the differences between observed data points and the model’s predictions, known
as residuals. In a residual plot, the x-axis typically represents the predicted values from the model,
while the y-axis shows the residuals. A well-fitted model should produce residual points that scatter
randomly around the zero line, without any discernible patterns, such as curves or clusters. Patterns
Chapter 3. Methodology 15
in the residual plot can indicate issues like nonlinearity, heteroscedasticity (changing variance), or
outliers, offering valuable insights into the model’s performance and potential areas for improvement.
3.4.3 F test
The F-test is used to check the overall adequacy of the APT model. In the APT framework, you have
a set of factor models (systematic risk factors) that are supposed to explain the returns of the assets.
Chapter 3. Methodology 16
H0 : βi = 0
(3.4.3)
H1 : βi ̸= 0
The null hypothesis of the F-test is that the APT model is not statistically different from a simple
single-factor model (Capital Asset Pricing Model ). If the F-test rejects the null hypothesis, it suggests
that the APT model is a better fit for explaining the asset returns than a simpler model. SSR (Sum of
Squares Regression):
n
SSR = ∑ (R̂i − R̄)2 (3.4.4)
i=1
3.4.4 T -test
The t-tests are used to assess the significance of each factor in the APT model. For each systematic
risk factor included in the APT model, you can perform a t-test to determine if that factor significantly
contributes to explaining asset returns. The hypotheses are;
H0 : βi = 0
(3.4.8)
H1 : βi ̸= 0
Chapter 3. Methodology 17
The null hypothesis for each t-test is that the factor’s coefficient is equal to zero, indicating that the
factor is not relevant for explaining the asset’s return. If a t-test rejects the null hypothesis for a
particular factor, it suggests that the factor is statistically significant in explaining the asset’s return
and should be included in the APT model. The test statistic is:
β̂i
T0 = (3.4.9)
se(β̂i )
where R̂ is the predicted value of the stock returns, R f t is the risk-free rate, β1 , β2 ,ˆ. . . , βk are the
coefficients or slopes associated with each predictor variable, δ are the systematic factors. For the
Arbitrage Pricing Theory (APT) model, the equation in matrix form is represented as:
R = β̂δt + ε (3.5.2)
1 n
MAE = ∑ |Ri − R̂i|
n i=1
(3.6.1)
Chapter 4
4.1 Introduction
This chapter presents the empirical results and discussions of the study. Section 4.2 provides a de-
scription of the data used in the study. Section 4.3 presents the estimation of the Arbitrage Pricing
Theory model parameters. Section 4.4 involves checking the adequacy of the fitted model. Section
4.5 discusses the prediction of stock returns using the fitted model. Finally, Section 4.6 presents the
testing of the accuracy of predicted returns.
Among the stocks analyzed, NMG exhibited the highest standard deviation, indicating the most sub-
stantial price fluctuations over the observed period. Following NMG, EQTY, KEGN, SASN, KNRE,
19
Chapter 4. Results and Discussions 20
SCOM, and KCB also displayed relatively high standard deviations, suggesting that these stocks had
experienced greater price volatility and uncertainty. In contrast, EABL had the lowest standard de-
viation, signifying a more stable and predictable price trend during the observed period, making it a
potentially less risky investment option compared to the other stocks.
The returns exhibited positive and negative skewness. Among the positively skewed stocks, EABL
stood out with a highest positive skewness. This high positive skewness suggests a right-skewed
distribution, indicating a greater likelihood of experiencing extreme positive returns. On the other
hand, within the negatively skewed stocks, NMG exhibited the highest negative skewness, implying
that it had higher negative returns than positive returns.
All the stocks exhibited excess kurtosis which means that their return distributions have a higher de-
gree of peakedness compared to a normal distribution. EABL exhibited an exceptionally high positive
excess kurtosis indicating a return distribution with fatter tails and a sharper peak. This suggests a
higher likelihood of experiencing extreme returns, both positive and negative, compared to a normal
distribution. SCOM displayed positive excess kurtosis, with a much lower value, indicating a return
distribution with somewhat fatter tails and a slightly sharper peak, but the effect is less pronounced
than in the case of EABL. SCOM’s excess kurtosis suggests the potential for more extreme returns,
but to a relatively lesser extent than that of EABL.
TABLE 4.1: Descriptive statistics for monthly stocks returns starting from January 1, 2013 to Decem-
ber 31, 2023
In Table 4.2, among the independent variables USD, exhibited a strong negative relationship with the
dependent variable EQTY return. This indicated that as USD rates increase, EQTY return tend to
decrease. In contrast, INFER had a positive relationship with EQTY, suggesting that higher INFER
correspond to higher EQTY returns. TB, CRRR and CBR all had negative associations with EQTY
return. This implies that increased TB or CRRR or CBR contributed to lower EQTY return. All the
independent variables are statistically signficant because the p value was less than 5% significant level.
But at 1% level, the independent variables CRRR and TB were not statistically significant because
they had a p value greater than 1%, hence at 1% they had no impact on the dependent variable EQTY
return.
TABLE 4.3: Coefficient Estimates for KCB APT model
From Table 4.3, among the independent variables USD, exhibited a strong negative relationship with
the dependent variable KCB return. This indicated that as USD rates increase, KCB return tend to
decrease. In contrast, CRRR and INFER had a positive relationship with KCB, suggesting that higher
CRRR or INFER correspond to higher KCB returns. TB and CBR all had negative associations
with KCB return. This implies that increased TB or CBR contributed to lower KCB return. All
the independent variables are statistically signficant because the p value was less than 5% significant
level. But at 1% level, the independent variables INFER and CBR were not statistically significant
because they had a p value greater than 1%, hence at 1% they had no impact on the dependent variable
KCB return.
TABLE 4.4: Coefficient Estimates for EABL APT model
The table 4.4 displays estimated coefficients and their significance levels from a linear regression
model, among the independent variables USD, exhibited a strong negative relationship with the de-
pendent variable EABL return. This indicated that as USD rates increase, EABL return tend to de-
crease. In contrast, CRRR and INFER had a positive relationship with EABL, suggesting that higher
CRRR or INFER correspond to higher EABL returns. TB and CBR all had negative associations
with EABL return. This implies that increased TB or CBR contributed to lower EABL return. All
the independent variables are statistically signficant because the p value was less than 5% significant
level. But at 1% level, the independent variables TB was not statistically significant because it had a
p value greater than 1%, hence at 1% it had no impact on the dependent variable EABL eturn.
Table 4.5, the independent variable USD, exhibited a strong negative relationship with the dependent
variable KEGN return. This indicated that as USD rates increase, KEGN return tend to decrease. In
contrast, CRRR, TB and INFER had a positive relationship with KEGN, suggesting that higher CRRR
or TB or INFER correspond to higher KEGN returns. CBR had negative associations with KEGN
return. This implies that increased CBR contributed to lower KEGN return. All the independent
variables was statistically signficant at 5% level because the p value was less than 5% significant
level. But at 1% level, the independent variables INFER was not statistically significant because it
Chapter 4. Results and Discussions 23
had a p value greater than 1%, hence at 1% they it had no impact on the dependent variable KEGN
return.
TABLE 4.5: Coefficient Estimates for KEGN APT model
Table 4.6 the independent variable USD, exhibited a strong negative relationship with the dependent
variable KNRE return. This indicated that as USD rates increase, KNRE return tend to decrease.
In contrast, CBR had a positive relationship with KNRE, suggesting that higher CBR correspond to
higher KNRE returns. CRRR, TB AND INFER all had negative associations with KNRE return. This
implies that increased CRRR or TB or INFER contributed to lower KNRE return. All the independent
variables were statistically signficant at 5% level because the p value was less than 5% significant
level. But at 1% level, the independent variables INFER was not statistically significant because it
had a p value greater than 1%, hence at 1% they it had no impact on the dependent variable KNRE
return.
TABLE 4.6: Coefficient Estimates for NMG KNRE model
From Table 4.7 the independent variable USD, exhibited a strong negative relationship with the de-
pendent variable SCOM return. This indicated that as USD rates increase, SCOM return tend to
decrease. In contrast, CRRR and INFER all had a positive relationship with SCOM, suggesting that
higher CRRR or INFER correspond to higher SCOM returns. CBR and TB all had negative associa-
tions with SCOM return. This implies that increased CBR or TB contributed to lower SCOM return.
All the independent variables were statistically signficant at 5% level because the p value was less
than 5% significant level. But at 1% level, the independent variable CBR was not statistically signif-
icant because it had a p value greater than 1%, hence at 1% they it had no impact on the dependent
variable SCOM return.
TABLE 4.8: Coefficient Estimates for NMG APT model
Table 4.8 the independent variable USD and INFER, exhibited a strong negative relationship with
the dependent variable NMG return. This indicated that as USD or INFER rates increase, NMG
return tend to decrease. In contrast, CRRR, IBR, TB and CBR all had a positive relationship with
NMG, suggesting that higher CRRR or IBR or TB or CBR correspond to higher NMG returns. All
the independent variables were statistically signficant at 5% level because the p value was less than
5% significant level. But at 1% level, the independent variable CBR was not statistically significant
because it had a p value greater than 1%, hence at 1% they it had no impact on the dependent variable
NMG return.
TABLE 4.9: Coefficient Estimates for SASN APT model
Table 4.9 the independent variables USD, INFER, IBR, and TB, exhibited a strong negative relation-
ship with the dependent variable SASN return. This indicated that as USD or INFER or IBR or TB
rates increase, SASN return tend to decrease. In contrast, CRRR and CBR all had a positive relation-
ship with SASN, suggesting that higher CRRR or CBR correspond to higher SASN returns. All the
independent variables were statistically signficant at 5% level because the p value was less than 5%
significant level. But at 1% level, the independent variables CBR and CRRR was not statistically sig-
nificant because it had a p value greater than 1%, hence at 1% they it had no impact on the dependent
variable NMG return.
Moreover, residual plots offer additional insights into the distribution of model errors. In this case,
all residual plots demonstrated data points clustered around the center, indicating conformity with a
normal distribution. When errors are evenly dispersed around the center line, it signifies homoscedas-
ticity and supports the assumption of normality.
Chapter 4. Results and Discussions 26
Chapter 4. Results and Discussions 27
Chapter 4. Results and Discussions 28
Durbin-Watson test
Durbin Watson test was used to check for autocorrelation. Table 4.10 represents the Durbin-Watson
test results. EABL had the largest DW statistic, indicating a higher level of independence between
consecutive errors. This suggests a lower likelihood of autocorrelation in the model’s errors. SASN
had the lowest DW statistics. These values were significantly lower than 2 suggesting the presence of
no autocorrelation in the residuals. A p-value of 0 was also obtained which lead to the rejection of the
null hypothesis. Thus, affirming independece of residuals.
F test
Table 4.11 is the ANOVA table for the KCB model. The p value for the model was 0 which was
less than 5% thus signifying that the model was appropriated for the data. The critical value of
the F-distribution was 3.8579. Since the computed value was less then the critical value for all the
independent variables with USD having the largest F value and CBR having the lowest value, the null
hypothesis was rejected and it was concluded that the KCB APT model was significant.
Table 4.12 is the ANOVA table for the EQTY model. The p value for the model was 0 which was
less than 5% thus signifying that the model was appropriated for the data. The critical value of
the F-distribution was 3.8579. Since the computed value was less then the critical value for all the
Chapter 4. Results and Discussions 29
independent variables with USD having the largest F value and CBR having the lowest value, the null
hypothesis was rejected and it was concluded that the EQTY APT model was significant.
Table 4.13,is the ANOVA table for the EABL model. The p value for the model was 0 which was
less than 5% thus signifying that the model was appropriated for the data. The critical value of
the F-distribution was 3.8579. Since the computed value was less then the critical value for all the
independent variables with USD having the largest F value and INFER having the lowest value, the
null hypothesis was rejected and it was concluded that the EABL APT model was significant.
The Table 4.14 is the ANOVA table for the SASN model. The p value for the model was 0 which
was less than 5% thus signifying that the model was appropriated for the data. The critical value of
the F-distribution was 3.8579. Since the computed value was less then the critical value for all the
Chapter 4. Results and Discussions 30
independent variables with TB having the largest F value and INFER having the lowest value, the null
hypothesis was rejected and it was concluded that the EABL APT model was significant.
The Table 4.15 is the ANOVA table for the KEGN model. The p value for the model was 0 which
was less than 5% thus signifying that the model was appropriated for the data. The critical value of
the F-distribution was 3.8579. Since the computed value was less then the critical value for all the
independent variables with USD having the largest F value and CBR having the lowest value, the null
hypothesis was rejected and it was concluded that the KEGN APT model was significant.
Table 4.16 is the ANOVA table for the SCOM model. The p value of the model was 0 which was
less than 5% thus signifying that the model was appropriated for the data. The critical value of
the F-distribution was 3.8579. Since the computed value was less then the critical value for all the
independent variables with USD having the largest F value and INFER having the lowest value, the
null hypothesis was rejected and it was concluded that the SCOM APT model was significant.
Table 4.17 is the ANOVA table for the NMG model. The p value for the model was 0 which was
less than 5% thus signifying that the model was appropriated for the data. The critical value of
the F-distribution was 3.8579. Since the computed value was less then the critical value for all the
independent variables with USD having the largest F value and CBR having the lowest value, the null
hypothesis was rejected and it was concluded that the NMG APT model was significant.
Chapter 4. Results and Discussions 31
Table 4.18 is the ANOVA table for the KNRE model. The p value for the model was 0 which was
less than 5% thus signifying that the model was appropriated for the data. The critical value of
the F-distribution was 3.8579. Since the computed value was less then the critical value for all the
independent variables with USD having the largest F value and IBR having the lowest value, the null
hypothesis was rejected and it was concluded that the KNRE APT model was significant.
T test
The T-test was conducted and the null hypothesis was rejected for all of the independent variables,
since the t-statistics for all of the independent variables in the APT models were greater than the crit-
ical value of the t-distribution at 5% significance level. This meant that all the independent variables
were statistically significant. Also the p value was 0, for the variables in all of the models, which
lead to the rejection of the null hypothesis that the betas were zero, hence implying that all of the
cofficients was statistically significant to it’s respective models fitted.
by rising values and decreasing returns by declining values, the findings indicate the direction of pre-
dicted performance. By observing the values within each column over time, one can discern whether
the predictions generally indicate rising or falling returns. Higher values in later rows compared to
earlier ones suggest increasing predicted returns, while lower values indicate decreasing predicted
returns. Additionally, comparisons across columns for a specific row reveal the relative strength of
predicted returns for different financial instruments. Overall, these trends provide valuable insights
into the expected performance of the analyzed assets, aiding in investment decision-making and risk
assessment.
TABLE 4.19: Predicted stock returns for the next two years.
indicates the reliability of the model’s stock return predictions. As a result, the model proved to be
suitable for predicting stock returns.
TABLE 4.20: Root Mean Squared Error (RMSE) for different stocks
Stock RMSE
KCB 0.0454
EABL 0.0676
EQTY 0.0450
SASN 0.0233
KEGN 0.0116
SCOM 0.0402
NMG 0.1311
KNRE 0.0052
The relatively low Mean Absolute Error (MAE) obtained by the model, as depicted in Table 4.21,
suggests that the model’s predictions for stock returns are generally accurate. This indicates the
effectiveness of the model in forecasting stock returns with a high degree of precision. Therefore, the
model demonstrates its capability and reliability in predicting stock returns.
Stock MAE
KCB 0.0363
EABL 0.0523
EQTY 0.0385
SASN 0.0182
KEGN 0.0083
SCOM 0.0307
NMG 0.0980
KNRE 0.0041
Chapter 5
5.1 Introduction
This chapter gives the summary, conclusions and recommendations for further research. Section 5.2
presents the summary of the research project. Section 5.3 gives the conclusion of the study and section
5.4 presents the recommendations for further research.
5.2 Summary
The study’s first specific objective was to fit the Arbitrage Pricing Model (APM) to the data. This
involved estimating the model’s parameters using the Ordinary Least Squares (OLS) method and
analyzing the coefficients of independent variables to understand their impact on dependent variable
returns across various assets like EQTY, KCB, EABL, KEGN, KNRE, SASN, NMG and SCOM. The
analysis revealed significant relationships between these variables, with USD showing a consistent
negative influence on returns and other variables like INFER, CRRR, TB, and CBR exhibiting varying
impacts.
The second objective aimed to check the adequacy of the fitted model. This involved conducting
several statistical tests such as Q-Q plots to assess the normality of residuals, Durbin-Watson tests to
detect autocorrelation, and ANOVA tables to evaluate model significance.T-tests were conducted to
determine the significance of independent variables in the APT models, with all variables being sta-
tistically significant. The results indicated that the models adequately fit the data, with most residuals
conforming to a normal distribution, minimal autocorrelation, and significant model p-values.
The third objective focused on predicting stock returns using the Arbitrage Pricing Model. The study
utilized the fitted APM to forecast expected returns for different financial instruments over a two-year
period. This analysis provided insights into the direction of predicted performance for each asset and
allowed for comparisons of predicted returns across various financial instruments.
Finally, the fourth objective evaluated the accuracy of predicted stock returns using Root Mean
Squared Error (RMSE) and Mean Absolute Error (MAE) metrics. The results showed low RMSE
and MAE values across different stocks, indicating the model’s reliability and precision in forecasting
34
References 35
stock returns. These metrics confirmed the effectiveness of the APM in predicting stock returns with
a high degree of accuracy.
5.3 Conclusion
In conclusion, this research employed the Arbitrage Pricing Theory (APT) framework to estimate
parameters and predict stock returns for various companies. The study assessed the adequacy of
the fitted model, checked the normality of residuals, and evaluated the accuracy of predicted stock
returns using RMSE and MAE values. The findings revealed variability in predictive accuracy across
companies, with some exhibiting minimal average discrepancy between predicted and actual returns
while others showed significant disparities. Notably, the model demonstrated exceptional predictive
performance for certain companies, while others necessitated further refinement. Overall, the research
provides valuable insights into the application of APT in predicting stock returns and highlights the
importance of ongoing refinement to optimize predictive capabilities.
5.4 Recommendations
When empirically testing the APT model, the factors to use are unspecified. This is both a strength and
a weakness of the model, and finding factors with an economic basis behind market returns presents a
continual difficulty. Previous APT studies (French, 2021) had been criticized as regression formulas
do not indicate predictive powers of the variables. Future research may explore the forecasting abil-
ities of risk premiums, industrial production, and principal components. In addition, further tests of
APT may explore the use of modelling in CAPM betas, firm characteristics, and/or a set of industry
portfolios, which may enable better equilibrium models in the capital markets. Studies could test the
variables on industrial goods, financial institutions, and other industry portfolio returns.
References
Akel, Veli and Boubacar Amadou Cisse (2023). “Test of Arbitrage Pricing Theory on stock indices:
An empirical study on BIST100.” In: Economic Magazine 75.1, pp. 6–16.
Alfredo, Harold Kevin (2023). “Analysis of Expected Stock Returns in 2020-2022 Using Arbitrage
Pricing Theory (Study on Stocks Incorporated with The IDX-30 Index on The Indonesia Stock
Exchange)”. In: Eduvest-Journal of Universal Studies 3.3, pp. 626–646.
Amtiran, PY, R Indiastuti, SR Nidar, and D Masyita (2017). “Macroeconomic Factors And Stock Re-
turns In APT Framework.” In: International Journal of Economics & Management 11.4, pp. 704–
715.
Barillas, Francisco and Jay Shanken (2018). “Comparing asset pricing models”. In: The Journal of
Finance 73.2, pp. 715–754.
French, Jordan (2021). “Macroeconomic forces and arbitrage pricing theory”. In: Journal of Compar-
ative Asian Development 16.1, pp. 1–20.
Hussein, Zahraa A and Mohammed J Mohammed (2023). “Accuracy of Capital Asset Pricing Model
and Arbitrage Pricing Theory in Predicting Stock Return”. In: Journal of Namibian Studies: History
Politics Culture 33, pp. 1539–1563.
Kiboi, Jane and Paul Katuse (2019). “Nairobi Stock Exchange: A Regression of Factors Affecting
Stock Prices”. In: International Journal of Finance 4.1, pp. 11–21.
Magut, John Tarus and Jared Bitange Bogonko (2017). “Evaluation of Capital Asset Pricing Model
in Predicting Securities Returns at The Nairobi Securities Exchange (Listed Agricultural Compa-
nies)”. In: American Based Research Journal 6.9, pp. 13–26.
Ngoc, Nguyen Minh and Tien (2023). “Factors affecting the selling price of luxury apartments in
Vietnam. A quantitative analysis”. In: International journal of business and globalisation 20.3,
pp. 5–45.
Riro, George Kamau and Johnson Munene Wambugu (2017). “A test of asset-pricing models at the
Nairobi Securities Exchange”. In: pp. 67–77.
Ross, Stephen (1976). “The arbitrage pricing theory”. In: Journal of Economic Theory 13.3, pp. 341–
360.
Wanjiku, Patricia et al. (2021). “Effect of Economic Reopening Announcement on Nairobi Security
Exchange Market Performance”. PhD thesis. University of Nairobi.
36
Appendix
/Inflation Rates.xlsx")
INFR <- data.frame(Inflation_Rates)
for(i in 1:nrow(INFR)){
if(nchar(INFR$Month[i])==1){
INFR$Date[i] <- paste(INFR$Year[i],INFR$Month[i],sep="-0")
}else{
INFR$Date[i] <- paste(INFR$Year[i],INFR$Month[i],sep="-")
}
}
INFR1 <- INFR[,c(5,3)]
INFR1$Date <- ym(INFR1$Date) # Assuming it’s in YYYY-MM-DD format
INFR1$Date <- format(floor_date(INFR1$Date, "month") +
months(1) - days(1), "%Y/%m/%d")
INFR2 <- INFR1 %>% arrange(desc(ymd(INFR1$Date)))
name <- c("Date", "INF_Rate")
names(INFR2) <- name
INFR2$INF_Rate <- as.numeric(INFR2$INF_Rate)
infr2 <- data.frame(INFR2$Date[-1], diff(INFR2$INF_Rate))
infr2$INFR2.Date..1. <- as.Date(infr2$INFR2.Date)
name <- c("Date", "INF_Rate")
names(infr2) = name
str(infr2)
head(infr2)
US_DOLLAR <- read_excel("D:/@kimeu.felix files/
ATP DATA/US exchannge rates.xlsx")
US_DOLLAR_prices <- data.frame(US_DOLLAR[,c("Date","Mean")])
name <- c("Date", "US_DOLLAR")
names(US_DOLLAR_prices) <- name
US_DOLLAR_prices <- US_DOLLAR_prices[-1,]
US_DOLLAR_prices$Date <- format(as.Date(US_DOLLAR_prices$Date,
format = "%d/%m/%Y"), "%Y-%m-%d")
USDX <- US_DOLLAR_prices %>% arrange(desc(ymd(US_DOLLAR_prices$Date)))
Appendix. R Program Codes 40
head(CBKR2)
#jointing all the stocks
nse_stocks <- join_all(list(KCB_prices,
eabl_prices,equity_prices,
SASN_prices,Kegn,Scom,Nmg,knre,
USDX,infr2,CBKR2), by = "Date", type = "left")
DATA <- to.monthly(nse_stocks, OHLC=FALSE, indexAt="lastof")
head(DATA)
# Write the data frame to an Excel file
write_xlsx(DATA, "C:/dataset/Data1.xlsx")
#calculating the log returns;
logreturn <- data.frame(
kcb = log(1 + DATA$KCB/100),
equity = log(1 + DATA$EQUITY/100),
eabl = log(1 + DATA$EABL/100),
sasn = log(1 + DATA$SASN/100),
kegn = log(1 + DATA$KEGN/100),
scom = log(1 + DATA$SCOM/100),
NMg = log(1 + DATA$NMG/100),
Knre = log(1 + DATA$KNRE/100),
us_dollar = log(1 + DATA$US_DOLLAR/100),
infer = (DATA$INF_Rate/100),
ibr = (DATA$IBR/100),
tb = (DATA$TB/100),
crrr = (DATA$CRRR/100),
cbr <- (DATA$CBR/100)
)
#fitting the model and plotting the qqplot and scatter plots
kcb_apt <- (lm(logreturn$kcb ~ logreturn$infer+logreturn$us_dollar+
logreturn$ibr+logreturn$tb+logreturn$crrr+logreturn$cbr))
summary(kcb_apt)
residual3 <- residuals(kcb_apt)
Appendix. R Program Codes 42
logreturn$ibr+logreturn$tb+logreturn$crrr+logreturn$cbr)
summary(nmg_apt)
residual11 <- residuals(nmg_apt)
qqnorm(residual11, main = "NMG Q-Q PLOT");qqline(residual11)
plot(residual11, ylab = "NMG RESIDUALS", main = "NMG RESIDUALS PLOT")
dwtest(nmg_apt)
knre_apt <- lm(logreturn$Knre ~ logreturn$infer+logreturn$us_dollar+
logreturn$ibr+logreturn$tb+logreturn$crrr+logreturn$cbr)
summary(knre_apt)
residual13 <- residuals(knre_apt)
qqnorm(residual13, main = "KNRE Q-Q PLOT");qqline(residual13)
plot(residual13, ylab = "KNRE RESIDUALS", main = "KNRE RESIDUALS PLOT")
dwtest(knre_apt)
scom_apt <- (lm(logreturn$scom ~ logreturn$infer+logreturn$us_dollar+
logreturn$ibr+logreturn$tb+logreturn$crrr+logreturn$cbr))
summary(scom_apt)
residual14 <- residuals(scom_apt)
qqnorm(residual14, main = "SCOM Q-Q PLOT");qqline(residual14)
plot(residual14, ylab = "SCOM RESIDUALS", main = "SCOM Q-Q PLOT")
dwtest(scom_apt)
#compute summary statistics of log returns;
log_RETRN_stats <- data.frame(
mean = sapply(logreturn, mean),
std_dev = sapply(logreturn, sd),
Skewness = sapply(logreturn, skewness),
ExcessKurtosis = sapply(logreturn, kurtosis),
minimum = sapply(logreturn, min),
maximum = sapply(logreturn, max)
);print(log_RETRN_stats)
#kcb
# Perform F-test for the overall model
anova_result <- anova(kcb_apt)
Appendix. R Program Codes 44
print("\nF-test result:")
print(anova_result)
#eqty
# Perform F-test for the overall model
anova_result <- anova(equity_apt)
print("\nF-test result:")
print(anova_result)
#eabl
# Perform F-test for the overall model
anova_result <- anova(eabl_apt)
print("\nF-test result:")
print(anova_result)
#sasn
# Perform F-test for the overall model
anova_result <- anova(sasn_apt)
print("\nF-test result:")
print(anova_result)
#nmg
# Perform F-test for the overall model
anova_result <- anova(nmg_apt)
print("\nF-test result:")
print(anova_result)
#KNRE
anova_result <- anova(knre_apt)
print("\nF-test result:")
print(anova_result)
#Making Predictions of the stock returns.
factors_data <- data.frame(f1 = logreturn$us_dollar,
f2 = logreturn$infer, f3 = logreturn$ibr,
f4 = logreturn$tb, f5 = logreturn$crrr, f6 = logreturn$cbr)
predicted_returns <- data.frame(
KCB_pred = predict(kcb_apt, newdata = factors_data),
Appendix. R Program Codes 45