APPLICATION OF TIME SERIES IN PREDICTING THE WATER LEVELS OF THE AKOSOMBO DAM BY DAVID MENSAH 10060632 A THESIS SUBMITTED TO THE UNIVERSITY OF GHANA, LEGON, IN PARTIAL FULFILLMENT FOR THE AWARD OF THE MASTER OF PHILOSOPHY DEGREE IN STATISTICS MAY, 2013 University of Ghana http://ugspace.ug.edu.gh DECLARATION This work was solely undertaken by David Mensah as a result of a research work under the supervision of Dr. Kwabena Doku-Amponsah. Student: David Mensah (ID 10060632) Department of Statistics University of Ghana, Legon …………………………… Signature ……………………………. Date Supervisor: Dr. Kwabena Doku-Amponsah Department of Statistics University of Ghana, Legon. …………………………………. Signature ………………………………… Date ii University of Ghana http://ugspace.ug.edu.gh DEDICATION This work is dedicated to my wife Bridget Adubea Boateng my father, Mr. Patrick Mensah, and my late mother Rosina Ansaa Panti. To my lovely wife, I say thank you for standing by me throughout all these years. You are indeed the best thing that could ever happen to me. I love you so much. I say thank you father for giving me the opportunity to read and write. To mum, I say thank you for the continuous advice you gave me during your stay on this earth. May the Lord give you a good resting place. To my unborn children, I say, “there is no substitute for hardwork”. iii University of Ghana http://ugspace.ug.edu.gh ACKNOWLEDGEMENT ‘IN HIS OWN TIME, HE MAKES THINGS BEAUTIFUL”. I thank our Heavenly Father, Jehovah Jireh, for making it possible for me to finish this work. Many thanks goes to my supervisor, Dr. Kwabena Doku-Amponsah of the Statistics Department, University of Ghana Legon , for his continual support. He continuously said to me, “David it is your work and so you got to finish it”. These words carried much weight and it is those words that helped me finish my work. I am also highly indebted to Dr. Ezekiel Nortey of the Statistics Department, University of Ghana Legon. He spent a great deal of time with me on this project. His contribution to the methodology and analysis really paved the way for me to complete the project. God richly bless you. I also want to say a big thank you to Dr. F. O Mettle for his contribution to my work. Based on his advice, I was able to properly do the analysis. Many thanks goes to my fellow students whose contribution by way of encouragement has made this project work a success. University of Ghana http://ugspace.ug.edu.gh iv TABLE OF CONTENTS TITLE PAGES Declaration ii Dedication iii Acknowledgement iv Table of Contents v Abstract ix CHAPTER ONE 1 INTRODUCTION 1 1.1 Background of study 1 1.2 Statement of the Problem 4 1.3 Objective of the Study 4 1.3.1 Specific Objectives 4 1.4 Rationale for the Study 5 1.5 Sources of data 5 1.6 Methods of Analysis 5 1.7 Organization of the study 5 CHAPTER TWO 7 LITERATURE REVIEW 7 2.1 Forecasting Tools 7 v University of Ghana http://ugspace.ug.edu.gh CHAPTER THREE 12 REVIEW OF THE TIME SERIES MODEL 12 3.1 Attributes of a Time Series 13 3.2 Component of Time Series 15 3.3 Objectives of Time Series 17 3.4 Methods of Time Series Analysis 18 3.4.1 Trend Seasonal Decomposition 19 3.4.1.1 Additive Model 19 3.4.1.2 Multiplicative Model 20 3.4.1.3 Estimating the Trend 21 3.4.2 The Box-Jenkins ARIMA Processes 22 3.4.2.1 Autoregressive (AR) processes 23 3.4.2.2 Moving Average (MA) processes 24 3.4.2.3 Autoregressive and Moving Average (ARMA) Processes 26 3.4.2.4 Autoregressive Integrated Moving Average (ARIMA) Process 28 3.4.2.5 The Box-Jenkins Seasonal (SARIMA) Model 29 3.5 Stationarity in time series 31 3.6 Autocorrelation Function 33 3.6.1 Time series plot 34 3.6.2 Lagged scatterplot 35 3.6.3 Autocorrelation function (Correlogram) 36 3.6.4 Interpreting the correlogram 40 vi University of Ghana http://ugspace.ug.edu.gh 3.7 Fitting an autoregressive process 41 3.7.1 Determining the order of an autoregressive process 45 3.8 Fitting a moving average process 46 3.8.1 Estimating the parameters of a moving average process 47 3.8.2 Determining the order of a moving average process 50 3.9 Estimating the parameters of an ARMA model 50 3.10 Estimating the parameters of an ARIMA model 51 3.11 The Box-Jenkins Seasonal (SARIMA) model 52 3.12 Residual analysis 53 CHAPTER FOUR 55 ESTIMATION AND INTERPRETATION OF TIME SERIES MODEL 55 4.1 Introduction 55 4.2 Results and discussion 55 4.3 Modeling and forecasting 58 4.3.1 Identifying the order of differencing and the constant 58 vii University of Ghana http://ugspace.ug.edu.gh 4.3.2 Identifying the numbers of AR and MA terms 59 4.3.3 Identifying the seasonal part of the model 61 4.3.4 Diagnostic Testing 72 4.3.5 Forecasting with the model 12(1,1,0) (0,1,1)× 74 CHAPTER FIVE 76 DISCUSSIONS, CONCLUSIONS AND RECOMMENDATIONS 76 5.1 Summary of Results 76 5.2 Conclusion 77 5.3 Recommendation 77 REFERENCES 79 APPENDIX 86 viii University of Ghana http://ugspace.ug.edu.gh ABSTRACT Energy from hydro-electricity is the cheapest form of power generation in this country. The Volta River Authority can however generate power optimally if water levels within the dam is between 240ft and 280ft. This is not always the case, since the only source of water for the dam is rainfall, which is also random and dependent on weather conditions. Knowledge of the water level within any month of the year will therefore be very useful in the production, distribution and management of power from the dam.The study looked at how use of time series analysis could be used in predicting the average monthly water levels of the Akosombo dam. The study took a step-by-step approach of the Box-Jenkins ARIMA process and arrived at a seasonal model 12(1,1,0) (0,1,1)× . This model turned to be a good forecast for the average monthly water levels. Per the findings in this research work, it was recommended that, if data points were in the excess of 70, then the Box-Jenkins ARIMA model can be used to predict prices of utilities such as water and electricity. Fellow statisticians were also encouraged to look at other forecasting tools such as artificial neural networks since it had very good features as the Box-Jenkins ARIMA model. ix University of Ghana http://ugspace.ug.edu.gh 1 CHAPTER ONE INTRODUCTION 1.1 Background The Akosombo Dam (also referred to as the Akosombo Hydroelectric Project), is a hydroelectric dam on the Volta River in south-eastern Ghana in the Akosombo gorge and part of the Volta River Authority. The construction of the dam flooded parts of the Volta River Basin, and the subsequent creation of Lake Volta. Lake Volta is the world's largest man-made lake, covering 8,502 square kilometers (3,283 sq mi), which is 3.6% of Ghana's land area. The primary purpose of the Akosombo Dam was to provide electricity for the aluminum industry. The Akosombo Dam was called “the largest single investment in the economic development plans of Ghana. Its original electrical output was 912 Mega Watts (MW), which was upgraded to 1,020 MW in a retrofit project that was completed in 2006. The dam was conceived in 1915 by geologist Albert Ernest Kitson, but no plans were drawn until the 1940’s. The development of the Volta River Basin was proposed in 1949, but because there were no sufficient funds, the American company Volta Aluminum Company (Valco) loaned money to Ghana so that the dam could be constructed. Kwame Nkrumah adopted the Volta River hydropower project. The final proposal outlined the building of an aluminum smelter at Tema, a dam constructed at Akosombo to power the smelter, and a network of power lines installed through southern Ghana. The aluminum smelter was expected to eventually provide the revenue necessary for establishing University of Ghana http://ugspace.ug.edu.gh http://en.wikipedia.org/wiki/Hydroelectric_dam http://en.wikipedia.org/wiki/Hydroelectric_dam http://en.wikipedia.org/wiki/Volta_River http://en.wikipedia.org/wiki/Ghana http://en.wikipedia.org/wiki/Volta_River_Authority http://en.wikipedia.org/wiki/Volta_River_Authority http://en.wikipedia.org/wiki/Lake_Volta http://en.wikipedia.org/wiki/Aluminum http://en.wikipedia.org/wiki/Megawatt http://en.wikipedia.org/wiki/Albert_Ernest_Kitson http://en.wikipedia.org/wiki/Volta_River http://en.wikipedia.org/wiki/Volta_Aluminum_Company http://en.wikipedia.org/wiki/Kwame_Nkrumah http://en.wikipedia.org/wiki/Aluminum http://en.wikipedia.org/wiki/Smelter http://en.wikipedia.org/wiki/Tema 2 local bauxite mining and refining, which would allow aluminum production without importing foreign alumina. The proposed project's aluminum smelter was overseen by the American company, Kaiser Aluminum, and is operated by Valco. The estimated total cost of the project, in its entirety, was estimated at $258 million. In 1961, the Volta River Authority (VRA) was established by Ghana's Parliament through the passage of the Volta River Development Act. The VRA's primary task is to manage the development of the Volta River Basin, which included the construction and supervision of the dam, the power station and the power transmission network. The VRA is responsible for the reservoir impounded by the dam, the fishing within the lake, lake transportation and communication, and the welfare of those surrounding the lake. The dam was built between 1961 and 1965. Its development was undertaken by the Ghanaian government and funded 25% by the International Bank for Reconstruction and Development of the World Bank, the United States, and the United Kingdom. The construction of the Akosombo dam resulted in the flooding of parts of the Volta River Basin and its upstream fields, and in the creation of Lake Volta which covers 3.6% of Ghana's total land area. Lake Volta was formed between the years of 1962 and 1966, and necessitated the relocation of about 80,000 people, that represented 1% of the population. The dam is a 660 m (2,170 ft) long and 114 m (374 ft) high rock-fill embankment dam. It has a base width of 366 m (1,201 ft) and a structural volume of 7,900,000 m³ (10,300,000 cu yd). The reservoir created by the dam, Lake Volta, has a capacity of 148 km3 (120,000,000 acre·ft) University of Ghana http://ugspace.ug.edu.gh http://en.wikipedia.org/wiki/Bauxite http://en.wikipedia.org/wiki/Kaiser_Aluminum http://en.wikipedia.org/wiki/Volta_River_Authority http://en.wikipedia.org/wiki/International_Bank_for_Reconstruction_and_Development http://en.wikipedia.org/wiki/World_Bank http://en.wikipedia.org/wiki/United_States http://en.wikipedia.org/wiki/United_Kingdom http://en.wikipedia.org/wiki/Lake_Volta http://en.wikipedia.org/wiki/Embankment_dam http://en.wikipedia.org/wiki/Reservoir 3 and a surface area of 8,502 km² (3,283 sq mi). The lake is 400 km² (150 sq mi) long. Maximum lake level is 84.73 m (278.0 ft) and minimum is 73.15 m (240.0 ft). On the east side of the dam are two adjacent spillways that can discharge approximately 34,000 m3/s (1,200,000 cu ft/s) of water. Each spillway contains six 11.5 m (38 ft) wide and 13.7 m (45 ft) tall steel floodgates. The dam's power plant contains six 170 MW Francis turbines. Each turbine is supplied with water via a 112–116 m (367–381 ft) long and 7.2 m (24 ft) diameter penstock with a maximum of 68.8 m (226 ft) of hydraulic head afforded. The dam provides electricity to Ghana and its neighboring West African countries, including Togo and Benin. Initially 20% of Akosombo Dam's electric output (serving 70% of national demand) was provided to Ghanaians in the form of electricity, the remaining 80% was generated for the American-owned Volta Aluminium Company (VALCO). In recent years the production from the VALCO plant has declined with the vast majority of additional capacity in Akosombo used to service growing domestic demand. In the beginning of 2007, there were concerns over the electricity supply from the dam due to low water levels in the Lake Volta reservoir. Some sources said this was due to problems with drought that are consequences of global warming. In 2010, the highest ever water level was recorded at the dam. This necessitated the opening of the flood gates at a reservoir elevation of 84.45 m (277 ft), and for several weeks water was spilled from the lake causing some flooding downstream. University of Ghana http://ugspace.ug.edu.gh http://en.wikipedia.org/wiki/Spillway http://en.wikipedia.org/wiki/Floodgate http://en.wikipedia.org/wiki/Francis_turbine http://en.wikipedia.org/wiki/Penstock http://en.wikipedia.org/wiki/Hydraulic_head http://en.wikipedia.org/wiki/Togo http://en.wikipedia.org/wiki/Benin http://en.wikipedia.org/wiki/Volta_Aluminium_Company 4 1.2 Statement of the Problem Knowledge of approximately what the water level of the Akosombo Dam will be tomorrow, next week or perhaps in a month’s time is very vital to the operations of the Volta River Authority(VRA) as it will enable the authority better manage production and distribution of hydro-electric power to the country and its environs. However, there isn’t any mathematical modeling procedure that is employed to predict the water levels at any given time. The water levels are recorded on daily basis and with these records, the VRA uses observed values to ascertain what the level will be in a particular month. This study seeks to investigate and provide a good model to predict the water level of the Akosombo Dam at any given time. This research work will seek to use data points of previous water levels as a basis to formulate a model to enable future predictions. 1.3 Objectives of the Study The study seeks to recommend a mathematical estimator for the water levels that can serve as a forecasting tool in determining the height of the water level of the Akosombo dam. It will hopefully pave the way for researchers to look at the area of developing and using other forecasting tools to make predictions supported by mathematical models. 1.3.1 Specific objectives 1. To examine the average monthly trends of the water level at the dam. 2. To use the established time series model to predict future levels of the water. 3. To make recommendations on the management of the dam based on forecasting results University of Ghana http://ugspace.ug.edu.gh 5 1.4 Rationale for the Study The main rationale behind this research is to add to already existing literature on the use of time series analysis for predicting future data points by using past data. By so doing, it is hoped that options will be made available to statisticians and other researchers from various fields of endeavor in the instance where these researchers are faced with problems of predicting future data points. It is further hoped that this study will serve as a catalyst for additional academic work to be done in the area of exploring some more mathematical tools in helping predict future data points. 1.5 Sources of Data Data used was obtained from the engineering department of the Volta River Authority. Data on the water levels were obtained for the periods from January 1980 to December, 2010. 1.6 Methods of Analysis In this work, we explored the process of time series analysis (that is, building, fitting and checking models) to establish a good forecasting model to predict water levels of the Akosombo dam. We specifically made use of the Seasonal Autoregressive Integrated Moving Average (seasonal ARIMA) model due to the characteristics found within the data points. The MINITAB statistical software was used in the analysis process. 1.7 Organization of the study This work has been grouped into five chapters. The first chapter gives a brief background of the project, statement of problem, objectives of the study, rationale behind the study, sources of data for the project work and methods of analysis. The Chapter Two of this work gives some University of Ghana http://ugspace.ug.edu.gh 6 literature on the time series model as well as the Akosombo dam. Chapter Three has to do with the methods employed in time series procedures. This is followed by Chapter Four where the researcher looked at the analysis. Chapter Five dealt with the discussion of results, conclusion and recommendation. University of Ghana http://ugspace.ug.edu.gh 7 CHAPTER TWO LITERATURE REVIEW Energy is a very important resource to any nation as it provides the needed power to run various machines such as production plants, automobiles and also provides power to run home appliances. Hydro-electric power is one cheap source of energy and it is the main source of electricity power for Ghana. 2.1 Forecasting Tools The production levels from the Akosombo generating station and that of Kpong, is only feasible when water levels are on the average at a minimum of 260ft. Knowledge of the water levels at every stage of power production is thus vital. Time series analysis affords us the opportunity to be able to predict such data points by use of previous data on similar events (water levels). Time series analysis has been used in predicting water levels of rivers, lakes and dams by various authors. Time series methods such as Autoregressive models (AR), Moving Averages model (MA) and Autoregressive Integrated Moving Average models (ARIMA) and Artificial Neural Networks (ANN) were employed in the forecasting process. Artificial neural networks (ANN) have been widely touted as solving many forecasting and decision modeling problems (e.g., Hiew and Green, 1992). Artificial neural networks are argued to be able to model easily any type of parametric or non-parametric process and automatically and optimally transform the input data. These sorts of claims have led to much interest in University of Ghana http://ugspace.ug.edu.gh 8 artificial neural networks. On the other hand, Chatfield (1993) has queried whether artificial neural networks have been oversold or are just a fad. Artificial neural networks and traditional time series techniques have been compared in several studies. The best of these studies have used the data from the well-known "M-competition" (Makridakis et al., 1982). Makridakis et al, gathered 1001 real time series; and used a systematic sample of 111 series from the original database. In the original competition, various groups of forecasters were given all but the most recent data points in each of the series and asked to make forecasts for those most recent points. Each competitor's forecasts were then compared to the actual values in the holdout data set. The results of this competition were reported in Makridakis et al. (1982). Sharda and Patil (1990) used 75 series from a systematic sample of 111 series and found that artificial neural network models performed as well as the automatic Box-Jenkins (Autobox) procedure. In the 36 deleted series, however, neither the artificial neural network nor Autobox models had enough data to estimate the models. Foster et al. (1991) also used the M-competition data. They found artificial neural networks to be inferior to Holt's, Brown's, and the least squares statistical models for yearly data but comparable with quarterly data; they did not compare the models on monthly data. Sharda and Patil (1992) and Tang et al. (1991) found that for time series with a long memory, artificial neural network models and Box-Jenkins models produced comparable results. However, for time series with short memory, Tang et al. (1991) found artificial neural networks to be superior to Box-Jenkins. University of Ghana http://ugspace.ug.edu.gh 9 Kang (1991) compared artificial neural networks and Box-Jenkins (Autobox) on the 50 M- competition series designated by Pack and Downing (1983) to be most appropriate for the Box- Jenkins technique. Kang found Autobox to be superior or equivalent to the average of eighteen different Artificial Neural Network architectures in terms of MAPE (Mean Absolute Percentage Error). Kang also compared the eighteen artificial neural network architectures and the Autobox model on seven sets of simulated time series patterns. Kang found the MAPE for the average of the eighteen artificial neural network architectures only superior when trend and seasonal patterns were in the data. It is important to note that many have suggested that the best forecasts can be made by combining the results of several forecasting models (e.g., Makridakis and Winkler, 1985). Linear regression model is the most frequently used type of empirical model category which uses statistical techniques to simulate the variables’ relationship (Mentzer et al., 1984; Bowerman and Richard, 1990; Mays and Tung, 1992). The concept of linear regression has been applied in various applications from business and economic to engineering (Makridakis, 1984; Bowerman and Richard, 1990). Moving average models have been introduced in 1938 as a type of time series model, which opened the field of ARMA and ARIMA (Makridakis and Wheelwright, 1978). Moving average (MA) models attempt to smooth the “past history” data (Makridakis and Wheelwright, 1978). There are several types of MA methods available, such as simple moving averages, double moving averages and weighted moving averages; furthermore, MA models are not commonly used solely (Makridakis et al., 1998). University of Ghana http://ugspace.ug.edu.gh 10 Autoregressive moving average (ARMA), one of the most common methods, based on time series analysis, are models based on the combination of autoregressive model and moving average model to increase efficiency and accuracy, in contrast to moving average (MA) and autoregressive (AR) models. Besides that, the flexibility also has been enhanced (Makridakis and Wheelwright, 1978; Salas, 1980). Artificial neural network (ANN) is a systematized set of interconnected artificial neurons which was introduced for the first time by McCullouch and Pitts (1943) in basic. Artificial neural network (ANN) has shown better performance than other time series methods, such as moving average method in types of rainfall-runoff subsets, like stream flows. In addition, ANNs are more time effective and have better response in noisy tolerance in data sets (Karunanithi et al., 1994; Govindaraju, 2000). From the literature given by the many authors and the arguments that have been stressed, it will be prudent to have a look at the Autoregressive model, Moving Average model and their hybrids for the purposes of the research work. That is to say, Autoregressive moving average and the Box-Jenkins Autoregressive integrated moving average would also be examined in the methodology and analytical processes of this research. With respect to Artificial neural networks (ANN), because it is a new statistical technique which is yet to be fully developed, it will not be examined. More so, from the literature given and comparative analysis drawn from the use of various data by authors like Makridakis et al(1982), Sharda and Patil (1992) and Tang et al. (1991) among others found that there was no much difference between the ANN and the Box-Jenkins in terms of prediction effectiveness when University of Ghana http://ugspace.ug.edu.gh 11 numerous data points have been collected. Nothing will be lost if the ANN methodology is ignored from this work, since the data available for this research work is adequately enormous. University of Ghana http://ugspace.ug.edu.gh 12 CHAPTER THREE REVIEW OF THE TIME SERIES MODEL 3.1 Attributes of a time series Time series arise as recordings of processes vary over time. A recording can either be a continuous trace or a set of discrete observations. By appropriate choice of origin and scale, we can take the observation times to be 1, 2, . . .,T, and we can denote the observations by 1 2, ,..., TY Y Y . There are a number of issues which are of interest in time series analysis. The most important of these are: (i) Smoothing: The observed tY are assumed to be the result of “noise” values tε additively contaminating a smooth signal tη . Thus, t t tY η ε= + We may wish to recover the values of the underlying tη . (ii) Modeling: We may wish to develop a simple mathematical model which explains the observed pattern of 1 2, ,..., TY Y Y . This model may depend on unknown parameters and these parameters need to be estimated. (iii) Forecasting: On the basis of observations 1 2, ,....., TY Y Y , we may wish to predict what the value of T LY + will be ( )1L ≥ , and possibly to give an indication of what the uncertainty is in the prediction. University of Ghana http://ugspace.ug.edu.gh 13 (iv) Control: We may wish to intervene with the process which is producing the tY values in such a way that the future values are altered to produce a favourable outcome. Forecasting is one aspect of time series analysis which is very vital and with respect to the focus of this research, forecasting cannot be over-emphasized. The water level at any given time during the operation of the Akosombo Dam is so vital to the day to day operations of the Volta River Authority. Knowledge of future levels can therefore serve as additional working information to enable better business strategies and delivery of service to the general public. Time series analysis provides a reliable mathematical model for predicting such vital data points. Time series models such as the autoregressive (AR) models, the integrated (I) models, and the moving average (MA) models are employed in the prediction future data points (here, it will be water levels of the Akosombo Dam). These three classes depend linearly on previous data points, and with respect to this research work, previous data points will be previous data of the water levels of the Akosombo Dam. Combinations of these ideas produce autoregressive moving average (ARMA) and autoregressive integrated moving average (ARIMA) models. A time-series is a collection of observations made sequentially over time. These measurements may be made continuously through time or be taken at a discrete set of time points. By convention, these two types of series are called continuous and discrete time series respectively, even though the measured variable may be discrete or continuous in either case. In other words, for discrete time series, for example, it is the time axis that is discrete. For continuous time University of Ghana http://ugspace.ug.edu.gh http://en.wikipedia.org/wiki/Autoregressive http://en.wikipedia.org/wiki/Moving_average_model http://en.wikipedia.org/wiki/Autoregressive_moving_average http://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average http://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average 14 series, the observed variable is typically a continuous variable recorded continuously on a trace, such as hourly temperature readings. Some examples of data sets that appear as time series are particularized below: (i) Sales of a particular product in successive months (ii) The temperature at a particular location at 1:00 pm on successive days (iii) Electricity consumption in a particular area for successive three-hour periods (iv) Daily water levels of a dam, and many alike. Application of time series analysis can be employed in the following: (a) Economic planning (b) Sales forecasting (c) Inventory or stock control (d) Budgeting (e) Production and capacity planning An example of a time series graph is shown in figure 3.1 University of Ghana http://ugspace.ug.edu.gh 15 Figure 3.1 Time Series plot of US producer Price Index 12 Months Change( Finished Goods) 3.2 Components of Time Series Traditional time-series analyses are mainly concerned with decomposing the variation into Trend, Seasonal variation, Cyclic changes and Irregular fluctuations. Trend Component Trend is a long term movement in a time series. It is the underlying direction (upward or downward) and rate of change in a time series, when allowance has been made for the other components. An example is the behavior of the United Kingdom. retail price index which has shown an increase every year for many years. Trend may be loosely defined as “long-term change in the mean level”, but there is no fully satisfactory mathematical definition. University of Ghana http://ugspace.ug.edu.gh 16 Seasonal Component This type of variation is generally annual in period and arises for many series, whether measured weekly, monthly or quarterly, when similar patterns of behavior are observed at particular times of the year. It is the component of variation in a time series which is dependent on the time of the year. It describes any regular fluctuations with a period of less than one year. An example is the sales pattern for a product ice cream, which is always high in the United States during the summer season. In the case of Ghana, we can talk about the sale of umbrella which is high during the rainy season. Other examples include the costs of various types of fruits and vegetables, and average daily rainfall. All show marked seasonal variation. Note that if a time series is only measured annually (i.e. once per year), then it is not possible to tell if seasonal variation is present. Cyclic Component These are cyclical variations of non-seasonal nature, whose periodicity are unknown. These include regular cyclic variations at periods other than one year. Examples include business cycles over a period of perhaps five years and the daily rhythm (called diurnal variation) in the biological behavior of living creatures. Irregular Component These are random or chaotic noisy residuals left over when other components of the series (trend, seasonal and cyclical) have been accounted for. The phrase, ‘irregular fluctuations’, are often used to describe any variation that is ‘left over’ after trend, seasonality and other systematic University of Ghana http://ugspace.ug.edu.gh 17 effects have been removed. As such, they may be completely random in which case they cannot be forecasted. However, they may exhibit short-term correlation or include one-off discontinuities. Trend and seasonality, though conceptually distinct, are essentially entangled. The value of the series at time t essentially depends on its value at time 1t − , with the result that trend and periodic components are inextricably mixed up. Hence, it is not possible to isolate one without trying to isolate the other. The special feature of time-series data is that successive observations are usually not independent and so the analysis must take account of the order in which the observations are collected. Effectively each observation on the measured variable is a bivariate observation with time as the second variable. 3.3 Objectives of Time Series The main objectives of time-series analysis are categorized as follows: Description, Modeling, Forecasting and Control. Description This has to do with describing the data using summary statistics and graphical methods. In such an instance, time plot of the data is particularly valuable. University of Ghana http://ugspace.ug.edu.gh 18 Modeling This involves finding a suitable statistical model to describe the data generating process. A univariate model for a given variable is based only on past values of that variable, while a multivariate model for a given variable may be based, not only on past values of that variable, but also on present and past values of other (predictor) variables. In the latter case, the variation in one series may help to explain the variation in another series. Of course, all models are approximations and model building is an art as much as a science. Forecasting This involves finding estimates for the future values of the series. It must be noted that there is a clear distinction between “steady-state” forecasting, where we expect the future to be much like the past, and “What-if” forecasting where a multivariate model is used to explore the effect of changing policy variables. Control Good forecasts enable the analyst to take action so as to control a given process, whether it is an industrial process, or an economy or whatever. This is linked to “What-if” forecasting. 3.4 Methods of Time Series Analysis In the analysis of time series data, various approaches can be employed and many more are being developed. In most recent times, the method of Artificial Neural Networks to analyze data points has been the interest of many forecasters. However, as stated by Nortey (2002), the two main University of Ghana http://ugspace.ug.edu.gh 19 methods employed in the analysis of time series data are Trend-Seasonal Decomposition and the Box-Jenkins ARIMA processes. 3.4.1 Trend Seasonal Decomposition This is a direct, intuitive approach to estimating the basic components of a time series data. The components we are referring to include long-term trend, repeating seasonal pattern, medium- term wandering or cyclic movements, and irregular components. There are two methods to Trend-Seasonal decomposition: the additive model and Multiplicative model. By the additive model, Data = Trend + Seasonal + Cyclic + Irregular And by the multiplicative model Data = Trend × Seasonal × Cyclic × Irregular. (Nii Nortey 2002) 3.4.1.1 Additive Model Since time series is a component of a long term trend ( tT ), a seasonal component ( tS ) and a random component ( tR ), in the additive model the time series is the addition of the components: t t t t Y T S R= + + , t = 1, 2, 3, . . .,T From the relation above, the following assertions may arise: • If the sum of the seasonal effect and the random effect is positive, the observed value will be above the trend line. • If the sum of the seasonal effect and the random effect is zero, the observed value will line on the trend line. University of Ghana http://ugspace.ug.edu.gh 20 If the sum of the seasonal effect and the random effect is negative, the observed value will be below the trend line. Over the year seasonal effect will cancel out and so, 0 1 T Stt =∑ = . If the seasonal effects are constant over time, the seasonal effects cause fluctuations around the trend line of the same magnitude each year, irrespective of the size of the trend value. The figure 3.2 below gives a diagrammatic view of the additive model * * * * * * * * * * * * * * * * * * Figure 3.2 Additive Model graph 3.4.1.2 Multiplicative Model: In the multiplicative model the time series is the product of the three components: t t tt T S RY × ×= , t = 1, 2, 3, . . .,T • If the product of the seasonal effect and the random effect is greater than 1 the observed value will be above the trend line. University of Ghana http://ugspace.ug.edu.gh 21 • If the product of the seasonal effect and the random effect is 1 the observed value will lie on the trend line. • If the product of the seasonal effect and the random effect is less than 1 the observed value will be below the trend line. Over the year the seasonal effects should cancel out and so 1 1 t T S t = = ∏ If the seasonal effects are constant over time, then each seasonal effect is a constant proportion of the trend value. The seasonal fluctuations increase in magnitude as the trend value increases. * * * * * * * * * * * * * * * * * The figure 3.3 Multiplicative model graph 3.4.1.3 Estimating the Trend The trend line is a smooth curve drawn through the observations. Many different shapes can be used for the trend line but we will consider the most commonly used which are: (a) The linear trend; this is given by the model 0 1tT tβ β= + . This trend line is used when the time series fluctuates around a straight line. University of Ghana http://ugspace.ug.edu.gh 22 (b) The quadratic trend; this trend line is used when the time series fluctuates around a curve. This is modeled as 2 0 1 2tT t tβ β β= + + . 3.4.2 The Box-Jenkins ARIMA Processes In time series analysis, the Box–Jenkins methodology, named after the statisticians George Box and Gwilym Jenkins, applies Autoregressive Processes (AR), Moving Average processes (MA) and Integrated Processes to attain the ARMA or ARIMA models to find the best fit of a time series to past values of this time series, in order to make forecasts. A model of much practical interest is the random walk which is given by 1t t tX X Z−= + (3.1) where { tZ } denotes a purely random process. This model may be used, at least as a first approximation, for many time series arising in economics and finance (Meese and Rogoff, 1983). For example, the price of a particular share on a particular day is equal to the price on the previous trading day plus or minus the change in share price. It turns out that the latter quantity is generally not forecastable and has properties similar to those of the purely random process. The series of random variables defined by (1) does not form a stationary process as it is easy to show that the variance increases through time. However, the first differences of the series, namely ( 1t tX X −− ), do form a stationary series. The concept of Stationarity in time series, especially with particular reference to Box-Jenkins will be discussed in section 3.4. University of Ghana http://ugspace.ug.edu.gh http://en.wikipedia.org/wiki/Time_series_analysis http://en.wikipedia.org/wiki/Methodology http://en.wikipedia.org/wiki/Statistician http://en.wikipedia.org/wiki/George_Box http://en.wikipedia.org/wiki/George_Box http://en.wikipedia.org/wiki/Gwilym_Jenkins http://en.wikipedia.org/wiki/Autoregressive_moving_average http://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average http://en.wikipedia.org/wiki/Forecasting 23 The ARIMA class of models is an important forecasting tool, and is the basis of many fundamental ideas in time-series analysis. The acronym ARIMA stands for ‘autoregressive integrated moving average’, and the different components of this general class of models includes AR and MA. The original key reference is Box and Jenkins (1970), and ARIMA models are sometimes called Box-Jenkins models. The various models or processes that form the Box-Jenkins processes are discussed as follows. 3.4.2.1 Autoregressive (AR) processes A time series { tX } is said to be an autoregressive process of order p {abbreviated AR( p )} if it is a weighted linear sum of the past p values plus a random shock so that 1 1 2 2 3 3 ......t t t t p t p tX X X X ZX φ φ φ φ− − − −= + + + + + (3.2) Where tZ denotes a purely random process with zero(0) mean and variance 2 zσ . By re-arranging the expression for tX in the above equation (2) and denoting the backward shift operator by B , defined as j t t jB X X −= , such that the AR( p ) may be written as ( ) t tB X Zφ = (3.3) Where 2 3 1 2 3( ) 1 ...... p pB B B B Bφ φ φ φ φ= − − − − − is a polynomial in B of order p . The properties of AR processes defined by (2) can be examined by looking at the properties of the function φ . As B is an operator, the algebraic properties of φ have to be investigated by examining the properties of ( )xφ , say, where x denotes a complex variable, rather than by looking at ( )Bφ . It can be shown that (3) has a unique causal stationary solution provided that the roots of ( )xφ = 0 lie outside the unit circle. This solution may be expressed in the form University of Ghana http://ugspace.ug.edu.gh 24 0 t j t j j X Zψ ∞ − ≥ =∑ (3.4) for some constants jψ such that jψ∑ < ∞. The above relation is interpreted in simple terms as “an AR process is stationary provided that the roots of ( )xφ = 0 lie outside the unit circle”. The simplest example of an AR process is the first order case given as 1t ttX X Zφ −= + (3.5) The first order case of an AR usually written as AR(1) is said to be stationary provided φ <1. It is more accurate to say that there is a unique stationary solution of (5) which is causal, provided that φ <1. 3.4.2.2 Moving Average (MA) processes A time series { tX } is said to be a moving average process of order q {abbreviated MA(q)} if it is a weighted linear sum of the last q random shocks so that 1 1 ....t t q t qtZ Z ZX θ θ −−= + + + (3.6) Where { tZ } denotes a purely random process with mean zero (0) and a constant variance 2 zσ . The above equation (6) can be written as ( )t tX B Zθ= (3.7) Where 2 1 2 .....( ) 1 q qB B BB θ θθ θ + + += + is a polynomial in B of order q . It is noteworthy to state that some authors (including Box et al ., 1994) parameterize an MA process by replacing the plus signs in (6) with minus signs, presumably so that it has a similar form to ( )Bφ for AR University of Ghana http://ugspace.ug.edu.gh 25 processes, but this seems less natural in regard to MA processes. It must be stated that there is no difference in principle between the two notations but the signs of the θ values are reversed and this can cause confusion when comparing formulae from different sources or examining computer output. It can be shown that a finite-order MA process is stationary for all parameter values. However, it is customary to impose a condition on the parameter values of an MA model, called the invertibility condition, in order to ensure that there is a unique MA model for a given autocorrelation function (ACF). This condition can be explained as follows. Suppose that { tZ } and { tZ ′ } are independent purely random processes and that θ ∈ (−1, 1). Then, it can be shown that the two MA(1) processes defined by 1t t tX Z Zθ −= + and 1 1t t tX Z Zθ − −′ ′= + have exactly the same autocorrelation function. That is to say, the polynomial ( )Bθ is not uniquely determined by the autocorrelation. As a consequence, given a sample autocorrelation function, it is not possible to estimate a unique MA process from a given set of data without putting some constraint on what is allowed. To resolve this ambiguity, it is usually required that the polynomial ( )xθ has all its roots outside the unit circle. It then follows that we can rewrite (6) in the form 1 t j t j j tXX Zπ − ≥ − =∑ (3.8) for some constants jπ such that jπ∑ < ∞. University of Ghana http://ugspace.ug.edu.gh 26 In other words, we can invert the function taking the tZ sequence to the tX sequence and recover tZ from present and past values of tX by a convergent sum. The negative sign of the π coefficients in (8) is adopted by convention so that we are effectively rewriting an MA process of finite order as an AR(∞) process. 3.4.2.3 Autoregressive and Moving Average (ARMA) Processes As the name suggests, the Autoregressive and Moving Average process is a mixed Autoregressive process of order p , thus AR( p ), and the Moving Average process of order q , thus MA( q ). This is abbreviated as ARMA ( ),p q and modeled as 1 1 2 2 1 1 2 2........ ....t t t p t p t t t q t qX X X X Z Z Z Zα α α β β β− − − − − −= + + + + + + + + (3.9) Using B as the backward shift operator, the equation (9) above may be written in the form ( ) ( )t tB X B Zθφ = (3.10) Where ( )Bφ and ( )Bθ are polynomials of order p and q respectively such that ( ) 2 1 21 ..... p pB B B Bα α αφ = − − − − and ( ) 2 1 21 ..... q qB B B Bθ β β β= + + + + For an AR process, the values of { iα } which makes the process stationary are such that the roots of ( ) 0Bφ = lie outside the unit circle. In the same vein for an MA process, the values of { iβ } which makes the process invertible are such that the roots of ( ) 0Bθ = lie outside the University of Ghana http://ugspace.ug.edu.gh 27 unit circle. One of the importance of ARMA lies in the fact that a stationary time series may often be described by an ARMA model involving fewer parameters than a pure MA or AR. It is sometimes helpful to express an ARMA model in an MA model of the form ( )t tX B Zψ= (3.11) Where ( ) i iB Bψ ψ=∑ is the MA operator which may be of infinite order. The weights, { iψ }, can be useful in calculating forecasts and in assessing the properties of a model. By comparing the two equations (1.0) and (1.1), we see that ( ) ( ) ( )/B B Bψ θ φ= Alternatively, it can also be helpful to express ARMA model as a pure AR in the form ( ) t tB X Zπ = (3.12) Where ( ) ( ) ( )/B B Bθφπ = By convention, we write ( ) 1 1 i i i B Bπ π ≥ = −∑ , since the natural way to write an AR is of the form 1 t i t i t i X X Zπ ∞ − = = +∑ By comparing (1.1) a (1.2), we are able to see that ( ) ( ) 1B Bψπ = University of Ghana http://ugspace.ug.edu.gh 28 The ψ weights or π weights may be obtained directly by division or by equating powers of B in an equation such as ( ) ( ) ( )B B Bψ θ θ= 3.4.2.4 Autoregressive Integrated Moving Average (ARIMA) Process We have now reached the more general class of time series models. In practice most time series are non-stationary and so we cannot apply stationary AR, MA or ARMA processes directly. One possible way of handling non-stationary series is to apply differencing so as to make them stationary. The first differences, namely ( ) ( )1 1t t tX X B X−− = − , may themselves be differenced to give second differences, and so on. The d th differences may be written as ( )1 d tB X− . If the original data series is differenced d times before fitting an ARMA ( ),p q process, then the model for the original un-differenced series is said to be an ARIMA ( ), ,p d q process where the letter ‘I’ in the acronym stands for integrated and d denotes the number of differences taken. If tX is replaced by d tX∇ in equation (3.9), then we have a model capable of describing certain types of non-stationary series. Such a model is term an “Integrated” model because the stationary model which is fitted to the differenced data has been summed or “integrated” to provide a model for the non-stationary data. We write ( )1 dd t t tW X B X= ∇ = − then the general form for the autoregressive integrated moving average (ARIMA) is given as University of Ghana http://ugspace.ug.edu.gh 29 1 1 2 2 1 1 2 2.... ....t t t p t p t t t q t qW W W W Z Z Z Zα α α β β β− − − − − −= + + + + + + + + (3.13) By comparison with equation (1.0), we may write equation (1.3) in the form ( ) ( )t tB W B Zθφ = (3.14) or ( )( ) ( )1 d t tB B X B Zθφ − = (3.15) Thus we have an ARMA model for tW while the model in equation (1.5), describing the d th differences of tX is said to be an ARIMA process of order ( ), ,p d q . The model of tX is clearly non-stationary as the AR operator ( )( )1 dB Bφ − has d roots on the unit circle. 3.4.2.5 The Box-Jenkins Seasonal (SARIMA) Model In practice, many time series contain a seasonal periodic component which repeats every S observations. For instance, with monthly observations where 12S = , we may expect tX to depend on the terms such as 12tX − and perhaps 24tX − , as well as terms such as 1tX − , 2tX − , 3tX − , … Box and Jenkins have generalized the ARIMA to deal with seasonality and defined a general multiplicative Seasonal ARIMA model abbreviated as SARIMA as ( ) ( ) ( ) ( )s s p P t q Q tB B W B B Zθφ Φ = Θ (3.16) Where B is the backward shift operator, , , ,p P q Qθφ Φ Θ are polynomials of order , , ,p P q Q respectively, tZ is purely a random process and d D t tW X= ∇ ∇ (3.17) University of Ghana http://ugspace.ug.edu.gh 30 If 1P = , then the term ( )s P BΦ will be (1− constant )sB× , which simply means that tW will depend on t sW − , since s t t sB W W −= . The variables { tW } are formed from the original series { tX } not only by simple differencing (to remove trend) but also by seasonal differencing, s∇ , to remove seasonality. For instance, let’s take 1d D= = , and 12s = , then 12 12 12 1t t t tW X X X −= ∇∇ = ∇ −∇ ( ) ( )12 1 13t t t tX X X X− − −= − − − The equations in (3.16) and (3.17) are said to be a SARIMA model of order ( ) ( ), , , , s p d q P D Q× . The values of d and D do not usually have to exceed one. For example, let us consider a SARIMA model of order ( ) ( )12 1,0,0 0,1,1× , where we notice that 12s = . Then the equations in (1.6) and (1.7) can be written as ( ) ( )121 1t tB W B Zα θ− = + Where 12t tW X= ∇ . Then we find that ( )12 1 13 12t t t t t tX X X X Z Zα θ− − − −= + − + + So that tX depends on 1 12,t tX X− − and 13tX − as well as the innovation at time ( )12t − . University of Ghana http://ugspace.ug.edu.gh 31 When fitting SARIMA models, one must first choose suitable values for the two orders of differencing, both seasonal (D) and non-seasonal (d), so as to make the series stationary and remove (most of) the seasonality. Then an ARMA-type model is fitted to the differenced series with the added complication that there may be AR and MA terms at lags which are a multiple of the season length s. The values of d , D , q and Q need to be assessed by looking at the autocorrelation function(ACF) and partial autocorrelation function (PACF) of the differenced series and choosing a SARIMA model whose ACF and PACF are of similar form. 3.5 Stationarity in Time Series A stationary time series has a constant mean, a constant variance and the covariance is independent of time. Stationarity is essential for standard econometric theory. Without it, one cannot obtain consistent estimators. A quick way of telling if a process is stationary is to plot the series against time. If the graph crosses the mean of the sample many times, chances are that the variable is stationary; otherwise that is an indication of persistent trends away from the mean of the series. A trend stationary variable is a variable whose mean grows around a fixed trend. This provides a classical way of describing an economic time series which grows at a constant rate. A trend stationary series tends to evolve around a steady, upward sloping curve without big swings away from that curve. Detrending the series will give a stationary process. For simplicity we assume the following process. t ty tα µ ε= + + 2(0, )N σ Notice that the mean of this process varies with time but the variance is constant. University of Ghana http://ugspace.ug.edu.gh 32 ( )tE y tα µ= + ( ) 2 2{ ( )}t tV y E t tα µ ε α µ σ= + + − + = Notice that if you define a new variable, say *,ty * ( )t ty y tα µ= − + then ty is stationary. An autoregressive process of order p , AR( p ), has a unit root if the polynomial in L , ( )2 1 21 .... pL L Lφ φ φ− − − − has a root equal to one. The simplest example of a process with a unit root is a random walk, that is, 1t t ty y ε−= + (3.18) Where tε is independent and identically distributed (i.i.d) with zero mean and constant variance. We can easily see that the variance of these processes does not exist: lagging the process one period, we can write 1 2 1t t ty y ε− − −= + , and substituting back in equation (3.18) we get 2 1t t t ty y ε ε− −= + + . Then, repeating this procedure it becomes easier to show that 0 1 2 ....t ty y ε ε ε= + + + + Then we can calculate the mean and the variance of this process. The mean can be calculated assuming that 0y is fixed, then the mean is constant over time, ( ) 00 1 2 1 ... )(t t ty yE y E ε ε ε ε−+ + + + + == The variance of ty ,”conditional” on knowing 0y , can be computed as ( ) ( )0 1 2 1...t t tV y V y ε ε ε ε−= + + + + + University of Ghana http://ugspace.ug.edu.gh 33 ( ) ( ) ( ) ( ) 2 1 2 1... t tV V V V tε ε ε ε σ−= + + + + = As we move further into the future this expression becomes infinite. We conclude that the variance of a unit root process is infinite. A unit root process will only cross the mean of the sample very infrequently, and the process will experience long positive and negative strays away from the sample mean. A process that has a unit root is also called integrated of order one, denoted as I(1). By contrast a stationary process is an integrated of order zero process, denoted as I(0). 3.6 Autocorrelation Function Autocorrelation refers to the correlation of a time series with its own past and future values. Autocorrelation is also sometimes called “lagged correlation” or “serial correlation”, which refers to the correlation between members of a series of numbers arranged in time. Positive autocorrelation might be considered a specific form of “persistence”, a tendency for a system to remain in the same state from one observation to the next. For example, the likelihood that it will rain tomorrow is greater if it rained today than if it is dry today. Geophysical time series are frequently autocorrelated because of inertia or carryover processes in the physical system. For example, the slowly evolving and moving low pressure systems in the atmosphere might impart persistence to daily rainfall. Or the slow drainage of groundwater reserves might impart correlation to successive annual flows of a river. An important guide to the properties of a time series is provided by a series of quantities called sample autocorrelation coefficients, which measures the correlation between observations at different distances apart. These coefficients, most at times provide an idea into the probability distribution model which generated the data. University of Ghana http://ugspace.ug.edu.gh 34 Three tools for assessing the autocorrelation of a time series are (1) The time series plot (2) The lagged scatterplot and (3) The autocorrelation function. 3.6.1 Time series plot Positively autocorrelated series are sometimes referred to as persistent because positive departures from the mean tend to be followed by positive departures from the mean, and negative departures from the mean tend to be followed by negative departures (Figure 3.1). In contrast, negative autocorrelation is characterized by a tendency for positive departures to follow negative departures, and vice versa. Positive autocorrelation might show up in a time series plot as unusually long runs, or stretches, of several consecutive observations above or below the mean. Negative autocorrelation might show up as an unusually low incidence of such runs. Because the “departures” for computing autocorrelation are computed relative to the mean, a horizontal line plotted as the sample mean is useful in evaluating autocorrelation with the time series plot. Visual assessment of autocorrelation from the time series plot is subjective and depends considerably on experience. It is a good idea, however, to look at the time series plot as a first step in analysis of persistence. If nothing else, this inspection might show that the persistence is much more prevalent in some parts of the series than in others. University of Ghana http://ugspace.ug.edu.gh 35 Figure 3.4 Tree-ring Index, MEAF. The figure above is a time series plot illustrating signatures of persistence. Tendency for highs to follow highs or lows to follow lows (circled segments) characterize series with persistence, or positive autocorrelation. 3.6.2 Lagged scatterplot The simplest graphical summary of autocorrelation in a time series is the lagged scatterplot, which is a scatterplot of the time series against itself offset in time by one to several time steps. Let the time series of length N be ix , 1, 2,...,i N= .The lagged scatterplot for lag k is a scatterplot of the last ( N k− ) observations against the first ( N k− ) observations. For example, for lag1, observations 2 3, ,...., Nx x x are plotted against observations 1 2 1, ,..., Nx x x − . If a random scattering of points in the lagged scatterplot indicates a lack of autocorrelation, then such a series University of Ghana http://ugspace.ug.edu.gh 36 is also sometimes called “random”, meaning that the value at time t is independent of the value at other times. An attribute of the lagged scatterplot is that it can display autocorrelation regardless of the form of the dependence on past values. An assumption of linear dependence is not necessary. An organized curvature in the pattern of dots might suggest nonlinear dependence between time-separated values. Such nonlinear dependence might not be effectively summarized by other methods (e.g., the autocorrelation function [acf], which is discussed in section 3.6.3). Another attribute is that the lagged scatterplot can show if the autocorrelation is characteristic of the bulk of the data or is driven by one or more outliers. Influence of outliers would not be detectable from the autocorrelation function alone. 3.6.3 Autocorrelation function (Correlogram) An important guide to the persistence in a time series is given by the series of quantities called the sample autocorrelation coefficients, which measure the correlation between observations at different times. The set of autocorrelation coefficients arranged as a function of separation in time is the sample autocorrelation function, or the autocorrelation function. An analogy can be drawn between the autocorrelation coefficient and the product-moment correlation coefficient. Assume N pairs of observations on two variables x and y . Then the correlation coefficient between x and y is given by ( )( ) ( ) ( )2 2 i i i i x x y y r x x y y − − =  − −  ∑ ∑ ∑ (3.19) where the summations are over the N observations. University of Ghana http://ugspace.ug.edu.gh 37 A similar idea can be applied to time series for which successive observations are correlated. Instead of two different time series, the correlation is computed between one time series and the same series lagged by one or more time units. For the first-order autocorrelation, the lag is one time unit. The first-order autocorrelation coefficient is the simple correlation coefficient of the first 1N − observations, tx , 1, 2,..., 1t N= − and the next 1N − observations, tx , 2,3,..., Nx = . The 1N − pairs of observations are given by ( ) ( ) ( ) ( )1 2 2 3 3 4 1, , , , , ,...., ,N Nx x x x x x x x− . Taking the first observation in each pair as one variable, and the second observation as a second variable, the correlation between tx and 1tx + is given by ( )( ) ( )( ) ( )( ) ( )( ) 1 11 2 1 1 1 12 2 11 2 1 1 N t t t N N t t t t x x x x r x x x x − + = − − + = = − − =  − −   ∑ ∑ ∑ (3.20) when we make a comparison with equation (1.9), where ( ) ( ) 1 1 1 1 N t t x x N − = = −∑ is the mean of the first 1N − observations and ( ) ( )2 2 1 N t t x x N = = −∑ is mean of the last 1N − observations. Since the coefficient in equation (2.0) measures correlation between successive observations, it is called an autocorrelation coefficient or serial correlation coefficient. As ( ) ( )1 2x x the equation (2.0) can be approximated to University of Ghana http://ugspace.ug.edu.gh 38 ( )( ) ( ) ( ) 1 1 1 1 2 1 1 N t t t N t t x x x x r N x x N − + = = − − = − − ∑ ∑ (3.21) where 1 N t t x x N = =∑ is the overall mean. Therefore, for N reasonably large, the denominator in equation (3.20) can be simplified by approximation. In the first place, the difference between the sub-period means ( )1x and ( )2x can be ignored. Secondly, the difference between summations over observations 1 to 1N − and 2 to N can be ignored. Accordingly, 1r can be approximated as ( )( ) ( ) 1 1 1 1 2 1 N t t t N t t r x x x x x x − + = = − − = − ∑ ∑ (3.22) Equation (2.2) can be generalized to give the correlation between observations separated by k time steps, which is given as ( )( ) ( ) 1 1 2 1 N i i k i k N i i x x x x r x x − + = = − − = − ∑ ∑ (3.23) The quantity kr is called the autocorrelation coefficient at lag k . The plot of the autocorrelation function as a function of “lag” is also called the correlogram. Link between Autocorrelation Function (ACF) and lagged scatterplot The correlation coefficients for the lagged scatterplots at lags are equivalent to the ACF values at lags 1, 2,....,8k = are equivalent to the ACF values at lags 1,2,…,8. University of Ghana http://ugspace.ug.edu.gh 39 Link between Autocorrelation Function (ACF) and Autocovariance function (ACVF) We know that the variance is the average squared departure from the mean. By comparison, the autocovariance of a time series is defined as the average product of departures at times t and t k+ . The sample autocovariance coefficient at lag k , given by ( )( ) 1 1 N k k t t k t c x x x x N − + = = − −∑ (3.24) is the usual estimator for the theoretical autocovariance coefficient ( )kγ at lag k . The bias in kc is of order 1 N . However, lim ( ) ( )kN E c kγ →∞ = , so that the estimator is asymptotically unbiased. It can be shown that { }( , ) ( ) ( ) ( ) ( ) / N k k m r Cov c c r r m k r m r k Nγ γ γ γ − =−∞ + − + + −∑ (3.25) When m k= , the equation (2.5) above gives the variance of kc and hence the mean square error of kc . The formula (3.25) also highlights the fact that successive values of kc may be highly correlated and this increases the ability to interpret the correlogram. Jenkins and Watts (1968) compared the estimator in the equation (3.24) with the alternative estimator University of Ghana http://ugspace.ug.edu.gh 40 ( ) ( )( ) 1 1 N k k t t k t c x x x x N k − + = ′ = − − − ∑ (3.26) The autocovariance function (ACVF) in (3.26) has a lower bias than the ACVF in (3.24), but is speculated to have a higher mean square error (Jenkins and Watts, 1968). 3.6.4 Interpreting the corrologram The correlogram is very useful in identifying which type of the ARIMA model gives the best representation of an observed time series. A correlogram like figure 3.5 below, where kr does not come down to zero(0) reasonably quickly, indicates non-stationary and so the series needs to be differenced. +1 kr 0 4 8 12 Lag K -1 Figure 3.5: A graph of a corrologram For stationary series, the correlogram is compared with the theoretical autocorrelation functions of different ARMA processes in order to choose the one which is most appropriate. The University of Ghana http://ugspace.ug.edu.gh 41 autocorrelation function of an MA( q ) process is easy to recognize as it “cuts off” at lag q , whereas the autocorrelation function of an AR( p ) process is a mixture of damped exponentials and sinusoids and dies out slowly( or attenuates). The autocovariance function of a mixed ARMA model will generally attenuate rather than “cut off”. For instance, suppose we find that 1r is significantly different from zero(0) but the subsequent values of kr are all close to zero. Then MA(1) model is indicated since its theoretical autocorrelation function is f this form. Alternatively, if 1 2 3, , ,.....r r r appear to be deceasing exponentially, then AR(1) model may be appropriate. 3.7 Fitting an autoregressive process After the autocorrelation function has been estimated for a given time series, we are able to have some rough idea about which stochastic process will provide suitable model. If an AR process is thought to be appropriate, there are two questions that must be answered: (a) What is the order of the process (b) How can the parameters of the process be estimated Suppose we have an AR process of order p and mean µ , given by 1 1 2 2( ) ( ) .... ( )t t t p t p tX X X X Zµ α µ α µ α µ− − −− = − + − + + − + (3.27) Given N observations 1, 2,..., Nx x x , the parametersµ , 1 2, ,..., pα α α may be estimated by least squares by minimizing University of Ghana http://ugspace.ug.edu.gh 42 2 1 2 2 1 ( ) ( ) ... ( ) N t t t p t p t p S x x x xµ α µ α µ α µ− − − = +  = − − − − − − − − ∑ (3.28) with respect to µ , 1 2, ,..., pα α α . If the tZ process is normal, then the least squares estimates are in addition, maximum likelihood estimators (Jenkins and Watts, 1968) conditional on the first p values in the time series being fixed. In the first order case, with 1p = , we find that ( ) ( )12 1 1 ˆ ˆ ˆ1 x xα µ α − = − (3.29) and ( )( ) ( ) 1 1 1 1 1 2 1 ˆ ˆ ˆ ˆ N t t t N t t x x x µ µ α µ − + = − = − − = − ∑ ∑ (3.30) where ( ) ( )1 2ˆ ˆ,x x are the means of the first and last ( 1)N − observations. Since ( ) ( )1 2 ˆ ˆx x x≈ ≈ , then approximately, ˆ xµ = . (3.31) By substituting ˆ xµ = into the equation (3.30), we will have ( )( ) ( ) 1 1 1 1 1 2 1 ˆ ˆ ˆ N t t t N t t x x x x µ µ α − + = − = − − = − ∑ ∑ (3.32) University of Ghana http://ugspace.ug.edu.gh 43 A further approximation can be obtained by noting that the denominator in equation (3.32) is approximately ( )2 1 N t t x x = −∑ So that 1 1 0 1ˆ c c rα ≈ = This estimator for 1α̂ is appealing since 1r is an estimator for (1)ρ and 1(1)ρ α= for first order AR process. A confidence interval for 1α can be obtained from the fact that the asymptotic standard error of 1α̂ is 2 1{(1 ) }Nα− , although the confidence interval will not be symmetric for 1α̂ away from zero. When 1ˆ 0α = , the standard error of 1α̂ is 1 N , and so a test for 1 0α = is given by checking if 1 1ˆ rα = lies within the range 2 N± . For second order AR process, with 2ρ = , similar approximations may be made to give ˆ xµ ≈ ( ) ( )2 1 1 2 1ˆ 1 1r r rα ≈ − − (3.33) ( ) ( )2 2 2 2 1 1ˆ 1r r rα ≈ − − (3.34) These results are also intuitively reasonable in that if we fit a second-order model to what is really a first-order process, then as 2 0α = , we have ( ) ( )2 2 12 1ρ ρ α= = and so 2 2 1r r≈ . Thus equations (3.3) and (3.4) become 1 1ˆ rα ≈ and 2ˆ 0α ≈ . Jenkins and Watts (1968) describe 2α as the University of Ghana http://ugspace.ug.edu.gh 44 (sample) partial autocorrelation coefficient of order two which measures the excess correlation between {Xt} and {Xt+2} not accounted for by 1r . Higher-order AR processes may also be fitted by least squares in a straight forward way. Two alternative approximate methods are commonly used. Both methods involve taking ˆ xµ = . The first method fits the data to the model 1 1( ) ... ( )t t p t p tX x x x x x Zα α− −− = − + + − + treating it as if it were an ordinary regression model. The second method involves substituting the sample autocorrelation coefficients into the first p Yule-Walker equations and solving for 1ˆ ˆ( ,..., )pα α (Pagano,1972). In matrix form these equations are ˆR rα = (3.35) Where 1 2 1 1 1 2 2 1 3 1 2 1 ... 1 ... . ... . . . ... . . ... 1 p p p p p r r r r r r R r r r r r − − − − −                    = is a (p × p ) matrix, 1ˆ ˆ ˆ( ,..., )T pα α α= University of Ghana http://ugspace.ug.edu.gh 45 and 1( , ..., )T pr r r= For N reasonably large, both methods will give estimated values ‘very close’ to the true least squares estimates for which µ̂ is close to but not necessarily equal to x . 3.7.1 Determining the order of an autoregressive process It is usually difficult to assess the order of an autoregressive (AR) process from the sample autocorrelation function (acf) alone. For a first-order process the theoretical autocorrelation function (acf) decreases exponentially and the sample function should have a similar shape. But for higher-order processes the acf may be a mixture of damped exponential or sinusoidal functions and it is difficult to identify. One approach is to fit AR processes of progressively higher order, to calculate the residual sum of squares for each value of p, and to plot this against p. It may then be possible to see the value of p where the curve ‘flattens out’ and the addition of extra parameters gives little improvement in fit. Another aid to determining the order of an AR process is the partial autocorrelation function (Box and Jenkins, 1970). When fitting an AR( p ) model the last coefficient pα will be donated by pπ and measures the excess correlation at lag p which is not accounted for by an AR (p - 1) model. It is called the p th partial autocorrelation coefficient and, when plotted against p, gives University of Ghana http://ugspace.ug.edu.gh 46 the partial ac.f. The first partial autocorrelation coefficient 1π is equal to p (1), and this is equal to 1α for an AR (1) process. The sample partial autocorrelation function (pac.f.) is estimated by fitting AR processes of successively higher order and taking 1 1ˆπ̂ α= when an AR(1) processes is fitted, taking 2 2ˆπ̂ α= when an AR(2) process is fitted, and so on. Values of ˆ pπ , which are outside the range 2 N± .are significantly different from zero at the 5% level. It can be shown that the partial ac.f of an AR(p) process ‘cuts off at lag p so that ‘correct’ order is assessed as that value of p beyond which the sample values of �πj� are not significantly different from zero. In contrast the partial ac.f. of an MA process will generally attenuate, and so the partial acf has ‘opposite’ properties to the acf. 3.8 Fitting a moving average process Let us assume that now a moving average (MA) process is thought to be an appropriate model for a given time series. Just like for an autoregressive (AR) process, we have two problems: (a) Finding the order of the process and, (b) Estimating the parameters of the process. University of Ghana http://ugspace.ug.edu.gh 47 3.8.1 Estimating the parameters of a moving average process Let us begin by considering the first-order MA process 1 1t t tX Z Zµ β −= + + (3.36) where 1 ,µ β are constants and tΖ denotes a purely random process. We would like to write the residual sum of squares, 2 tz∑ solely in terms of the observed xs and the parameters 1,µ β as we did for the AR process, to differentiate with respect to µ and 1β , and hence to find the least squares estimates. Unfortunately the residual sum of squares is not a quadratic function of the parameters and so explicit least squares estimates cannot be found. Nor can one simply equate sample and theoretical first-order autocorrelation coefficient by ( )2 1 1 1 ˆ ˆ/ 1r β β= + (3.37) and choose the solution 1̂β such that 1̂ 1,β < because it can be shown that this gives rise to an inefficient estimator. The approach suggested by Box and Jenkins (1970) is as follows. Select suitable starting values for µ and 1β such as xµ = and 1β given by the solution of equation (3.37) (Box and Jenkins, 1970). Then the corresponding residual sum of squares may be calculated using (3.36) recursively in the form 1 1t t tZ X Zµ β −= − − (3.38) With 0 0,Z = we have University of Ghana http://ugspace.ug.edu.gh 48 1 1 2 2 1 1 1 1 , ,....., N N N Z x Z x Z Z x Z µ µ β µ β − = − = − − = − − Then, 2 1 N t t Z − ∑ may be calculated. This procedure could then be repeated for other values of µ and 1β , and the sum of squares 2 tZ∑ computed for a grid of points in the ( )1µβ plane. We may then determine by inspection the least squares estimates of µ and 1β which minimizes 2 tZ∑ . These least squares estimates are also maximum likelihood estimates conditional on the fixed zero value for 0Z provided that tZ is normally distributed. The procedure can be further refined by back forecasting value of 0Z (Box and Jenkins, 1970), but this is unnecessary except when N is small or when 1β is ‘close’ to plus or minus one ( )1± . Nowadays, the values of µ and 1β which minimizes 2 tZ∑ would normally be found by some iterative optimization procedure, such as hill-climbing, although a grid search can still sometimes be useful to see what the sum of squares surface looks like. An alternative estimation procedure presented by J. Durbin is to fit a high-order AR process to the data and use the duality between AR and MA processes (Kendall, Stuart and Ord, 1983). This procedure has the advantage of requiring less computation, but the widespread availability of high-speed computers has resulted in the procedure becoming obsolete. For higher-order process a similar type of iterative procedure to that described above may be used. For example, with a second-order MA process one would guess starting values for 1 2, , ,µ β β compute the residuals recursively using University of Ghana http://ugspace.ug.edu.gh 49 1 1 2 2t t t tZ x Z Zµ β β− −= − − − and compute 2 tZ∑ Then other values of 1 2, , ,µ β β could be tried, perhaps over a grid of points, until the minimum value of 2 tZ∑ is found. Clearly a computer is essential for performing such a large number of arithmetic operations, and a numerically efficient optimization procedure is often used to minimize the residual sum of squares. Box and Jenkins (1970) describe such a procedure, which they call ‘non-linear estimation’. This description arises from the fact that the residual are non-linear functions of the parameters. For a completely new set of data, it may be a good idea to use the method based on evaluating the residual sum of squares at a grid of points. A visual examination of the sum of squares surface will sometime provide useful information. In particular it is interesting to see how ‘flat’ the surface is; if the surface is approximately uncorrelated. In addition to point estimates, an approximate confidence region for the model parameters may be found as described by Box and Jenkins (1970) by assuming that the tZ are normally distributed. But there is some doubt as to whether the asymptotic normality of maximum likelihood estimators will apply even for moderately large sample sizes (e.g. 200N = ). It should now be clear that it is much harder to estimate the parameters of an MA model than those of an AR model, as the ‘errors’ in an MA model are non-linear functions of the parameters and iterative methods are required to minimize the residual sum of squares. Because of this, many analysts prefer to fit an AR model to a given time series even though the resulting model may contain more parameters than the ‘best’ MA model. Indeed the relative simplicity of AR modeling is the main reason for its use in the stepwise auto regression forecasting technique and in auto regressive spectrum estimation. University of Ghana http://ugspace.ug.edu.gh 50 3.8.2 Determining the order of a moving average process If an MA process is thought to be appropriate for a given set of data, the order of the process is usually evident from the sample autocorrelation function (acf). The theoretical acf of an MA ( )q process has a very simple form in that it ‘cuts off at lag q , and so the analyst should look for the lag beyond which the values of kr are close to zero. The partial acf is generally of little help in identifying MA models because of its attenuated form. 3.9 Estimating the parameters of an ARMA model Let us assume that a mixed autoregressive – moving average (ARMA) model is thought to be appropriate for a given time series. The estimation problems for an ARMA model are similar to those for a moving average (MA) model in that an iterative procedure has to be used. The residual sum of squares can be calculated at every point on a suitable grid of the parameter values, and the ‘values which give the minimum sum of squares may then be assessed. Alternatively some sort of optimization procedure may be used. As an example, consider the ARMA (1,1) process whose autocorrelation function (ac.f) decreases exponentially after (1)lag . This model may be recognized as appropriate if the sample ac.f has a similar form. The model is given by ( )1 1 1 1t t t tX X Z Zµ α µ β− −− = − + + Given N observations 1 2, ,...... Nx x x . We guess values for 1 1, ,µ α β and set 0 0Z = and 0x µ= and then calculate the residuals recursively by University of Ghana http://ugspace.ug.edu.gh 51 ( ) ( ) 1 1 2 2 1 1 1 1 1 1 1 1 . . . N N N N Z x Z x x Z Z x x Z µ µ α µ β µ α µ β− − = − = − − − − = − − − − The residual sum of squares 2 1 N t t Z − ∑ may then be calculated. Then other values of 1 1, ,µ α β may be tried until the minimum residual sum of squares is found. Many variants of the above estimation procedure have been discussed in the reviews written by Priestley (1981) and Kendall, Stuart and Ord (1983). In recent times, exact maximum likelihood estimates are mostly preferred, despite the extra computation involved. The Hannan-Rissanen recursive regression procedure (Granger and Newbold, 1986) is primarily intended for model identification but can alternatively be used to provide starting values as well. The Kalman filter may be used to calculate exact maximum likelihood estimates to any desired degree of approximation. It must be noted that with software packages like Minitab, Mathlab, SPSS, STATA and the likes, it has become easier to compute the estimates. 3.10 Estimating the parameters of an ARIMA model In practice most time series are non-stationary, and those stationary models one explained earlier are not immediately appropriate. One can difference an observed time series until it is stationary. An AR, MA or ARMA model may then be fitted to the differenced series. The resulting model for the undifferenced series is the fitted ARIMA model. University of Ghana http://ugspace.ug.edu.gh 52 3.11 The BOX-JENKINS seasonal (SARIMA) model In practice, many time series contain a seasonal periodic component which repeats every S observations. For example, with monthly observations, where 12,S = we may typically expect tX to depend on terms such as 12tX − and perhaps 24tX − as well as terms such as 1 2, ,....t tX X− − Box and Jenkins (1970) have generalized the ARIMA model to deal with seasonality, and define a general multiplicative seasonal ARIMA model (abbreviated SARIMA model) as ( ) ( ) ( ) ( )s s p P t q Q tB B W B B Zφ θΦ = Θ (3.39) Where B denotes the backward shift operator, , , ,p p q Qφ θΦ Θ are polynomials of order , , ,p P q Q respectively; tZ denotes a purely random process, and d D t s tW X= ∇ ∇ (3.40) At a glance, we see that the model looks complicated, however, if say 1p = , then the term ( )s p BΦ will be (1 constant− × )sB , which simply means that tW will depend on t sW − , since s t t sB W W −= . The variables { }tW are formed from the original series { }tX not only by simple differencing (to remove trend) but also by seasonal differencing, s∇ , to remove seasonality. For example if 1d D= = and 12,s = then ( ) ( ) 12 12 12 1 12 1 13 t t t t t t t t W X X X X X X X − − − − = ∇∇ = ∇ −∇ = − − − The model in equations (3.9) and (4.0) is said to be a SARIMA model of order ( ) ( ), , , , . s p d q P D Q× The values of d and D do not usually need to exceed one. University of Ghana http://ugspace.ug.edu.gh 53 An example, considers a SARIMA model of order ( ) ( )12 1,0,0 0,1,1 ,× where we note 12s = . Then equations (3.9) and (4.0) can be written ( ) ( )121 1t tB W B Zα θ− = + Where tW = 12 tX∇ Then we find ( )12 1 13 12t t t t t tX X X X Z Zα θ− − − −= + − + + so that tX depends on 1tX − and 2tX − and 13tX − as well as the innovation at time ( )12t − . When fitting a seasonal model to data, the first task is to assess values of d and D which reduce the series to stationarity and remove most of the seasonality. Then the values of , ,p P q and Q need to be assessed by looking at the ac.f and the partial ac.f of the differenced series and choosing a SARIMA model whose ac.f and partial ac.f are of similar form. Finally, the model parameters may be estimated by means of the many statistical programs such as SPSS, MATLAB, MINITAB and CRAN. This in essence means that the average analyst need not worry too much about the practical details of estimation routines. 3.12 Residual Analysis When a model has been fitted to a time series, it is advisable to check that the model really does provide an adequate description of the data. As with most statistical models, this is usually done by looking at the residuals, which is defined by residual observation fitted= − value . University of Ghana http://ugspace.ug.edu.gh 54 For a univariate time-series model, the fitted value is the one-step-ahead forecast so that the residual is the one-step-ahead forecast error. For example, with an AR (1) model (equation (5)) where φ is estimated by least squares, the fitted value at time (t) is 1 ˆ txφ − so that the residual corresponding to tx is 1 ˆˆt t tz x xφ −= − Of course if φ were known exactly, then exact error 1t t tz x xφ −= − could be calculated, but this situation rarely arises in practice. If we have a ‘good’ model then we expect the residuals to be ‘random’ and ‘close to ‘zero’, and model validation usually consists of plotting residuals in various ways. With time-series models we have the added feature that the residuals are ordered in time and it is natural to treat them as a time series. The two obvious steps are to plot the residuals as time plot, and to calculate the correlogram of the residuals. The time plot will reveal any outliers and any obvious autocorrelation or cyclic effects. The residual correlogram will enable autocorrelation effects to be examined more closely. University of Ghana http://ugspace.ug.edu.gh 55 CHAPTER FOUR ESTIMATION AND INTERPRETATION OF TIME SERIES MODEL 4.1 INTRODUCTION Data used for the analyses were the daily water levels of the Akosombo dam. The data were aggregated to monthly average water levels so that we can make a month by month comparison. The initial stage of the analyses process was the decomposition of the data set into the various time series components that existed within the data. It was then preceded with the time series procedure of Smoothing, Modeling, and Forecasting. Data available to this research work are daily water levels which spans from January, 1980 to December, 2010. Data from January, 1980 to December, 2009 were used in the ARIMA modeling procedure. A twelve-month forecast was made for the year 2010 and the forecast values were compared with the actual values for that particular year (2010). 4.2 RESULTS AND DISCUSSIONS Figure 4.1shows a time series plot of the actual average monthly water levels of the Akosombo dam. The identification process starts with taking a closer look at this plot. University of Ghana http://ugspace.ug.edu.gh 56 It can be observed that there are similarities that exist within the months of the year. It can be seen that from the month of February through to August thereabout, the water levels keep reducing and starts rising from the month of September reaching its peak somewhere in January. The nature of the time series plot for the actual data set shows the possible presence of seasonality as this scenario remains obvious throughout the remaining years. Year Month 2010200520001995199019851980 JanJanJanJanJanJanJan 280 270 260 250 240 230 A ct ua l d at a Time Series Plot of Actual data Figure 4.1: Time series plot of actual data The Minitab statistical analysis software package was employed in the decomposition of the data. The data fitted some trend equations such as the linear and exponential. Notably was the exponential smoothing as it gave the least Mean Standard Deviation of 6.77609 as compared to the 84.73 for the for the Linear Trend Equation. The figures below (Figure 4.2 and Figure 4.2) shows the Exponential Smoothing plot and the Linear Trend plot respectively. University of Ghana http://ugspace.ug.edu.gh 57 37033329625922218514811174371 280 270 260 250 240 230 Index Ac tu al d at a Alpha 1.52743 Smoothing Constant MAPE 0.67139 MAD 1.69780 MSD 6.77609 Accuracy Measures Actual Fits Variable Smoothing Plot for Actual data Single Exponential Method Figure 4.2: Smoothing plot for Actual Data using Exponential method 37033329625922218514811174371 280 270 260 250 240 230 Index A ct ua l d at a MAPE 2.9905 MAD 7.5706 MSD 84.7300 Accuracy Measures Actual Fits Variable Trend Analysis Plot for Actual data Linear Trend Model Yt = 254.464 - 0.010575*t Figure 4.3: Trend Analysis plot for Actual Data using Linear Trend Model University of Ghana http://ugspace.ug.edu.gh 58 As can be noticed with the Trend Analysis plot in figure 4.3, the slope is not zero or near zero. This is an indication that the data is not stationary and hence, there is the need for differencing to achieve stationarity. 4.3 Modeling and Forecasting Before the ideal model for forecasting the water levels of the Akosombo dam was achieved, the following procedures about time series modeling was adhered to. 4.3.1 Identifying the order of differencing and the constant • If the series has positive autocorrelations out to a high number of lags, then it probably needs a higher order differencing. • If the lag(1) autocorrelation is zero or negative, or the autocorrelations are all small and patternless, then the series does not need a higher order of differencing. If the lag(1) autocorrelation is -0.5 or more negative, the series may be over-differenced. • The optimal order of differencing is often the order of differencing at which the standard deviation is lowest. University of Ghana http://ugspace.ug.edu.gh 59 • A model with no orders of differencing assumes that the original series is stationary (among other things, mean-reverting). A model with one order of differencing assumes that the original series has a constant average trend. A model with two orders of total differencing assumes that the original series has a time-varying trend. • A model with no orders of differencing normally includes a constant term (which represents the mean of the series). A model with two orders of total differencing normally does not include a constant term. In a model with one order of total differencing, a constant term should be included if the series has a non-zero average trend. 4.3.2 Identifying the numbers of AR and MA terms • If the partial autocorrelation function (PACF) of the differenced series displays a sharp cut-off and/or the lag(1) autocorrelation is positive, that is, if the series appears slightly "under-differenced", then consider adding one or more AR terms to the model. The lag beyond which the PACF cuts-off is the indicated number of AR terms. • If the autocorrelation function (ACF) of the differenced series displays a sharp cutoff and/or the lag(1) autocorrelation is negative (that is, if the series appears slightly "over- differenced") then consider adding an MA term to the model. The lag beyond which the ACF cuts off is the indicated number of MA terms. University of Ghana http://ugspace.ug.edu.gh 60 • It is possible for an AR term and an MA term to cancel each other's effects, so if a mixed AR-MA model seems to fit the data, also try a model with one fewer AR term and one fewer MA term, particularly if the parameter estimates in the original model require more than 10 iterations to converge. • If there is a unit root in the AR part of the model (that is, if the sum of the AR coefficients is almost exactly 1), one should reduce the number of AR terms by one and increase the order of differencing by one. • If there is a unit root in the MA part of the model (that is, if the sum of the MA coefficients is almost exactly 1) you should reduce the number of MA terms by one and reduce the order of differencing by one. • If the long-term forecasts appear erratic or unstable, there may be a unit root in the AR or MA coefficients. University of Ghana http://ugspace.ug.edu.gh 61 4.3.3 Identifying the seasonal part of the model • If the series has a strong and consistent seasonal pattern, then you should use an order of seasonal differencing, but never use more than one order of seasonal differencing or more than 2 orders of total differencing (thus, seasonal+nonseasonal must not be more than 2). • If the autocorrelation at the seasonal period is positive, consider adding an SAR term to the model. If the autocorrelation at the seasonal period is negative, consider adding an SMA term to the model. Do not mix SAR and SMA terms in the same model, and avoid using more than one of either kind. After the time series plot, we noticed the seasonal traits in the data. Per the points noted above, we proceeded to generate the autocorrelation function graph and of the partial autocorrelation function data. This is depicted in the Figure 4.4 and Figure 4.5 of the un-differenced data below. 454035302520151051 1.0 0.8 0.6 0.4 0.2 0.0 -0.2 -0.4 -0.6 -0.8 -1.0 Lag Au to co rr ela tio n ACF of Water Levels FIGURE 4.4 Autocorrelation Function of Water Levels University of Ghana http://ugspace.ug.edu.gh 62 454035302520151051 1.0 0.8 0.6 0.4 0.2 0.0 -0.2 -0.4 -0.6 -0.8 -1.0 Lag Pa rt ia l A ut oc or re la tio n PACF of Water Levels FIGURE4.5: Partial Autocorrelation Function of Water Levels Let us also note that from the Linear-Trend decomposition, we realized that the data is not stationary and hence needed to be differenced. A plot of the autocorrelation function and the partial autocorrelation function of the differenced data are shown in Figure 4.4 and Figure 4.5. University of Ghana http://ugspace.ug.edu.gh 63 454035302520151051 1.0 0.8 0.6 0.4 0.2 0.0 -0.2 -0.4 -0.6 -0.8 -1.0 Lag Au to co rr el at io n ACF of Differenced Water Levels FIGURE 4.6: Autocorrelation Function of Differenced Water Levels 454035302520151051 1.0 0.8 0.6 0.4 0.2 0.0 -0.2 -0.4 -0.6 -0.8 -1.0 Lag Pa rt ia l A ut oc or re la tio n PACF of Differenced Water Levels Figure 4.7: Partial Autocorrelation Function of Differenced Water Levels University of Ghana http://ugspace.ug.edu.gh 64 The ACF and PACF graphs above are plots of the data after the data were differenced once. Again let us notice the sinusoidal waves depicted in the autocorrelation plot. The PACF also cuts off also after lag(1). This suggest an AR(1) in the non-seasonal ARIMA. For the seasonal ACF, we notice that we have a negative value and this also cuts-off after lag(1) as depicted in the PACF graph. Therefore we have a seasonal moving average with period one. Hence we have SMA(1) for the seasonal ARIMA. There is also a difference of one here too. Now a tentative model of 12(1,1,0) (0,1,1)× after careful examination of the ACF and PACF plots. The researcher was also careful to take notice of the rules laid in the sub-sections of section 4.3. From the Figure 4.5, it can be noticed that the PACF of the un-differenced water levels cuts-off at lag(2). More so, its ACF as depicted in Figure 4.4 is in sinusoidal waves and it gradually tails off. A possible model of (0,0,2) × (0,0,1)12 can be observed. Therefore, after it has been differenced once, it will be good for us to also look at the models (0,1,2) × (0,1,1)12 and (0,1,2). The three models will be compared with each other so that the best estimator selected as our final model to predict the water levels of the Akosombo dam. The statistical software MINITAB, will be used to test all three models to enable us get the best estimator. The estimates at each iteration and the modified Box-Pierce(Ljung-Box) Chi-Square statistics for the model (0,1,2) × (0,1,1)12 is depicted in Table 4.1 University of Ghana http://ugspace.ug.edu.gh 65 Table 4.1: ARIMA model (0,1,2) × (0,1,1)12 Estimates at each iteration Iteration SSE Parameters 0 2617.90 0.100 0.100 0.100 0.121 1 2087.38 -0.017 0.111 0.250 0.085 2 1752.32 -0.095 0.082 0.400 0.061 3 1518.49 -0.155 0.038 0.550 0.045 4 1346.24 -0.205 -0.012 0.700 0.034 5 1213.72 -0.247 -0.059 0.850 0.024 6 1161.05 -0.269 -0.082 0.924 0.017 7 1156.09 -0.293 -0.107 0.966 0.013 8 1149.33 -0.293 -0.102 0.956 0.018 9 1148.98 -0.294 -0.103 0.953 0.017 10 1148.97 -0.293 -0.103 0.953 0.016 Table 4.2: Final Estimates of Parameters Type Coef SE Coef T P MA 1 -0.2931 0.0537 -5.46 0.000 MA 2 -0.1031 0.0537 -1.92 0.056 SMA 12 0.9526 0.0277 34.41 0.000 Constant 0.01640 0.01226 1.34 0.182 University of Ghana http://ugspace.ug.edu.gh 66 Differencing: 1 regular, 1 s