1. Project report
On
Study and Forecasting of Financial Time Series Data
By
AMAR SUBHASH PATIL
AMIT BALKRISHNA DOIFODE
HEENAKAUSHAR INAYATBHAI VHORA
MANISHA JAYANTILAL KANANI
PRAMOD BALKRISHNA GHADAGE
SACHIN KRISHNA RASANKAR
TRUPTI RAMESHBHAI RATHOD
1
2. Introduction
Stock Market
When people talk about the Stock Market, it's no always immediately clear what
they're referring to. Is the Stock Market a place? Or is it something different? To
many people it is an abstract idea. They buy stocks in "the stock market" without ever
leaving the comfort of their computer terminal. But the stock market is indeed a
physical place with buildings and addresses, a place you can go visit.
2
3. Current Stock Market
The current "stock market" is comprised of 300,000 computers situated on pro
trader's desks. These computers are networked together using sophisticated protocols.
This level of information sharing makes pricing an almost exact science.
These 300,000 computers are further linked to another 26 million computers
worldwide. These computers are located in banks, small businesses, and large
corporations. These computers comprise the banking networks which make
computerized transactions possible.
Finally, these computers are connected to another 300 million+ computers
which connect and disconnect from the financial markets daily. In New York City
alone, these transactions amount to over $2.2 trillion dollars daily
3
4. Bombay Stock Exchange (BSE)
The Bombay Stock Exchange is known as the oldest exchange in Asia. It traces
its history to the 1850s, when stockbrokers would gather under banyan trees in front
of Mumbai's Town Hall. The location of these meetings changed many times, as the
number of brokers constantly increased. The group eventually moved to Dalal Street
in 1874 and in 1875 became an official organization known as 'The Native Share &
Stock Brokers Association'. In 1956, the BSE became the first stock exchange to be
recognized by the Indian Government under the Securities Contracts Regulation
Act.It is the 11th
largest Stock Exchange in the world.
4
5. Two main goals of the time series analysis
There are two main goals of time series analysis:
(a) identifying the nature of the phenomenon represented by the
sequence of observations
(b) forecasting (predicting future values of the time series variable).
Both of these goals require that the pattern of observed time-
series data is identified
5
6. Identifying Patterns in Time Series Data
Systematic pattern and random noise
Two general aspects of time series patterns
1. Trend Analysis
I. Smoothing
II. Fitting a function
2. Analysis of Seasonality
White Noise
Autocorrelation Correlogram (ACF)
Partial Autocorrelation Correlogram (PACF)
Removing serial dependency
6
7. TIME SERIES MODELS
The task facing the modern time-series econometrician is to develop
reasonably simple models capable of forecasting, interpreting, and testing
hypotheses concerning economic data. . The challenge has grown over time
the original use of time-series analysis was primarily as an aid to forecasting.
As such, a methodology was developed to decompose a series into a trend, a
seasonal, a cyclical, and an irregular component. Uncovering the dynamic
path of a series improves forecast accuracy. . Using the time-series methods,
it is possible to decompose this series into the trend, seasonal, and irregular
components.
7
8. Autoregressive Model
As stationary process is somewhat parsimonious with parameter. But it
is not sufficiently parsimonious similar to the general non-stationary
process. The problem is that there are infinite number of parameters.
What we need is the class of stationary time series model with only finite
parameters preferably small number of parameters. That’s why the simplest
autoregressive (AR) models are used.
8
9. AR (1) Process
Most time series consist of elements that are serially dependent in the
sense that one can estimate a coefficient or a set of coefficients that describe
consecutive elements of the series from specific, time-lagged (previous) elements.
This can be summarized in the equation:
Note that an auto regressive process will only be stable if the parameters are
within a certain range for example if there is only one autoregressive parameter then
it must fall within the interval of -1<a<1. Otherwise, that is, the series would not be
stationary. If there is more than one autoregressive perimeter similar restriction on the
perimeter values can be defined.
titi
p
i
t xyaay
1
0
9
10. Moving Average(1) Process
Independent from the autoregressive process, each element in the seriese can also be
affected by the past error that can’t be accounted for by the auto regressive component that is :
yt= a0 +
q
i
i
0
There is “ duality “ between the moving average process and the autoregressive process,
that is, the moving average equation above can be rewritten into an autoregressive form.
However , analogous to the stationarity condition described above, this can only be done if the
moving average parameter follow certain condition, that is, if the model is invertible. Otherwise
the series will not be stationary.
10
11. ARMA model
An autoregressive model of order p is conventionally classified as
AR(p). A moving average model with q terms is classified as MA(q). A
combination model containing p autoregressive terms and q moving average
terms is classified as ARMA (p, q).
It is possible to combine a moving average process with a linear
difference equation to obtain an autoregressive moving average model.
Consider the p-th order difference equation:
titi
p
i
t xyaay
1
0 ……………… (6)
Now let { xt } be the MA (q) process so from white noise process
11
12. 0
q
t i
i
X
so that we can write,
yt= a0 +
p
i
ia
1
yt-i +
q
i
i
0
We follow the convention of normalizing units so that β0 is always equal to unity. If the
characteristic roots of above equation are all in the unit circle, {yt} is called an autoregressive
moving-average (ARMA) model for yt. The autoregressive part of the model is difference
equation is given by the homogeneous portion of and the moving average part is the xt
sequence.
If the homogeneous part of difference equation contains p lags and the model for xt contains q
lags, the model is called an ARMA(p,q) model, i.e., the model with the p AR parameters, q MA
parameters and the variance of the error term
12
13. ARIMA model
If the object series is differenced d times to achieve stationarity, the
model is classified as ARIMA (p, d, q), where the symbol "I" signifies
"integrated." An ARIMA(p,0,q) is the same as an ARMA(p, q) model; likewise,
an ARIMA(p,0,0) is the same as an AR(p) model, and an ARIMA(0,0,q) is the
same as an MA(q) model
13
14. Data analysis steps
First of all we have to check whether the given time series is stationary or not,
if not then we try to make it stationary by taking difference. Most of the
financial time series become stationary by taking first order differentiation.
Identify the parameters p and q of AR( p), MA(q) from the correlogram ACF
and PACF. From ACF we can identify the parameter q and from PACF we
identify the parameter p.
We now fit the ARIMA (p, d, q) model and estimate the parameters of the
model. If the parameters are not significant then we choose another
combination of p and q and fit another model and identify the appropriate p
and q by trial and error.
14
15. Check the Model Selection Criteria for identifying the best model.
Find predicted value for in-sample period and save the residuals.
Check the normality assumption for the model residuals.
If the residual is not normally distributed than detect the influential points
which affect the normality assumption. And try to make it normal.
Generate the normal deviate from mean and variance which obtain in above
step .
Find the future predicted value from the fitted model replacing the error terms
by generated normal deviate.
Interpret the result.
15
18. Interpretation (ACF):-
Here, we have to examine that the consecutive lags re normally
dependent or not, i.e. the first element is closely related to the second, and the
second to the third which determine the serial dependency. In the above figure
alternating positive and negative decaying, so we can predict that there is an MA
model effects are there in the model. In the above figure, we make the assumption
lag q of the ARMA(p,q) model. It was found that they were stationary and it has
single large spike which is significant. So, we take q=1
18
20. Interpretation (PACF):-
In the above figure, we make the assumption lag p of the ARMA (p,
q) model. It was found that they were stationary and it has single large spike
which is significant. So, we take p=1. From the above correlogram we get
p=1 and q=1. We fit ARIMA (1, 0, 1) model . We have choosen
ARIMA(1,0,1) in which auto regressive perameter( AR) i.e. p is 1
differencing parameter d=0 as our data on return is stationary and moving
average perameter MA i.e. q=1. These perameter s are choosen from ACF
and PACF graph.
20
21. Time Series Modeler
Model Fit
Fit Statistic Mean
Stationary R-squared 0.061
R-squared 0.061
RMSE 0.16
MAPE 176.6
MaxAPE 2477.7
MAE 0.10
MaxAE 1.11
Normalized BIC -3.53
Model Description
ARIMA(1,0,1)Model_1returnModel ID
Model Type
21
22. ARIMA Model Parameters
Estimate SE T Sig.
return-
Model_1
return No
Transformation
Constant 0.03219 0.002311 13.9264 2.08E-27
AR Lag 1 0.858689 0.082952 10.35163 1.28E-18
MA Lag 1 0.998545 0.803012 1.243499 0.215957
Interpretation:-
The above table gives interpretation of ARIMA(1,0,1) from the table it is clear that the estimate
of constant is 0.03219, estimate of AR is 0.858689 and estimate of MA is 0.998545. Standared
error of constant and coefficient of AR lag1 is very small which is near to zero.
22
23. Therefore these two parameters are statistically significant. It is also see from p-value criteria
i.e. if p-value is greater than 0.05 which means that we can’t reject the null hypotheses that
estimates are statistically insignificant. It is clear from the above table that the estimates of
constant and coefficient of AR lag1 are statistically significant. And the estimate of MA is
statistically insignificant. The Computed model is as follows.
𝑅𝑡= 𝛽0 + 𝛽1 𝑅𝑡−1 + 𝜀𝑡
𝑅𝑡=0.03219 +0.858689∗ 𝑅𝑡−1 + 𝜀𝑡
and the predicted value can be find from
𝑅𝑡= 𝛽0 + 𝛽1 𝑅𝑡−1
23
24. Graph for return and predicted values
Interpretation:-
Here we can see from the graph that predicted value obtained
from the model is near to the original value so we can say that
our predictive model is good for the in-sample-data.
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1
8
15
22
29
36
43
50
57
64
71
78
85
92
99
106
113
120
127
return
predicted
24
25. K-S test for checking normality assumption
In the K-S test our null hypotheses is : The test distribution is
normal. And from the p-value we do not reject our null
hypotheses. So, we can say that our model residual is normally distributed.
One-Sam ple Kolm ogorov-Sm irnov Test
131
-.0037
.12701
.059
.059
-.057
.672
.757
N
Mean
Std. Deviation
Normal Parameters a,b
Absolute
Positive
Negative
Most Extreme
Differences
Kolmogorov-Smirnov Z
Asymp. Sig. (2-tailed)
Noise
residual from
VAR00003-
Model_1
Test distribution is Normal.a.
Calculated from data.b.
25
26. MRF Forecast plot:-
From the above chart display the forecast value of return, It is easy to see from the graph that
the value of the return are in increasing trend and it may continue increasing with time.
26