3. Regression & Exponential Smoothing



Similar documents
Trend and Seasonal Components

Sales and operations planning (SOP) Demand forecasting

MATH 4552 Cubic equations and Cardano s formulae

Rob J Hyndman. Forecasting using. 11. Dynamic regression OTexts.com/fpp/9/1/ Forecasting using R 1

5. Multiple regression

Time series Forecasting using Holt-Winters Exponential Smoothing

Week 5: Multiple Linear Regression

Simple Linear Regression Inference

Introduction to time series analysis

Ch.3 Demand Forecasting.

8. Time Series and Prediction

Regression Analysis LECTURE 2. The Multiple Regression Model in Matrices Consider the regression equation. (1) y = β 0 + β 1 x β k x k + ε,

Sales forecasting # 2

A Regime-Switching Model for Electricity Spot Prices. Gero Schindlmayr EnBW Trading GmbH

TIME SERIES ANALYSIS

TIME SERIES ANALYSIS

Lecture 3: Linear methods for classification

2. What is the general linear model to be used to model linear trend? (Write out the model) = or

Spatial Statistics Chapter 3 Basics of areal data and areal data modeling

Demand Forecasting LEARNING OBJECTIVES IEEM Understand commonly used forecasting techniques. 2. Learn to evaluate forecasts

5. Linear Regression

Forecasting in supply chains

Introduction to time series analysis

NCSS Statistical Software Principal Components Regression. In ordinary least squares, the regression coefficients are estimated using the formula ( )

Theory at a Glance (For IES, GATE, PSU)

A Primer on Forecasting Business Performance

Demand Forecasting When a product is produced for a market, the demand occurs in the future. The production planning cannot be accomplished unless

Overview of Violations of the Basic Assumptions in the Classical Normal Linear Regression Model

16 : Demand Forecasting

Simple Methods and Procedures Used in Forecasting

Forecasting in STATA: Tools and Tricks

Econometrics Simple Linear Regression

VISUALIZATION OF DENSITY FUNCTIONS WITH GEOGEBRA

Precalculus REVERSE CORRELATION. Content Expectations for. Precalculus. Michigan CONTENT EXPECTATIONS FOR PRECALCULUS CHAPTER/LESSON TITLES

Chapter 4: Vector Autoregressive Models

Time Series Analysis and Forecasting

State Space Time Series Analysis

4. Simple regression. QBUS6840 Predictive Analytics.

Introduction to General and Generalized Linear Models

Time Series Analysis

Chapter 13 Introduction to Nonlinear Regression( 非 線 性 迴 歸 )

17. SIMPLE LINEAR REGRESSION II

Understanding Poles and Zeros

Time Series Analysis

Least Squares Estimation

Lean Six Sigma Analyze Phase Introduction. TECH QUALITY and PRODUCTIVITY in INDUSTRY and TECHNOLOGY

Regression Analysis: A Complete Example

Time Series Analysis

Lecture 4: Seasonal Time Series, Trend Analysis & Component Model Bus 41910, Time Series Analysis, Mr. R. Tsay

Fitting Subject-specific Curves to Grouped Longitudinal Data

Forecast. Forecast is the linear function with estimated coefficients. Compute with predict command

CHAPTER 13 SIMPLE LINEAR REGRESSION. Opening Example. Simple Regression. Linear Regression

Forecasting methods applied to engineering management

Module 5: Multiple Regression Analysis

Inner Product Spaces

Topic 5: Stochastic Growth and Real Business Cycles

Time Series Analysis and Forecasting Methods for Temporal Mining of Interlinked Documents

Week TSX Index

Penalized Logistic Regression and Classification of Microarray Data

Causal Forecasting Models

POLYNOMIAL AND MULTIPLE REGRESSION. Polynomial regression used to fit nonlinear (e.g. curvilinear) data into a least squares linear regression model.

Department of Mathematics, Indian Institute of Technology, Kharagpur Assignment 2-3, Probability and Statistics, March Due:-March 25, 2015.

VI. Real Business Cycles Models

Part 2: Analysis of Relationship Between Two Variables

2.2 Elimination of Trend and Seasonality

Notes on Applied Linear Regression

Exploratory Factor Analysis and Principal Components. Pekka Malo & Anton Frantsev 30E00500 Quantitative Empirical Research Spring 2016

Estimation of σ 2, the variance of ɛ

Section A. Index. Section A. Planning, Budgeting and Forecasting Section A.2 Forecasting techniques Page 1 of 11. EduPristine CMA - Part I

MGT 267 PROJECT. Forecasting the United States Retail Sales of the Pharmacies and Drug Stores. Done by: Shunwei Wang & Mohammad Zainal

Integrated Resource Plan

Time Series Analysis. 1) smoothing/trend assessment

Time Series Analysis

Simple Predictive Analytics Curtis Seare

1 Simple Linear Regression I Least Squares Estimation

CURVE FITTING LEAST SQUARES APPROXIMATION

Logistic Regression. Jia Li. Department of Statistics The Pennsylvania State University. Logistic Regression

Forecasting Methods. What is forecasting? Why is forecasting important? How can we evaluate a future demand? How do we make mistakes?

A LOGNORMAL MODEL FOR INSURANCE CLAIMS DATA

a. all of the above b. none of the above c. B, C, D, and F d. C, D, F e. C only f. C and F

NOV /II. 1. Let f(z) = sin z, z C. Then f(z) : 3. Let the sequence {a n } be given. (A) is bounded in the complex plane

Time Series and Forecasting

TOURISM DEMAND FORECASTING USING A NOVEL HIGH-PRECISION FUZZY TIME SERIES MODEL. Ruey-Chyn Tsaur and Ting-Chun Kuo

Smoothing methods. Marzena Narodzonek-Karpowska. Prof. Dr. W. Toporowski Institut für Marketing & Handel Abteilung Handel

I. Introduction. II. Background. KEY WORDS: Time series forecasting, Structural Models, CPS

Course 4 Examination Questions And Illustrative Solutions. November 2000

Gamma Distribution Fitting

Unit 31 A Hypothesis Test about Correlation and Slope in a Simple Linear Regression

A characterization of trace zero symmetric nonnegative 5x5 matrices

GAM for large datasets and load forecasting

Least-Squares Intersection of Lines

Module 6: Introduction to Time Series Forecasting

South Carolina College- and Career-Ready (SCCCR) Pre-Calculus

Analysis of Bayesian Dynamic Linear Models

1. What is the critical value for this 95% confidence interval? CV = z.025 = invnorm(0.025) = 1.96

5. Orthogonal matrices

Machine Learning in Statistical Arbitrage

Transcription:

3. Regression & Exponential Smoothing 3.1 Forecasting a Single Time Series Two main approaches are traditionally used to model a single time series z 1, z 2,..., z n 1. Models the observation z t as a function of time as z t = f(t, β) + ε t where f(t, β) is a function of time t and unknown coefficients β, and ε t are uncorrelated errors. 1

Examples: The constant mean model: z t = β + ε t The linear trend model: z t = β 0 + β 1 t + ε t Trigonometric models for seasonal time series z t = β 0 + β 1 sin 2π 12 t + β 2 cos 2π 12 t + ε t 2. A time Series modeling approach, the observation at time t is modeled as a linear combination of previous observations Examples: The autoregressive model: z t = j 1 π jz t j + ε t The autoregressive and moving average model: z t = p π j z t j + q θ i ε t i + ε t j=1 j=1 2

Discounted least squares/general exponential smoothing n w t [z t f(t, β)] 2 t=1 Ordinary least squares: w t = 1. w t = w n t, discount factor w determines how fast information from previous observations is discounted. Single, double and triple exponential smoothing procedures The constant mean model The Linear trend model The quadratic model 3

3.2 Constant Mean Model z t = β + ε t β: a constant mean level ε t : a sequence of uncorrelated errors with constant variance σ 2. If β, σ are known, the minimum mean square error forecast of a future observation at time n + l, z n+l = β + ε n+l is given by z n (l) = β E[z n+l z n (l)] = 0, E[z n+1 z n (l)] 2 = E[ε 2 t] = σ 2 100(1 λ) percent prediction intervals for a future realization are given by [β µ λ/2 σ; β + µ λ/2 σ] where µ λ/2 distribution. is the 100(1 λ/2) percentage point of standard normal 4

If β, σ are unknown, we use the least square estimate ˆβ to replace β n ˆβ = z = 1 n t=1 z t The l-step-ahead forecast of z n+l from time origin n by ẑ n (l) = z, ˆσ 2 = 1 n 1 n (z t z) 2 E[z n+l ẑ n (l)] = 0, Eˆσ 2 = σ 2, E[z n+1 ẑ n (l)] 2 = σ ( ) 2 1 + 1 n 100(1 λ) percent prediction intervals for a future realization are given by [ ( β t λ/2 (n 1)ˆσ 1 + n)1 1 2 ( ] ; β + tλ/2 (n 1)ˆσ 1 + 1 )1 2 n where t λ/2 (n 1) is the 100(1 λ/2) percentage point of t distribution with n 1 degree of freedom. t=1 5

Updating Forecasts ẑ n+1 = = 1 n + 1 (z 1 + z 2 + + z n + z n+1 ) = 1 n + 1 [z n+1 + nẑ n (1)] n n + 1ẑn(1) + 1 n + 1 z n+1 = ẑ n (1) + 1 n + 1 (z n+1 ẑ n (1)) Checking the adequacy of the model Calculate the sample autocorrelation r k of the residuals z t z r k = n t=k+1 (z t z)(z t k z) n, k = 1, 2,... (z t z) 2 t=1 If n r k > 2: something might have gone wrong. 6

Example 3.1 Annual U.S. Lumber Production Consider the annual U.S. lumber production from 1947 through 1976. The data were obtained from U.S. Department of Commerce Survey of Current Business. The 30 observations are listed in Table Table 3.1: Annual Total U.S. Lumber Production (Millions of Broad Feet), 1947-1976 (Table reads from left to right) 35,404 36,762 32,901 38,902 37,515 37,462 36,742 36,356 37,858 38,629 32,901 33,385 32,926 32,926 32,019 33,178 34,171 35,697 35,697 35,710 34,449 36,124 34,548 34,548 36,693 38,044 38,658 32,087 32,087 37,153 7

Figure 3.1: Annual U.S. lumber production from 1947 to 1976(in millions of board feet) 3.9 3.8 4 x 104 Lumber production (MMbf) 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3 1950 1955 1960 1965 1970 1975 1980 Year 8

The plot of the data in Figure 3.1. The sample mean and the sample standard deviation are given by z = 35, 625, ˆσ = { 1 29 (zt z) 2 } 1 2 = 2037 The sample auto correlations of the observations are list below Lag k 1 2 3 4 5 6 Sample autocorrelation.20 -.05.13.14.04 -.17 Comparing the sample autocorrelations with their standard error 1/ 30 =.18, we cannot find enough evidence to reject the assumption of uncorrelated error terms. 9

The forecast from the constant mean model are the same for all forecast lead times and are given by ẑ 1976 (l) = z = 35, 652 The standard error of these forecast is given by ˆσ 1 + 1/n = 2071 A 95 percent prediction interval is given by [35, 652 ± (2.045)(2071)] or [31, 417, 39, 887] If new observation become available, the forecasts are easily updated. For example if Lumber production in 1977 was 37,520 million board feet. Then the revised forecasts are given by ẑ 1977 (l) = ẑ 1976 (1) + 1 n + 1 [z 1977 ẑ 1976 (1)] = 35, 652 + 1 [37, 520 35, 652] 31 = 35, 712 10

3.3 Locally Constant Mean Model and Simple Exponential Smoothing Reason: In many instances, the assumption of a time constant mean is restrictive. It is more reasonable to allow for a mean that moves slowly over time Method: Give more weight to the most recent observation and less to the observations in the distant past ẑ n (l) = c n 1 t=0 w t z n t = c[z n + wz n 1 + + w n 1 z 1 ] w( w < 1): discount coefficient, c = (1 w)/(1 w n ) is needed to normalized sum of weights to 1. If n and w < 1, then w n 0, then ẑ n (l) = (1 w) j 0 w j z n j 11

Smoothing constant: α = 1 w. Smoothing statistics S n = S [1] n = (1 w)[z n + wz n 1 + w 2 z n 2 + ] = α[z n + (1 α)z n 1 + (1 α) 2 z n 2 + ] Updating Forecasts: (As easy as the constant mean model) S n = (1 w)z n + ws n 1 = S n 1 + (1 w)[z n S n 1 ] ẑ n (1) = (1 w)z n + wẑ n 1 (1) = ẑ n 1 (1) + (1 w)[z n ẑ n 1 (1)] 12

Actual Implementation of Simple Exp. Smoothing Initial value for S 0 S n = (1 w)[z n + wz n 1 + + w n 1 z 1 ] + w n S 0 1. S 0 = z, (mean change slowly, α. = 0); 2. S 0 = z 1, (local mean changes quickly α. = 1); 3. Backforecast S j = (1 w)z j + ws j+1, S n+1 = z n, S 0 = z 0 = S1 = (1 w)z 1 + ws2 Choice of the Smoothing Constant: α = 1 w e t 1 (1) = z t ẑ t 1 (1) = z t S t 1, (one step ahead forecast error). Then minimize n SSE(α) = e 2 t 1(1). t=1 13

The smoothing constant that is obtained by simulation depends on the value of S 0 Ideally, since the choice of α depend on S 0, one should choose α and S 0 jointly Examples If α = 0, one should choose S 0 = z. If α = 1, one should choose S 0 = z 1 If 0 < α < 1, one could choose S 0 as the backforecast value: S 0 = α[z 1 + (1 α)z 2 + + (1 α) n 2 z n 1 ] + (1 α) n 1 z n. 14

Example: Quarterly Iowa Nonfarm Income As an example, we consider the quarterly Iowa nonfarm income for 1948-1979. The data exhibit exponential growth. Instead of analyzing and forecasting the original series, we first model the quarterly growth rates of nonfarm income. z t = I t+1 I t I t 100 100 log I t+1 I t The constant mean model would be clearly inappropriate. Compared with the standard error 1/ 127 =.089, most autocorrelations are significantly different from zero Table 3.2: Sample Autocorrelations r k of Growth Rates of Iowa Nofarm Income (n=127) Lag k 1 2 3 4 5 6 Sample autocorrelation r k.25.32.18.35.18.22 15

Iowa nonfarm income, first quarter 1948 to fourth quarter 1979 6000 5000 Iowa nofarm income (million $) 4000 3000 2000 1000 0 1950 1955 1960 1965 1970 1975 1980 Year 16

Growth rates of Iowa nonfarm income, second quarter 1948 to fourth quarter 1979 5 4 3 Growth rate (%) 2 1 0 1 2 1950 1955 1960 1965 1970 1975 1980 Year 17

Since the mean is slowly changing, simple exponential smoothing appears to be an appropriate method. α = 0.11 and S 0 = z = 1.829. SSE(.11) = n e 2 t 1(1) = ( 1.329) 2 + (.967) 2 + + (.458) 2 + (.342) 2 = 118.19 t=1 As a diagnostic check, we calculate the sample autocorrelations of the one-step-ahead forecast errors r k = n 1 t=k [e t (1) ē][e t k (1) ē] n 1 t=0 [e t (1) ē] 2, ē = 1 n n 1 t=0 e t (1). To assess the significance of the mean of the forecast errors, we compare it with standard error s/n 1/2 (1/ 127 =.089), where s 2 = 1 n n 1 t=0[e t (1) ē] 2 18

19

20

21

22

3.4 Regression Models with Time as Independent Variable z n+j = m β i f i (j) + ε n+j = f (j)β + ε n+j i=1 f(j + 1) = Lf(j), L = (l ij ) m m full rank. (Difference equations). Equivalent model: z n+j = m βi f i (n + j) + ε n+j = f (n + j)β + ε n+j ; i=1 f(n + j) = L n f(j) β = L n β. Examples: Constant Mean Model, Linear Trend Model, Quadratic Trend Model, k th order Polynomial Trend Model, 12-point Sinusoidal Model 23

Estimation: ˆβ n minimizes n j=1 [z j f (j n)β] 2 y = (z 1, z 2,..., z n ), X = (f( n + 1),..., f(0)) Prediction X X = n 1 j=0 f( j)f ( j) ˆ=F n, X y = ˆβ n = F 1 n h n. n 1 j=0 f( j)z n j ˆ=h n ẑ n (l) = f (l)ˆβ n, Var(e n (l)) = σ 2 [1 + f (l)f 1 n f(l)], ˆσ 2 = 1 n m n 1 (z n j f ( j)ˆβ n ) 2. j=0 100(1 λ)% CI : ẑ n (l) ± t λ/2 (n m)ˆσ[1 + f (l)f 1 f(l)] 1 2. 24

Updating Estimates and Forecasts: ˆβ n+1 = F 1 n+1 h n+1. F n+1 = F n + f( n)f ( n); h n+1 = n f( j)z n+1 j = f(0)z n+1 + j=0 = f(0)z n+1 + n 1 j=0 n 1 j=0 f( j 1)z n j L 1 f( j)z n j = f(0)z n+1 + L 1 h n ẑ n+1 (l) = f (l)ˆβ n+1. 25

3.5 Discounted Least Square and General Exponential Smoothing In discounted least squares or general exponential smoothing, the parameter estimates are determined by minimizing n 1 j=0 w j [z n j f ( j)β] 2 The constant w( w < 1) is a discount factor the discount past observation exponentially. Define W = diag(w n 1 w n 2 w 1); F n ˆ=X WX = h n ˆ=X Wy = n 1 j=0 n 1 j=0 w j f( j)f ( j) w j f( j)z n j 26

Estimation and Forecasts ˆβ n = F 1 n h n, ẑ n (l) = f (l)ˆβ n. Updating Parameter Estimates and Forecasts ˆβ n+1 = F 1 n+1 h n+1, F n+1 = F n + f( n)f ( n)w n ; h n+1 = n w j f( j)z n+1 j = f(0)z n+1 + wl 1 h n j=0 If n, then w n f( n)f ( n) 0, and F n+1 = F n + f( n)f ( n)w n F as n. Hence ˆβ n+1 = F 1 f(0)z n+1 + [L F 1 f(0)f (0)L ]ˆβ n = L ˆβn + F 1 f(0)[z n+1 ẑ n (1)]. ẑ n+1 (l) = f (l)ˆβ n+1. 27

3.5 Locally Constant Linear Trend and Double Exp. Smoothing Locally Constant Linear Trend Model z n+j = β 0 + β 1 j + ε n+j [ ] Definition f(j) = [1 j] 1 0, L =. 1 1 F = [ w j f( j)f w j ] jw ( j) = j jw j j 2 w j = [ 1 1 w w (1 w) 2 w (1 w) 2 w(1+w) (1 w) 2 ] Discount least squares that minimizing n 1 ˆβ n = F 1 h n = j=1 [ 1 w 2 (1 w) 2 (1 w) 2 (1 w) 3 w w j [z n j f ( j)β] 2, thus ] [ ] w j z n j jw j z n j 28

Thus ˆβ 0,n = (1 w 2 ) w j z n j (1 w) 2 jw j z n j ˆβ 1,n = (1 w) 2 w j z n j (1 w)3 w jw j z n j In terms of smoothing S [1] n = (1 w)z n + ws [1] n 1 = (1 w) w j z n j, S [2] n = (1 w)s [1] n + ws [2] n 1 = (1 w)2 (j + 1)w j z n j, S n [k] = (1 w)s n [k 1] + ws [k] n 1. (S [0] n = (no smoothing) = z n ) Then ˆβ 0,n = 2S [1] n S [2] n, ˆβ 1,n = 1 w w (S[1] n S n [2] ). ẑ n (l) = ˆβ 0,n + ˆβ 1,n l = (2 + 1 w w l)s[1] n (1 + 1 w w l)s[2] n. 29

Updating: ˆβ 0,n+1 = ˆβ 0,n + ˆβ 1,n + (1 w 2 )[z n+1 ẑ n (1)], ˆβ 1,n+1 = ˆβ 1,n + (1 w) 2 [z n+1 ẑ n (1)]; Or in another combination form: ˆβ 0,n+1 = (1 w 2 )z n+1 + w 2 ( ˆβ 0,n + ˆβ 1,n ), ˆβ 1,n+1 = 1 w 1 + w ( ˆβ 0,n+1 ˆβ 0,n ) + 2w 1 + w ˆβ 1,n. z n+1 ẑ n (1) = 1 1 w 2( ˆβ 0,n+1 ˆβ 0,n ˆβ 1,n ). 30

Implementation Initial Values for S [1] 0 and S [2] 0 S [1] 0 = ˆβ 0,0 w 1 w ˆβ 1,0, S [2] 1 = ˆβ 0,0 2w 1 w ˆβ 1,0 ; where the ( ˆβ 0,0, ˆβ 1,0 ) are usually obtained by considering a subset of the data fitted by the standard model z t = β 0 + β 1 t + ε t. Choice of the Smoothing Constant α = 1 w The smoothing constant α is chosen to minimize the SSE: SSE(α) = (z t ẑ t 1 ) 2 = [ z t ( 2 + α ) ( S [1] t 1 1 α + 1 + α ) 2 S [2] 1 α t 1]. 31

Example: Weekly Thermostat Sales As an example for double exponential smoothing, we analyze a sequence of 52 weekly sales observations. The data are listed in Table and plotted in Figure. The data indicates an upward trend in the thermostat sales. This trend, however, does not appear to be constant but seems to change over time. A constant linear trend model would therefore not be appropriate. Case Study II: University of Iowa Student Enrollments As another example, we consider the annual student enrollment (fall and spring semester combined) at the University of Iowa. Observations for last 29 years (1951/1952 through 1979/1980) are summarized in Table. A plot of the observations is given in Figure. 32

33

400 350 Thermostat Sales 300 250 200 150 100 0 5 10 15 20 25 30 35 40 45 50 55 Week Weekly thermostat sales 34

35

36

37

38

3.6 Regression and Exponential Smoothing Methods to Forecast Seasonal Time Series Seasonal Series: Series that contain seasonal components are quite common, especially in economics, business, and the nature sciences. Much of seasonality can be explained on the basis of physical reasons. The earth s rotation around the sun, for example, introduces a yearly seasonal pattern into may of the meteorological variables. The seasonal pattern in certain variables, such as the one in meteorological variables, is usually quite stable and deterministic and repeats itself year after year. The seasonal pattern in business and economic series, however, is frequently stochastic and changes with time. Apart from a seasonal component, we observe in many series an additional trend component. 39

40

41

42

z t = T t S t + ε t 43 The traditional approach to modeling seasonal data is to decompose the series into three components: a trend T t, a seasonal component S t and an irregular (or error) component ε t The additive decomposition approach z t = T t + S t + ε t The multiplicative decomposition approach z t = T t S t ε t or log z t = Tt + St + ε t The other multiplicative model

3.6.1 Globally Constant Seasonal Models Consider the additive decomposition model z t = T t + S t + ε t Traditionally the trend component T t is modeled by low-order polynomials of time t: k t i T t = β 0 + β i i! The seasonal component S t can be described by seasonal indicators s S t = δ i IND ti i=1 where IND ti = 1 if t corresponds to the seasonal period i, and 0 otherwise, or by trigonometric functions m S t = A i sin( 2πi s t + φ i). i=1 where A i and φ i are amplitude and the phase shift of the sine function with frequency f i = 2πi/s. 44 i=1

Modeling the Additive Seasonality with Seasonal Indicators z t = β 0 + k i=1 β i t i i! + s i=1 δ i IND ti + ε t. Since it uses s + 1 parameters ( β 0 and s seasonal indicators) to model s seasonal intercepts, restrictions have to be imposed before the parameters can be estimated. Several equivalent parameterizations are possible Omit the intercept: β 0 = 0. Restrict s i=1 δ i = 0. Set one of the δ s equal to zero; for example δ s = 0. Mathematically these modified models are equivalent, but for convenience we usually choose (3). 45

Now we have the standard regression model: k t i s 1 z t = β 0 + β i i! + δ i IND ti + ε t. Hence i=1 i=1 β = (β 0, β 1,..., β k, δ 1,..., δ s 1 ); ˆβ = (XX ) 1 X y, y = (z 1, z 2,..., z n ); X is an n (k + s)matrix with tth row given by ) f t22 tk (t) = (1, t,,, k!, IND t1,, IND t,s 1 The minimum mean square error forecast of z n+l can be calculated from 100(1 α)% prediction interval ẑ n (l) = f (n + l)ˆβ where ẑ n (l) ± t λ/2 (n k s)ˆσ[1 + f (n + l)(xx ) 1 f(n + l)] 2 1, ˆσ 2 1 n = (z t f (t)ˆβ) 2. 46 n k s t=1

Change of Time Origin in the Seasonal Indicator Model As we mentioned in previous sections, it might be easier to update the estimates/ prediction if we use the last observational time n as the time origin. In this case k j i z n+j = β 0 + β i i! + s 1 δ i IND ji + ε n+j. i=1 i=1 ) f (j) = (1, j, j2 2,, jk k!, IND j1,, IND j,s 1 F n = Hence the prediction: n 1 j=0 100(1 α)% prediction interval ˆβ n = F 1 n h n f( j)f ( j),, h n = ẑ n (l) = f (l)ˆβ n 1 j=0 f( j)z n j. ẑ n (l) ± t λ/2 (n k s)ˆσ[1 + f (l)f 1 n f(l)] 1 2, 47

It can be shown that the forecast or fitting functions follow the difference equation f(j) = Lf(j 1), where L is a (k + s) (k + s) transition matrix L = [ ] L11 0 L 21 L 22 As an illustration, let us consider a model with quadratic trend and seasonal period s = 4 j 2 3 z n+j = β 0 + β 1 + β 2 2 + δ i IND ji + ε n+j Then the transition matrix L and the initial vector f(0) are given by i=1 L 11 = 1 1 0 1 0 0 1/2 1 1 L 21 = 1 0 0 0 0 0 0 0 0 L 22 = 1 1 1 1 0 0 0 1 0 Successive application of the difference equation f(j) = Lf(j 1) leads to f(j) = (1, j, j 2 /2, IND j1, IND j2, IND j3 ). 48

Modeling the Seasonality with Trigonometric Functions z t = T t + S t + ε t = β 0 + k i=1 β i t i i! + m i=1 A i sin ( ) 2πi s t + φ i + ε t, where the number of harmonics m should not goes beyond s/2, i.e. half the seasonality. Monthly, quarterly data; s/2 harmonics are usually not necessary This is illustrated in Figure, where we plot E(z t ) = 2 A i sin i=1 ( ) 2πi 12 t + φ i for A 1 = 1, φ 1 = 0, A 2 = 0.70, φ 2 =.6944π. 49

50

Change of Time Origin in the Seasonal Trigonometric Model Examples: 12-point sinusoidal model (k = 0, s = 12, m = 1) z n+j = β 0 + β 11 sin 2πj 12 + β 21 cos 2πj 12 + ε n+j In this case: L = 1 0 0 0 3/2 1/2 0 1/2 3/2, f(0) = 1 0 1 Linear trend model with two superimposed harmonics (k = 1, s = 12, m = 2): z n+j = β 0 +β 1 j+β 11 sin 2πj 12 +β 21 cos 2πj 12 +β 12 sin 4πj 12 +β 22 cos 4πj 12 +ε n+j 51

Target: Minimizing 3.6.2 Locally Constant Seasonal Models z n+j = f (j)β + ε n+j S(β, n) = n 1 j=0 w j [z n j f ( j)β] 2 updating: ˆβ n+1 = L ˆβn + F 1 f(0)[z n+1 ẑ n (1)], (F = j 0 w j f ( j)f( j)) A collection of infinite sums needed to cacluate F for seasonal models is given in the following Table. 52

53

It is usually suggested that the least squares estimate of β in the regression model z t = f (t)β + ε t be taken as initial vector ˆβ 0. To update the estimates, a smoothing constant must be determined. As Brown (1962) suggest that the value of w should lie between (.70) 1/g and (.95) 1/g If sufficient historical data are available, one can estimate w = 1 α by simulation and choose the smoothing constant that minimizes the sum of the squared one-step-ahead forecast errors SSE(α) = n [z t ẑ t 1 (1)] 2 t=1 After estimating the smoothing constant α, one should always check the adequacy of the model. The sample autocorrelation function of the onestep-ahead forecast errors should be calculated. Significant autocorrelations indicate that the particular forecast model is not appropriate. 54

Locally Constant Seasonal Models Using Seasonal Indicators z n+j = β 0 + β 1 j + 3 δ i IND ji + ε n+j = f (j)β i=1 where f(j) = [1 j IND j1 IND j2 IND j3 ], f(0) = [1 0 0 0 0]. Then L = 1 0 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 1 0 0 0 0 0 1 0 Hence the updating weights in ˆβ n+1 = L ˆβn + F 1 f(0)[z n+1 ẑ n (1)] can be calculated from f(0) and the symmetric matrix 55

F = 1 1 w w (1 w) 2 w 3 1 w 4 w 2 1 w 4 w(1+w) w 3 (3+w 4 ) w 2 (2+2w 4 ) (1 w) 3 (1 w 4 ) 2 w 1 w 4 w(1+3w 4 ) (1 w 4 ) 2 (1 w 4 ) 2 w 3 1 w 4 0 0 symmetric w 2 1 w 4 0 w 1 w 4 Implications of α 1 In this situation F singular as w 0. But we have that lim w 0 F 1 f = f = ( 1, 1 s, 1 s, 2 s,, s 1 ) ; s ˆβ n+1 = L ˆβn + f [z n+1 ẑ n (1)]; ẑ n (1) = z n + z n+1 s z n s = z n+1 s + (z n z n s ) ẑ n (l) = ẑ n (l 1) + ẑ n (l s) ẑ n (l s 1) 56

Example: Car Sales Consider the monthly car sales in Quebec from January 1960 through December 1967 (n = 96 observations). The remaining 12 observations (1968) are used as a holdcut period to evaluate the forecast performance. An initial inspection of the series in Figure shows the data may be described by an additive model with a linear trend (k = 1) and a yearly seasonal pattern; the trend and the seasonal components appear fairly constant. z t = β 0 + β 1 t + 11 i=1 δ i IND ti + ε t. 57

30 25 20 Car sales (1000s) 15 10 5 0 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 Year Figure: Monthly car sales in Quebec, Canada; January 1960 to December 1968 58

59

60

61

62

63

64

Example: New Plant and Equipment Expenditures Consider quarterly new plant and equipment expenditures for the first quarter of 1964 through the fourth quarter of 1974 (n = 44). The time series plot in Figure indicate s that the size of the seasonal swings increases with the level of the series; hence a logarithmic transformation must considered. The next Figure shows that this transformation has stabilized the variance. z t = ln y t = β 0 + β 1 + 3 δ i IND ti + ε t i=1 65

40 New plant and equipment expenditures (billion $) 35 30 25 20 15 10 5 0 1964 1966 1968 1970 1972 1974 1976 Year Figure: Quarterly new plant and equipment expenditure in U.S. industries (in billions of dollars), first quarter 1 to fourth quarter 1976 66

Logarithm of new plant and equipment expenditures 3.4 3.2 3 2.8 2.6 2.4 2.2 1964 1966 1968 1970 1972 1974 1976 Year Logarithm of quarterly new plant and equipment expenditures, frist quarter 1964 to fourth quarter 1976 67

68

69

70

71

72

73

74