Chapter 17 Time Series Analysis and Forecasting ©.

21
Chapter 17 Chapter 17 Time Series Time Series Analysis and Analysis and Forecasting Forecasting ©

Transcript of Chapter 17 Time Series Analysis and Forecasting ©.

Page 1: Chapter 17 Time Series Analysis and Forecasting ©.

Chapter 17Chapter 17

Time Series Analysis Time Series Analysis and Forecastingand Forecasting

©

Page 2: Chapter 17 Time Series Analysis and Forecasting ©.

Time SeriesTime Series

A time seriestime series is a set of measurements, ordered over time, on a particular quantity of interest. In a time series the sequence of the observations is important, in contrast to cross section data for which the sequence of observations is not important.

Page 3: Chapter 17 Time Series Analysis and Forecasting ©.

Prices and Price Index for Ford Prices and Price Index for Ford Motor Company Stock Over 12 Motor Company Stock Over 12

WeeksWeeks(Figure 17.1)(Figure 17.1)

Week Price Price Index1 20.250 100.02 19.875 98.13 19.000 93.84 19.750 97.55 20.250 100.06 19.875 98.17 19.375 95.78 19.625 96.99 21.125 104.3

10 22.375 110.511 25.000 123.512 23.000 113.6

Page 4: Chapter 17 Time Series Analysis and Forecasting ©.

Calculating Price Indices for Calculating Price Indices for a Single Itema Single Item

Suppose that we have a series of 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. Thus, if p0 denotes the price in the base period and p1 the price in a second period, the price index for this second period is

0

1100p

p

Page 5: Chapter 17 Time Series Analysis and Forecasting ©.

An Unweighted Price IndexAn Unweighted Price IndexSuppose that we have a series of observations over time on the prices of a group of K items. As before, one time is chosen as a base.The unweighted aggregate index of pricesunweighted aggregate index of prices is obtained by calculating the average price of these items in each time period and calculating an index for these average prices. That is, the average price in every period is expressed as a percentage of the average price in the base period. Let p0i denote the price of the ith item in the base period and p1i, the price of this item in a second period. The unweighted aggregate index of prices for this second period is

K

ii

K

ii

p

p

10

11

100

Page 6: Chapter 17 Time Series Analysis and Forecasting ©.

The Laspeyres Price IndexThe Laspeyres Price IndexSuppose that we have a group of K commodities for which price information is available over a period of time. One period is selected as the base for an index. The Laspeyres price indexLaspeyres price index in any period is the total cost of purchasing the quantities traded in the base period at prices in the period of interest, expressed as a percentage of the total cost of purchasing these same quantities in the base period.Let p0i denote the price and q0i the quantity purchased of the ith item in the base period. If p1i is the price of the ith item in a second period, the Laspeyres price index for the period is

K

iii

K

iii

pq

pq

100

110

100

Page 7: Chapter 17 Time Series Analysis and Forecasting ©.

The Laspeyres Quantity The Laspeyres Quantity IndexIndex

We have quantity data for a set of items collected over a set of K years. One period is selected as the base period. The Laspeyres quantity indexLaspeyres quantity index in any period is then the total cost of the quantities traded in that period, based on the base period prices, expressed as a percentage of the total cost of the base period quantities.Let p0i and q0i denote the price and quantity of the ith item in the base period and q1i the quantity of that item in the period of interest. The Laspeyres quantity index for that period is then

K

iii

K

iii

pq

pq

100

101

100

Page 8: Chapter 17 Time Series Analysis and Forecasting ©.

The Runs TestThe Runs Test

Suppose we have a time series of n observations. Denote observations above the median with “+” signs and observations below the median with “-” signs. Use these signs to define the sequence of observations in the series. Let R denote the number of runs in the sequence. The null hypothesis is that the series is a set of random variables. Table 11 of the appendix gives the smallest significance level against which this null hypothesis can be rejected against the alternative of positive association between adjacent observations, as a function of R and n.

If the alternative is the two-sided hypothesis on nonrandomness, the significance level must be doubled if it is less than0.5. Alternatively, if the significance level, , read from the table is bigger than 0.5, the appropriate significance level for the test against the two-sided alternative is 2(1 - ).

Page 9: Chapter 17 Time Series Analysis and Forecasting ©.

The Runs Test: Large The Runs Test: Large SamplesSamples

Given that we have a time series with n observations, n>20, define the number of runs , R, as the number of sequences above or below the median. We want to test the null hypothesis

The following tests have significance level :

(i) If the alternative hypothesis is positive association between adjacent observations, the decision rule is:

random is series The :H0

Z

nnn

nR

)1(42

12 Zif HReject

20

Page 10: Chapter 17 Time Series Analysis and Forecasting ©.

The Runs Test: Large The Runs Test: Large SamplesSamples

(continued)(continued)

(ii) If the alternative is two-sided, of nonrandomness, the decision rule is

2/22/20

)1(42

12Z

)1(42

12 Zif HReject Z

nnn

nR

orZ

nnn

nR

Page 11: Chapter 17 Time Series Analysis and Forecasting ©.

Time Series Components Time Series Components AnalysisAnalysis

A time series can be described by models based on the following componentsTt Trend Component

St Seasonal Component

Ct Cyclical Component

It Irregular Component

Using these components we can define a time series as the sum of its components or an additive modeladditive model

Alternatively, in other circumstances we might define a time series as the product of its components or a multiplicative modelmultiplicative model – often represented as a logarithmic model

ttttt ICSTX

ttttt ICSTX

Page 12: Chapter 17 Time Series Analysis and Forecasting ©.

Simple Centered (2m+1)-Point Simple Centered (2m+1)-Point Moving AverageMoving Average

Let X1, X2, . . . , Xn be n observations on a time series of interest. A smoothed series can be obtained by using a simple centered simple centered (2m + 1)-point moving average(2m + 1)-point moving average

m

mjjtt mnmmtX

mX ),,2,1(

12

1*

Page 13: Chapter 17 Time Series Analysis and Forecasting ©.

A Simple Moving Average A Simple Moving Average Procedure for Seasonal Procedure for Seasonal

AdjustmentAdjustment

Let Xt (t = 1, 2, . . . ,n) be seasonal time series of period s (s = 4 for quarterly data and s = 12 for monthly data). A centered s-point centered s-point moving averagemoving average series Xt

*, is obtained through the following steps, where it is assumed that s is even:

(i) Form the s-point moving averages

(ii) Form the centered s-point moving averages

2/

1)2/(

*5. )

2,,2

2,1

2,

2(

s

sjjtt

sn

ssstXX

)2

,,22

,12

(2

*5.

*5.* s

nss

tXX

X ttt

Page 14: Chapter 17 Time Series Analysis and Forecasting ©.

Forecasting Through Simple Forecasting Through Simple Exponential SmoothingExponential Smoothing

Let X1, X2, . . . , Xn be a set of observations on a nonseasonal time series with no consistent upward or downward trend. The simple simple exponential smoothing methodexponential smoothing method of forecasting then proceeds as follows

(i) Obtain the smoothed series

Where is a smoothing constant whose value is fixed between 0 and 1.

(ii) Standing at time n, we obtain the forecasts of future values, X n+h of the series

as ˆtX

11ˆ XX

),,2,1;10()1(ˆˆ1 ntXXX ttt

)3,2,1(ˆˆ hXX nhn

Page 15: Chapter 17 Time Series Analysis and Forecasting ©.

Forecasting with the Holt-Forecasting with the Holt-Winters Method: Nonseasonal Winters Method: Nonseasonal

SeriesSeriesLet X1, X2, . . . , Xn be a set of observations on a

nonseasonal time series. The Holt-Winters Holt-Winters method of forecastingmethod of forecasting proceeds as follows

(i) Obtain estimates of level and trend Tt as

Where and are smoothing constants whose value are fixed between 0 and 1.

(ii) Standing at time n, we obtain the forecasts of future values, X n+h of the series by

tX̂

12221ˆ XXTXX

),,4,3;10()1()ˆ(ˆ11 ntXTXX tttt

nnhn hTXX ˆˆ

),,4,3;10()ˆˆ)(1( 11 ntXXTT tttt

Page 16: Chapter 17 Time Series Analysis and Forecasting ©.

Forecasting with the Holt-Forecasting with the Holt-Winters Method: Seasonal Winters Method: Seasonal

SeriesSeries

Let X1, X2, . . . , Xn be a set of observations on a seasonal time series of period s (with s = 4 for quarterly data and s = 12 for monthly data). The Holt-Winters method of forecasting uses a set of recursive estimates from historical series. These estimates utilize a level factor, , a trend factor, , and a multiplicative seasonal factor, . The recursive estimates are based on the following equations )10()1()ˆ(ˆ

11

st

tttt F

XTXX

)10(ˆ

)1( t

tstt

X

XFF

)10()ˆˆ)(1( 11 tttt XXTT

Page 17: Chapter 17 Time Series Analysis and Forecasting ©.

Forecasting with the Holt-Forecasting with the Holt-Winters Method: Seasonal Winters Method: Seasonal

SeriesSeries(continued)(continued)

Where is the smoothed level of series, Tt is the smoothed trend of the series, and Ft is the smoothed seasonal adjustment for the series. The computational details are left to a computer.

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

We note that the seasonal factor, Ft, is the one generated for the most recent seasonal time period.

tX̂

shttthn FhTXX )ˆ(ˆ

Page 18: Chapter 17 Time Series Analysis and Forecasting ©.

Autoregressive Models and Autoregressive Models and Their EstimationTheir Estimation

Let Xt (t = 1, 2, . . ., n) be a time series. A model that can often be used effectively to represent that series is the autoregressive model of order p:

Where , 1 2, . . .,p are fixed parameters and the t are random variables that have means 0 and constant variance and are uncorrelated with one another.The parameters of the autoregressive model are estimated through a least squares algorithm, as the values of , 1 2, . . .,p for which the sum of squares

is a minimum.

tptpttt XXXX 2211

22211

1

)( ptptt

n

ptt XXXXSS

Page 19: Chapter 17 Time Series Analysis and Forecasting ©.

Forecasting From Estimated Forecasting From Estimated Autoregressive ModelsAutoregressive Models

Suppose that we have observations X1, X2, . . .,Xt from a time series and that an autoregressive model of order p has been fitted to these data Write the estimated model as:

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

Where for j > 0, is the forecast of X t+j standing at time n and for j 0, is simply the observed value of X t+j .

tptpttt XXXX ˆˆˆˆ 2211

),3,2,1(ˆˆˆˆˆˆˆˆ2211 hXXXX phtphththt

jnX ˆ

jnX ˆ

Page 20: Chapter 17 Time Series Analysis and Forecasting ©.

Key WordsKey Words ARIMA Models Autoregressive Models and

Their Estimation Calculating Price Indices for

a Single Item Change in Base Period Forecasting with the Holt-

Winters Method: Nonseasonal Series

Forecasting with the Holt-Winters Method: Seasonal Series

Forecasting From Estimated Autoregressive Models

Forecasting Through Simple Exponential Smoothing

Index Numbers Laspeyres Price Index Runs Test Runs Test: Large Samples Simple Centered (2m+1)-

Point Moving Averages Simple Exponential

Smoothing Simple Moving Average

Procedure for Seasonal Adjustment

Page 21: Chapter 17 Time Series Analysis and Forecasting ©.

Key WordsKey Words(continued)(continued)

Spliced Price Index Time Series Time Series

Components Analysis Unweighted Price Index Weighted Aggregate

Quantity Index Weighted Price Index