TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS Contents: Introduction to time series Fundamentals of time series analysis Basic theory of stationary processes Time series Models: --- MA model AR model ARIMA model Seasonal Adjustment Some applications of social and Physical Sciences References: • The analysis of time series: Theroy & Practice - Chatfield , C • The statistical analysis of time series - Anderson,T.W. • Time series - Kondall, Maurice • The analysis of time series an introduction - Chatfield, C. 1. Introduction to time series A time series is a collection of observations made sequentially in time. Examples: In Economics, daily closing stock prices, weekly interest rates, monthly price indices and yearly earnings. In Meteorology, hourly wind speed, daily temperature and annual rainfall In Social Sciences annual birth rates, mortality rates, accident rates and various crime rates. Ctd… In Engineering electric signals, voltage and sound. In Geophysics ocean waves, earth noise in an area. EEG and EKG tracings in Medicine. In Agriculture annual crop production prices. 1.1 Discrete & Continuous time series A time series is said to be discrete when observations are taken only at specific time points. A time series is said to be continuous when observations are made continuously. During this lecture we consider only discrete time series that is when observations are taken at equal intervals. 1.2 Objectives of Time series Analysis To understand the variability of the time series. To identify the regular and irregular oscillations of the time series. To describe the characteristics of the oscillations. To understand physical processes that give rise to each of these oscillations. 1.3 Components of a time series A time series is a collection of data obtained by observing a response variable at periodic points in time. Xt is used to denote the value of the variable x at time t. A time series is made up of one or more components of the following : 1. - Trend Measures the average change in the variable per unit time. In other words it measures the change in the mean level of the time series. Ctd… 2. Seasonal variations - Periodic variations that occur with some degree of regulations within a year or shorter. 3. Cyclical variations - Recurring up and down movement which are extended over a long period.( usually 2 years or more) 4. Irregular variations - Random Fluctuations which happen due to errors. Time series models can be classified into two types: Additive model & multiplicative model The four components are combined in the additive time series model & multiplicative model as follows; Yt = T+S+C+R(additive) Yt = T.S.C.R(multiplicative Where Yt is the actual value T – trend or long-term movement S – seasonal movement C – cyclical movement R - residual or random movement (irregular variation) The components of a time series are easily Identified and explained pictorially in a time series plot. A time series plot is a sequence plot with the time series variable Yt the vertical axis and time t on the horizontal axis. The figure 1.1 shows a trend in the time series values. The trend component describes the tendency of the value of the variable to increase or decrease over a long period of time. Figure 1.1 : Trend in a time series A cyclical effect in a time series as shown in the figure 1.2 describes the fluctuation about the trend line. In business the fluctuations are called business cycles. figure 1.2 : cyclic variations in a time series A seasonal variation in a series describes the fluctuations that recur during specific portions of each year ( monthly or seasonally), You can see in the figure 1.3 that the pattern of change in the time series within a year tends to be repeated from year to year producing a wavelike or oscillating curve. Figure 1.4 : seasonal variations in a time series The final component, the residual effect is what remains after the trend, cyclical and seasonal components have been removed. This component is not systematic and may be attributed to unpredictable influences. Thus the residual effect represents the random error component of a time series. • One of the objectives of time series is to forecast some future values of the series. • To obtain forecast some type of model that can be projected into the future must be used to describe the time series. • One of the most widely used models is the additive model. Filtering( Smoothing techniques) • A procedure to remove random variation revealing more clearly the underlying trend and cyclic components in a set of time series data, converting one time series to another by performing a linear operation for the use of forecasting. Moving Average - Smooth out (reduce) fluctuations and gives trend values to a fair degree of accuracy. - The average value of a number of adjacent time series values is taken as the trend value for the middle point. Using linear regression technique the equation of the straight line trend can be estimated. Exponential Smoothing - This is a very popular scheme to produce a smooth time series. - weigh past observations with exponentially decreasing weights to forecast future values. Differencing - This is the common method of filtering. - A popular and effective method of removing trend from a time series. - Differencing of a time series { x } in discrete time t is the transformation of the series {x } to a new series { x } where the values x are the differences between values of consecutive x . Time series operators • Difference operator - First difference operator -Second difference operator - Higher order difference operator Lag operator (Backward shift operator) -Transforms an observation of a time series to the previous one. Autocorrelation This is the correlation(relationship) between members of a time series. Autocorrelation coefficient at lag k is given by Suppose we have a set of n values, {xt}, which represent measurements taken at different time periods, t=1,2,3,4,…n, of the closing daily price of a stock or commodity. The following Figure shows a typical stock price time series: the blue line is the closing stock price on each trading day; the red and black looped lines highlight the time series for 7 and 14 day intervals or ‘lags’, i.e. the sets {xt,xt+7,xt+14,xt+21,...} and {xt,xt+14,xt+28,xt+42,...}. Time series of stock price and volume data The pattern of values recorded and graphed might show that commodity prices, exhibits some regularity over time. For example, it might show that days of high commodity prices are commonly followed by another day of high commodity prices , and days of low commodity prices are also often followed by days of low commodity prices . In this case there would be a strong positive correlation between commodity prices on successive days, i.e. on days that are one step or lag apart. We could regard the set of “day 1” values as one series, {xt,1} t=1,2,3…n-1, and set of “day 2” values as a second series {xt,2} t=2,3…n, and compute the correlation coefficient for these two series in the same manner as for the r expression above.