Time-Series Analysis and Forecasting

Time-Series Analysis and Forecasting

Chapter Goals

After completing this chapter, you should be able to:

§     Compute and interpret index numbers

§    Weighted and unweighted price index

§    Weighted quantity index

§     Test for randomness in a time series

§     Identify the trend, seasonality, cyclical, and irregular components in a time series

§     Use smoothing-based forecasting models, including moving average and exponential smoothing

§     Apply autoregressive models and autoregressive integrated moving average models

Index Numbers

§    Index numbers allow relative comparisons over time

§    Index numbers are reported relative to a Base Period Index

§    Base period index = 100 by definition

§    Used for an individual item or measurement

Single Item Price Index

Consider observations over time on the price of a single item

§     To form a price index, one time period is chosen as a base, and the price for every period is expressed as a percentage of the base period price

§     Let  p0 denote the price in the base period

§     Let  p1 be the price in a second period

§     The price index for this second period is

Index Numbers: Example

§    Airplane ticket prices from 1995 to 2003:

Index Numbers: Interpretation

§     Prices in 1996 were 90% of base year prices

§     Prices in 2000 were 100% of base year prices (by definition, since 2000 is the base year)

§     Prices in 2003 were 120% of base year prices

Aggregate Price Indexes

§     An aggregate index is used to measure the rate of change from a base period for a group of items

Unweighted
Aggregate Price Index

Unweighted Aggregate Price Index: Example

§      Unweighted total expenses were 18.8% higher in 2004 than in 2001

Weighted
Aggregate Price Indexes

Laspeyres Price Index

Laspeyres Quantity Index

The Runs Test for Randomness

§    The runs test is used to determine whether a pattern in time series data is random

§    A run is a sequence of one or more occurrences above or below the median

§    Denote observations above the median with “+” signs and observations below the median with “-” signs

The Runs Test for Randomness

§    Consider  n  time series observations

§    Let  R  denote the number of runs in the sequence

§    The null hypothesis is that the series is random

§    Appendix Table 14 gives the smallest significance level for which the null hypothesis can be rejected (against the alternative of positive association between adjacent observations) as a function of  R  and  n

The Runs Test for Randomness

§    If the alternative is a two-sided hypothesis on nonrandomness,

§   the significance level must be doubled if it is less than 0.5

§   if the significance level, a, read from the table is greater than 0.5, the appropriate significance level for the test against the two-sided alternative is 2(1 – a)

Counting Runs

Runs Test Example

§    Use Appendix Table 14

§    n = 18  and  R = 6

§    the null hypothesis can be rejected (against the alternative of positive association between adjacent observations) at the 0.044 level of significance

§    Therefore we reject that this time series is random using a = 0.05

Runs Test: Large Samples

§            Given n > 20  observations

§            Let  R  be the number of sequences above or below the median

Consider the null hypothesis   H0: The series is random

§            If the alternative hypothesis is positive association between adjacent observations, the decision rule is:

Runs Test: Large Samples

Consider the null hypothesis   H0: The series is random

§            If the alternative is a two-sided hypothesis of nonrandomness, the decision rule is:

Example: Large Sample
Runs Test

§     A filling process over- or under-fills packages, compared to the median

Example: Large Sample
Runs Test

§     A filling process over- or under-fills packages, compared to the median

§     n = 100 ,  R = 45

Example: Large Sample
Runs Test

Time-Series Data

§    Numerical data ordered over time

§    The time intervals can be annually, quarterly, daily, hourly, etc.

§    The sequence of the observations is important

§    Example:

Year:          2001   2002   2003   2004   2005

Sales:         75.3    74.2    78.5    79.7    80.2

Time-Series Plot

§     the vertical axis measures the variable of interest

§     the horizontal axis corresponds to the time periods

Time-Series Components

Trend Component

§    Long-run increase or decrease over time (overall upward or downward movement)

§    Data taken over a long period of time

Trend Component

§    Trend can be upward or downward

§    Trend can be linear or non-linear

Seasonal Component

§    Short-term regular wave-like patterns

§    Observed within 1 year

§    Often monthly or quarterly

Cyclical Component

§    Long-term wave-like patterns

§    Regularly occur but may vary in length

§    Often measured peak to peak or trough to trough

Irregular Component

§    Unpredictable, random, “residual” fluctuations

§    Due to random variations of

§    Nature

§    Accidents or unusual events

§    “Noise” in the time series

Time-Series Component Analysis

§     Used primarily for forecasting

§     Observed value in time series is the sum or product of components

§     Additive Model

§     Multiplicative model (linear in log form)

Smoothing the Time Series

§    Calculate moving averages to get an overall impression of the pattern of movement over time

§    This smooths out the irregular component

Moving Average:    averages of a designated

number of consecutive

time series values

(2m+1)-Point Moving Average

§    A series of arithmetic means over time

§    Result depends upon choice of  m  (the number of data values in each average)

§    Examples:

§    For a 5 year moving average, m = 2

§    For a 7 year moving average, m = 3

§    Etc.

§    Replace each  xt with

Moving Averages

§     Example: Five-year moving average

§    First average:

§    Second average:

§    etc.

Example: Annual Data

Calculating Moving Averages

§     Each moving average is for a consecutive block of  (2m+1)  years

Annual vs. Moving Average

§     The 5-year moving average smoothes the data and shows the underlying trend

Centered Moving Averages

§      Let the time series have period  s, where  s  is even number

§      i.e.,  s = 4  for quarterly data and  s = 12  for monthly data

§      To obtain a centered s-point moving average series Xt*:

§      Form the s-point moving averages

§      Form the centered s-point moving averages

Centered Moving Averages

§      Used when an even number of values is used in the moving average

§      Average periods of 2.5 or 3.5 don’t match the original periods, so we average two consecutive moving averages to get centered moving averages

Calculating the
Ratio-to-Moving Average

§    Now estimate the  seasonal impact

§    Divide the actual sales value by the centered moving average for that period

Calculating a Seasonal Index

Calculating Seasonal Indexes

Interpreting Seasonal Indexes

§     Suppose we get these seasonal indexes:

Exponential Smoothing

§    A weighted moving average

§    Weights decline exponentially

§    Most recent observation weighted most

§    Used for smoothing and short term forecasting (often one or two periods into the future)

Exponential Smoothing

§    The weight (smoothing coefficient) is  a

§    Subjectively chosen

§    Range from  0  to  1

§    Smaller  a gives more smoothing, larger  a gives less smoothing

§    The weight is:

§    Close to  0  for smoothing out unwanted cyclical and irregular components

§    Close to  1  for forecasting

Exponential Smoothing Model

Exponential Smoothing Example

§     Suppose we use weight  a = .2

Sales vs. Smoothed Sales

§     Fluctuations have been smoothed

§      NOTE:  the smoothed value in this case is generally a little low, since the trend is upward sloping and the weighting factor is only .2

Forecasting Time Period (t + 1)

§     The smoothed value in the current period (t) is used as the forecast value for next period (t + 1)

§     At time  n, we obtain the forecasts of future values, Xn+h of the series

Exponential Smoothing in Excel

§    Use tools / data analysis /

exponential smoothing

§   The “damping factor” is  (1 – a)

§            To perform the Holt-Winters method of forecasting:

§            Obtain estimates of level       and trend  Tt as

§            Where  a  and  b  are smoothing constants whose values are fixed between  0  and  1

§            Standing at time  n , we obtain the forecasts of future values,  Xn+h of the series by

§           Assume a seasonal time series of period  s

§           The Holt-Winters method of forecasting uses a set of recursive estimates from historical series

§           These estimates utilize a level factor,  a, a trend factor,  b, and a multiplicative seasonal factor,  g

§            The recursive estimates are based on the following equations

§    After the initial procedures generate the level, trend, and seasonal factors from a historical series we can use the results to forecast  future values  h  time periods ahead from the last observation Xn in the historical series

§    The forecast equation is

Autoregressive Models

§    Used for forecasting

§    Takes advantage of autocorrelation

§    1st order – correlation between consecutive values

§    2nd order – correlation between values 2 periods apart

§    pth order autoregressive model:

Autoregressive Models

§     Let Xt (t = 1, 2, . . ., n) be a time series

§     A model to represent that series is the autoregressive model of order p:

§     where

§    g, f1 f2, . . .,fp are fixed parameters

§    et are random variables that have

§   mean 0

§   constant variance

§   and are uncorrelated with one another

Autoregressive Models

§     The parameters of the autoregressive model are estimated through a least squares algorithm, as the values of g, f1 f2, . . .,fp for which the sum of squares

is a minimum

Forecasting from Estimated Autoregressive Models

§      Consider time series observations  x1,  x2,  . . . , xt

§      Suppose that an autoregressive model of order p has been fitted to these data:

§      Standing at time n, we obtain forecasts of future values of the series from

§ Where for  j > 0,           is the forecast of Xt+j standing at time  n  and for  j £ 0 ,           is simply the observed value of  Xt+j

Autoregressive Model:
Example

Autoregressive Model:
Example Solution

Autoregressive Model Example: Forecasting

Autoregressive Modeling Steps

§          Choose p

§ Form a series of “lagged predictor” variables   xt-1 , xt-2 , … ,xt-p

§          Run a regression model using all  p  variables

§          Test model for significance

§          Use model for forecasting

Chapter Summary

§     Discussed weighted and unweighted index numbers

§     Used the runs test to test for randomness in time series data

§     Addressed components of the time-series model

§     Addressed time series forecasting of seasonal data using a seasonal index

§     Performed smoothing of data series

§    Moving averages

§    Exponential smoothing

§     Addressed autoregressive models for forecasting