Professional Documents
Culture Documents
Term Paper
Abstract
In this report, we will examine the impact of the performance of Saudi Enaya Cooperative
Insurance on their stock price, trying to discover trends and to select a suitable model to
predict future stock prices.
Table of Contents
Abstract ......................................................................................................................................................... 2
Introduction .................................................................................................................................................. 2
Saudi Enaya ............................................................................................................................................... 2
Time Series Trends Analysis ...................................................................................................................... 2
Data ............................................................................................................................................................... 2
Methodology................................................................................................................................................. 3
1-Trends: ................................................................................................................................................... 3
2-Independence: ....................................................................................................................................... 3
3-Stationarity: ........................................................................................................................................... 3
4-Normality: .............................................................................................................................................. 4
Data Transformation ..................................................................................................................................... 4
Trends analysis: ............................................................................................................................................. 5
Linear models ............................................................................................................................................ 5
Cyclical Trends........................................................................................................................................... 6
Conclusion ..................................................................................................................................................... 6
References and Appendix ............................................................................................................................. 7
R script: ......................................................................................................................................................... 7
Abstract
In this report, we will examine the impact of the performance of Saudi Enaya Cooperative
Insurance on their stock price, trying to discover trends and to select a suitable model to
predict future stock prices.
Introduction
Saudi Enaya
Saudi Enaya Cooperative Insurance was formed in 2011 and started commencing their
operations in 2013, since then until 2015 the company has shown a very strong performance
in terms of sales and loss ratios. But since 2015 onwards, the company has been facing very
difficult time in terms of managing their policies. In this paper we want to see the impact of
the company’s performance on their stock price. Followed by comments on the recent
strategies that the company has implemented to improve their performance.
Yt = t + Xt or t =t – 12
Data
The data was collected from Google.Finance and was checked against that actual stock prices
on Tadawul website. Some manual adjustments were made on the data to include the missing
months, those prices were taken from Tadawul website. We have considered the closing stock
prices at two time points of each month (middle and end) to allow for capturing more
information about the stock movements. The data used includes all months from beginning of
2014 until March 2021, so in total we have 174 observations.
3
Methodology
We start by plotting the time series graph to see any trends and seasonal behavior in the data.
1-Trends: as we have mentioned in the intro, Enaya has shown a deterioration in performance
since 2015, this was reflected on their stock price and showed a downward trend, with large
decrease in the variability. The stock has been stable around 40 SR for the past 3 years.
2-Independence: This can be seen by plotting Yt against Yt-1, and the ACF plot. We can see a very
strong relationship between successive time points, also from the autocorrelation functions
we can see that the data maintains high correlations for previous lags.
3-Stationarity: The data is non-stationary from the shape of the graph, and also due to:
1- non constant mean 2-variability changes over time
4-Normality: This can be checked through the Normal QQ-plot and the histogram,
From these graphs we can see that the data is not normally distributed. And the Shapiro test
gives us P-value=2.947e-13 so we will reject the normality. A considerable curvature in the
Normal QQ-plot is witnessed, and the histogram looks something like the exponential
distribution. Hence, we would try the Exponential QQ-plot to see whether the data follows the
exponential distribution or not. We can see from the plot on the right that the exponential
distribution fits the data better, but it is still negatively skewed, hence we will try to transform
the data to satisfy normality.
Data Transformation
This step is needed to fix the non-normality issue by transforming the data using the Box-Cox
transformation. To do so, we use the function BoxCox(Data ,lambda = "auto") in R, which results in
lambda to be between [-0.415 , 5x10-4] and the optimal lambda to be λ = -0.2070947.
After applying the transformation, we can
see from the new QQ-plot that our
transformation did not solve the non-
normality. This is because Box-Cox
transformation works for skewed data, while
it fails for data sets that have small min to
max value ratio.
Trends analysis:
The previous data analysis was taking into account the whole available data on Enaya stock
prices. Considering a very long-time-horizon could potentially be misleading as those past
years might be irrelevant. The performance of the company, along with their strategies have
obviously changed. This makes as willing to consider those diagnostics for the most recent
years to discover any trends in the data.
The company’s performance started showing more stability in 2018, and since then until 2020
the stock price has been quite stable. By the beginning of 2020, the company started
implementing reformative strategies, which were reflected on the stock price. Since 2020 the
stock has been slightly increasing.
To discover trends in the data, we will apportion the data into three time frames based on the
company’s performance, For each of these periods, we are going to test both Linear
deterministic trends & cyclical trends through seasonal means.
Linear models
Cyclical Trends
We will now consider fitting cyclical trend models satisfying Yt = t + Xt such that t = t – 24 . note
that we are comparing t with the one that is 24 periods before. This is because we are using
two time points for each month, so 24 periods annually.
We fit the seasonal means models for each of the periods independently:
Conclusion
We have seen a potential increasing trend in Enaya stock
price, this could be an evidence of an improvement in
performance. especially after the management’s
announcement in 2019 about new management
restructuring operations, and merger with Amana Insurance
and advancing company performance.
https://www.isixsigma.com/topic/box-cox-wont-transform/
https://www.analyticsvidhya.com/blog/2015/12/complete-tutorial-time-series-modeling/
R script:
library(TSA)
library(MASS)
library(tseries)
library(forecast)
library(readxl)
library(xts)
library(munsell)
library(tidyverse)
#Data
p=ts(s.d$Price,start = 2014,frequency = 24) # converts the list data into time series format
acf(as.vector(p),xaxp=c(0,24,12),main="ACF",col = "#006600")
pacf(as.vector(p),xaxp=c(0,25,25),main="PACF",col = "#006600")
## Normal QQ Plot
qqnorm(p,col = "#006600",pch=20)
## Exponential QQ Plot
qqplot(x=qexp(ppoints(100)), y=p,col = "#006600", main="Exponential Q-Q Plot",xlab="Theoretical Quantiles", ylab= "The Data
Quantiles")
##Histogram
shapiro.test(p)
#Transform
z=as.matrix(p)
show(z)
BoxCox(z,lambda = "auto")
bestNormalize::boxcox(z)
p.tran=p^(-0.2070947)
qqnorm(p.tran,col = "#006600",pch=20,main="Lambda=-0.21")
t1=ts(trend1$Price1,start = 2014,end = 2016,frequency = 24) # converts the list data into time series format
show(t1)
t1=head(t1,-1) #to remove the last zero element - Run Only once !
t2=ts(trend1$Price2,start = 2016,end = 2018,frequency = 24) # converts the list data into time series format
show(t2)
t2=head(t2,-1) #to remove the last zero element - Run Only once !
t3=ts(trend1$Price3,start = 2018,end = 2022,frequency = 24) # converts the list data into time series format
show(t3)
t3=head(t3,-19) #to remove the last zero element - Run Only once !
m1=lm(t1~seq(1,48))
summary(m1)
m2=lm(t2~seq(1,48))
summary(m2)
m3=lm(t3~seq(1,78))
summary(m3)
win.graph(width=30,height=15,pointsize=10)
par(mfrow = c(3,1))
t1.seas.=season(t1)
summary(m1.seas)
t2.seas.=season(t2)
summary(m2.seas)
t3.seas.=season(t3)
summary(m3.seas)
win.graph(width=30,height=15,pointsize=10)
plot(y=rstudent(m1.seas),x=as.vector(time(t1)),xlab='Time',
win.graph(width=30,height=15,pointsize=10)
plot(y=rstudent(m2.seas),x=as.vector(time(t2)),xlab='Time',
win.graph(width=30,height=15,pointsize=10)
plot(y=rstudent(m3.seas),x=as.vector(time(t3)),xlab='Time',
class(m1)