^ D I V E R S I T Y OF M O R A T U W A . SRI I A M K . - MORATUWA TIME SERIES ANALYSIS OF A L L SHARE PRICE INDEX & SECTOR INDICES Master Of Science In Operational Research P.S.U. Pathiratne Faculty of Engineering University of Moratuwa February 2010 University of Moratuwa 100856 1 0 0 8 5 6 0 c Abstract In the recent past, stock market trading became one of the most important factors in a country. Colombo Stock Exchange (CSE) is the main stock exchange in Sri Lanka and All Share Price Index (ASPI) is a main index used by CSE. ASPI indicates the price fluctuations of all the listed companies and covers all the traded companies during a market day. The CSE market has been divided in to 20 sectors, based on the nature of the business. Out of the 20 sector indices "Bank Finance and Insurance" (BFI) sector has become one of the most important and influential indicator on economy of Sri Lanka and it has a high influence on ASPI as well. Thus, forecasting ASPI and BFI is very important for the decision maker. Hence this study was carried out to study, the pattern of time series of ASPI and BFI and to forecast values of ASPI and BFI. The data considered for this study was from 3 r d January 2000 to 30 t h January 2009 which accommodate to 2177 daily data points in each index. The result found that the original ASPI series depicts a similar trend pattern to "S Curve" . The SLR/US $ Exchange Rate does not have an impact on ASPI. As a result a univariate time series Autoregressive Integrated Moving Average (ARIMA (2,1,2)) model was fitted to predict values of ASPI. The validity of the model was confirmed using various statistic tests. And found the predicted values of ASPI were below 5%. Thus, this model is recommended to forecast ASPI. Thus, BFI sector has a high influence on ASPI with the most number of companies coming under it. Hence, tried to fit a combined model to predict values of BFI. The Granger causality test and cointegration test confirmed that BFI is influenced by 10 sector indices and with a lag length of 3 for each sector index. Hence, a Vector Autoregression (VAR) model was identified as the predictive model to forecast values of BFI. The percentage error for the forecasted values of BFI also varied between 0.44% and 4.83% ensuring the suitability of the model. Thus, this model is also recommended to forecast BFI. i D e c l a r a t i o n hereby certify that this dissertation entitled "Time Series Analysis of All Share Price idex & Sector Indices" does not incorporate, without acknowledgement, any material reviously submitted for a Degree or Diploma in any University and to the best of my nowledge and belief, it does not contain any material previously published or written by nother person or myself except where due reference is made in the text. I also hereby ive consent for my dissertation, if accepted, to be made available for photocopying and )r interlibrary loans, and for the title and summary to be made available to outside rganizations. Date: ..9?. J.Q$../..%?.! o Irs. P.S.U. Pathiratne Acknowledgement It is with gratification that I take this opportunity to express my heartiest gratitude to all the well-wishers who helped me in formulating this project a success. First of all, it is with great respect that I forward my extreme gratitude to my supervisor cum course coordinator Mr. T.M.J.A. Cooray, Head of Department of Mathematics. His guidance and attention towards success strengthened my potential to face all the hardships that came across while completing this study. His remarkable knowledge and infinite experience were the driving forces behind the achievement of my project. Words alone will not suffice to convey my gratefulness to him since he was sacrificing a great deal of his valuable time to provide me with relevant materials and all the advice to take this project to perfection. I'm lucky to receive his service throughout this study. Further, I wish to express my appreciation to Dr. T.S.G. Peiris, Senior lecturer, Department of Mathematics, providing immense support and advice in completing the project successfully. I acknowledge with thanks to all the lecturers and all the staff members in the Department of Mathematics, who helped me in numerous ways. Again I wish to grant my sincere thanks to everyone who supported me to make this project a success. Last but not least, I present my appreciation to my family and my friends who were behind me, encouraging and directing me towards the success of my project. iii D e d i c a t e d t o Amma & Thaththa W i t h o u t y o u r p a t i e n c e , u n d e r s t a n d i n g , s u p p o r t , & m o s t o f a l l l o v e , t h e c o m p l e t i o n o f t h i s w o r k w o u l d n o t h a v e b e e n p o s s i b l e iv • Table of Contents Abstract i Declaration ii Acknowledgement iii Dedication iv Table of contents v List of tables ix List of figures xi c h a p t e r 1 Introduction l 1.1 General Context and Background 2 1.1.1 Stock Market 2 1.1.2 Stock Exchange 3 1.1.3 Primary Market 4 1.1.4 Secondary Market 5 1.1.5 An Overview of Colombo Stock Exchange 7 1.1.6 Stock Market Index 9 1.1.7 All Share Price Index 9 1.1.8 Sector Indices 10 1.1.9 An Overview of Foreign Exchange Rate 1 3 1.2 Importance of the Study 15 1.3 Objectives of the Study 16 1.4 Data for the Study 16 1.5 Outline of the Thesis 16 c h a p t e r 2 Literature Review 1 8 2.1 Approaches in Predicting and Identifying the Variability of ASPI 1 9 2.2 Applications of Autoregressive Integrated Moving Average (ARIMA) and VAR Models 22 c h a p t e r 3 Theory and Methodology 2 5 3.1 Price Indices of Colombo Stock Exchange 26 3.1.1 All Share Price Index 26 3.1.2 Sector Indices 27 3.2 Foreign Exchange Rate 27 3.2.1 SLRAJS $ Exchange Rate 27 3.3 Descriptive Statistics 27 3.3.1 Histogram of Residuals 28 3.3.2 Mean Absolute Percentage Error 28 3.3.3 Mean Absolute Deviation 29 3.3.4 Mean Square Deviation 29 3.3.5 Skewness 29 3.3.6 Kurtosis 30 3.3.7 Jarque-Bera Statistics 31 3.3.8 Normal Probability Plot 31 3.4 Time Series Analysis 32 3.4.1 Objectives of Time Series Analysis 33 3.4.2 Types of Variation in Time Series 34 3.4.3 Properties of Time Series 35 3.5 Univariate Time Series 42 3.5.1 Probability Models of Time Series 42 3.5.2 Box-Jenkins Methodology of Model Building 47 3.6 Multivariate Time Series 55 3.6.1 Cross Correlation 56 3.6.2 Granger Causality 57 3.6.3 Cointegration 58 3.6.4 Vector Autoregression 61 CHAPTER 4 Statistical Analysis Of ASPI 6 5 4.1 Description 66 4.2 Analyzing ASPI Data Series 66 * 4.2.1 Diagnostic Check of ASPI 66 4.2.2 Analyzing Time Series Plot of ASPI 68 4.2.3 Analyzing the Trend of ASPI 69 4.2.4 Obtaining ACF and PACF Graphs of Original Series 71 4.2.5 Obtaining ACF and PACF Graphs of First Difference Series 72 4.2.6 Unit Root Test for the First Difference Series of ASPI 73 4.3 Analyzing SLR/US $ Exchange Rate Data Series 74 4.3.1 Diagnostic Check of SLR/USS Exchange Rate 75 4.3.2 Analyzing Time Series Plot of SLR/US $ Exchange Rate 76 4.3.3 Analyzing the Trend of SLR/US $ Exchange Rate 77 4.3.4 Obtaining ACF and PACF Graphs of Original Series 79 4.3.5 Obtaining ACF and PACF Graphs of First Difference Series 80 4.3.6 Unit Root Test for the First Difference Series of SLR/US $ Exchange Rate 81 4.4 Examining the Combined Series - ASPI and SLR/US $ Exchange Rate 82 4.4.1 Comparing the Trend Graphs of the Two Original Series 83 4.4.2 Obtaining the Cross Correlation of the Two Original Series 84 4.4.3 Granger Causality Test for the Two Original Series 84 4.4.4 Cointegration Test for the Two Original Series 85 4.5 Forming a Suitable Model to Forecast Values of ASPI 86 vi 4.5.1 Box-Cox Transformation for ASPI 86 4.5.2 Time Series Plot of Transformed Data of ASPI 87 4.5.3 Obtaining ACF and PACF Graphs of Transformed Series 88 4.5.4 Unit Root Test for the First Difference of Transformed Series 90 4.5.5 Time Series Plot of First Difference of Transformed ASPI Series 91 4.5.6 ARJJV1A Model Selection for Transformed ASPI Series 92 4.6 Forming a Suitable Model to Forecast "Short Term" Values of ASPI 93 4.6.1 Diagnostic Check of Short Term ASPI Series 93 4.6.2 Analyzing Time Series Plot of ST-ASPI 94 4.6.3 Obtaining ACF and PACF Graphs of ST-ASPI Series 94 4.6.4 Obtaining ACF and PACF Graphs of First Difference Series 95 4.6.5 Box-Cox Transformation for ST-ASPI 96 4.6.6 Time Series Plot of Transformed ST-ASPI Series 97 4.6.7 Obtaining ACF and PACF Graphs of Transformed ST-ASPI Series 98 4.6.8 Obtaining ACF and PACF Graphs of First Differenced Transformed ST-ASPI Series 99 4.6.9 Unit Root Test for the First Difference of Transformed ST-ASPI Series 100 4.6.10 Time Series Plot of First Difference of Transformed ST-ASPI Series 101 4.6.11 ARJMA Model Selection for Transformed ST-ASPI Series 102 4.6.12 Diagnostic Check of the Selected Model 103 4.6.13 Testing the Significance of the Model 106 4.6.14 ARJJVLA(2,1,2) Model After Removing the Constant 106 4.6.15 Mathematical Formula of ARTMA(2,1,2) Model 109 4.6.16 Obtaining Forecasts for Transformed ST-ASPI 111 4.6.17 Obtaining Short Term Forecasts for ASPI 111 CHAPTER 5 Statistical Analysis Of BFI 113 5.1 Description 114 5.2 Analyzing BFI Data Series 114 5.2.1 Diagnostic Check of BFI 114 5.2.2 Analyzing Time Series Plot of BFI 116 5.2.3 Analyzing the Trend of BFI 117 5.2.4 Obtaining ACF and PACF Graphs of Original Series 119 5.2.5 Obtaining ACF and PACF Graphs of First Difference Series 120 5.2.6 Unit Root Test for the First Difference Series of BFI 121 5.3 Analyzing Other Sector Indices 122 5.3.1 Diagnostic Check of Other Sector Indices 122 5.3.2 Analyzing Time Series Plots of Other Sector Indices 123 vi * 5.3.3 Unit Root Test for the Original Series of Other Sector Indices 125 5.3.4 Unit Root Test for the First Difference Series of Other Sector Indices 125 5.4 Tests to Find the Relationship between BFI and Other Sector Indices 126 5.4.1 Pairwise Correlation of BFI with Other Sector Indices 126 5.4.2 Granger Causality Test for BFI and Other Sector Indices 126 5.4.3 Cointegration Test for BFI, BFT,C&P,INV,OIL, PLT, S&S, SRV, TRD, DIV and F&T 127 5.5 Obtaining a Suitable Model to Forecast Values of BFI Index 130 5.5.1 Obtaining VAR Lag Length 130 5.5.2 Obtaining VAR Model 131 5.5.3 Obtaining Forecasts for BFI 135 CHAPTER 6 Discussion and Conclusion 137 6.1 Discussion 138 6.1.1 Results of ASPI 138 6.1.2 Results of BFI 139 6.2 Conclusion 140 6.3 Suggestions for Further Work 140 References 141 Appendix 144 vii • List of Tables Table No Page No 1.1 Market Sector Indices Listed Under CSE 8 1.2 Key Functions of Market Sectors 12 3.1 Appropriate Values for Box-Cox Transformation 48 3.2 Characteristics of Theoretical ACF and PACF for Stationary Processes 49 4.1 Accuracy Measures of Trend Models 70 4.2 ADF Test for 1 s t Difference Series - without Intercept or Trend 73 4.3 ADF Test for 1 s t Difference Series - with Intercept 73 4.4 ADF Test for 1 s t Difference Series - with Trend and Intercept 74 4.5 Accuracy Measures of Trend Models 78 4.6 ADF Test for 1 s t Difference Series - without Intercept or Trend 81 4.7 ADF Test for 1 s t Difference Series - with intercept 81 4.8 ADF Test for Ist Difference Series - with Trend and Intercept 82 4.9 Granger Causality Test with lag 1 84 4.10 Regression Results of ASPI and SLR/US $ Exchange Rate 85 4.11 ADF Unit Root Test on Residual Series 86 4.12 ADF Test for 1 s t Difference Series - without Intercept or Trend 90 4.13 ADF Test for 1 s t Difference Series - with Intercept 90 4.14 ADF Test for 1 s t Difference Series - with Trend and Intercept 91 4.15 ARJLMA Models for Transformed ASPI Series 93 4.16 ADF Test for 1 s t Difference Series - without Intercept or Trend 100 4.17 ADF Test for 1 s t Difference Series - with Intercept 100 4.18 ADF Test for 1 s t Difference Series - with Trend and Intercept 101 4.19 AROMA Models for Transformed ST-ASPI Series 102 4.20 ARTMA Model Selection for Transformed ST-ASPI Series 103 4.21 Parameter Estimates of ARIMA (2 ,1 ,2 ) 106 4.22 Parameter Estimates of ARTMA (2, 1,2) 107 4.23 Forecasts Vs Actuals of Transformed ST-ASPI 111 4.24 Forecasts Vs Actuals of ST-ASPI 112 5.1 Accuracy Measures of Trend Models 118 5.2 ADF Test for 1 s t Difference Series - without Intercept or Trend 121 5.3 ADF Test for 1 s t Difference Series - with Intercept 121 5.4 ADF Test for 1 s t Difference Series - with Trend and Intercept 122 5.5 ADF Test for Original Series - Without Intercept or Trend 125 5.6 ADF Test for 1 s t Difference Series - Without Intercept or Trend 126 5.7 Summary of Granger Causality Test 127 5.8 Johansen Cointegration Test Summary 128 ix • 5.9 Johansen Cointegration Test for "No deterministic Trend"- No Intercept or Trend 128 5.10 Cointegrating Equation Table 129 5.11 VAR lag Order Selection Table 130 5.12 Forecasts Vs Actuals of BFI Sector Index 136 i x • List of Figures Figure No Page No 1.1 Annual Variation of SLR to US $ Exchange Rate 13 3.1 Histogram of Normal Distribution 28 3.2 Positively and Negatively Skewed Graphs 30 3.3 Normal Probability Plot 32 3.4 Time Series Plot of ASPI 33 3.5 ACF 36 3.6 PACF 37 3.7 Box-Cox Plot 48 3.8 Flow Diagram of Box-Jenkins Modeling Approach 54 4.1 Histogram of Residuals of ASPI 67 4.2 Normal Probability Plot of Residuals of ASPI 68 4.3 Time Series Plot of ASPI 68 4.4 Trend Analysis Plot of ASPI - Linear 69 4.5 Trend Analysis Plot of ASPI - Quadratic 69 4.6 Trend Analysis Plot of ASPI - Exponential Growth 70 4.7 Trend Analysis Plot of ASPI- S-Curve 70 4.8 ACF and PACF Graphs of ASPI Series 71 4.9 ACF and PACF Graphs of 1 s t Difference Series 72 4.10 Histogram of Residuals of SLR/US $ Exchange Rate 75 4.11 Normal Probability Plot of Residuals of SLR/US $ Exchange Rate 76 4.12 Time Series Plot of SLR/US $ Exchange Rate 76 4.13 Trend Analysis Plot of SLR/US $ Exchange Rate - Linear 77 4.14 Trend Analysis Plot of SLR/US $ Exchange Rate - Quadratic 77 4.15 Trend Analysis Plot of SLR/US $ Exchange Rate - Exponential 78 4.16 Trend Analysis Plot of SLR/US $ Exchange Rate- S-Curve 78 4.17 ACF and PACF Graphs of SLR/US $ Exchange Rate Series 79 4.18 ACF and PACF Graphs of 1 s t Difference Series 80 4.19 "S-Curve Trend Model" of ASPI 83 4.20 "Quadratic Trend Model" of SLR/US $ Exchange Rate 83 4.21 Cross Correlation of ASPI and SLR/US $ Exchange Rate 84 4.22 Box-Cox Plot of ASPI 87 4.23 Time Series Plot of Transformed ASPI Series 87 4.24 Trend Analysis Plot of Transformed ASPI 88 4.25 ACF and PACF Graphs of Transformed Series 88 4.26 ACF and PACF Graphs of 1 s t Difference Transformed Series 89 4.27 Time Series Plot of 1 s t Differenced Transformed ASPI Series 92 4.28 Histogram of Residuals of ST-ASPI Series 93 4.29 Time Series Plot of ST-ASPI Series 94 xi 4.30 ACF and PACF Graphs of ST-ASPI Series 95 4.31 ACF and PACF Graphs of 1 s t Difference ST-ASPI Series 96 4.32 Box-Cox Plot of ST-ASPI 97 4.33 Time Series Plot of Transformed ST-ASPI 97 4.34 ACF and PACF Graphs of Transformed Series 98 4.35 ACF and PACF Graphs of 1 s t Difference Transformed ST-ASPI Series 99 4.36 Time Series Plot of 1 s t Differenced Transformed ST-ASPI Series 102 4.37 ACF Graph of ARTMA (2, 1, 2) 104 4.3 8 PACF Graph of ARTMA (2, 1,2) 104 4.39 Histogram of Residuals of ARTMA (2 ,1 ,2) 105 4.40 Normal Probability Plot of Residuals of ARTMA (2 ,1 , 2) 105 4.41 ACF Graph of ARTMA (2 ,1 , 2) without Constant Term 107 4.42 PACF Graph of ARTMA (2, 1, 2) without Constant Term 108 4.43 Histogram of Residuals of ARTMA (2 ,1 , 2) without Constant 108 4.44 Normal Probability Plot of Residuals of ARTMA(2, 1, 2) without Constant 109 4.45 Time Series Plot of ASPI with Forecasts 112 5.1 Histogram of Residuals of BFI 115 5.2 Normal Probability Plot of Residuals of BFI 116 5.3 Time Series Plot of BFI 116 5.4 Trend Analysis Plot of BFI - Linear 117 5.5 Trend Analysis Plot of BFI - Quadratic 117 5.6 Trend Analysis Plot of BFI - Exponential Growth 118 5.7 Trend Analysis Plot of BFI- S-Curve 118 5.8 ACF and PACF Graphs of BFI Series 119 5.9 ACF and PACF Graphs of 1 s t Difference Series 120 5.10 Time Series Plots of BFT, C&P, C&E, DTV, F&T Sector Indices 123 5.11 Time Series Plots of H&T, INV, L&P, MFG, MTR Sector Indices 124 5.12 Time Series Plots of OIL, PLT, SRV, S&S, TRD Sector Indices 124 5.13 Time Series Plot of Actual Values Against Forecasted Values of BFI 136 xii