statistic assignment

profilewhiterose2015
mgmt3100_lecture13_chap7_.pptx

Chapter 7: Forecasting Time Series Models

Lan Wang

CSU East Bay

Some Time Series Terms

Stationary Data - a time series variable exhibiting no significant upward or downward trend over time.

Moving average

Exponential smoothing

Some Time Series Terms

Nonstationary Data - a time series variable exhibiting a significant upward or downward trend over time.

Regression analysis

Some Time Series Terms

Seasonal Data - a time series variable exhibiting a repeating patterns at regular intervals over time.

Seasonal index

Simple Moving Average

Average random fluctuations in a time series to infer short-term changes in direction

Assumption: future observations will be similar to recent past

Moving average for next period = average of most recent k observations

Moving Average Example

The monthly sales for Telco Batteries, Inc. were as follows:

MONTH SALES
February 21
March 15
April 14
May 13
June 16
July 18
August 20

a. Calculate a 3 month moving average forecast for September

b. Calculate a 2 month moving average forecast for September

c. Which moving average forecast is more accurate?

Moving Average Example

Error Metrics and Forecast Accuracy

Mean absolute deviation (MAD)

Mean square error (MSE)

Mean absolute percentage error (MAPE)

The quality of a forecast depends on how accurate it is in predicting future values of a time series.

8

Telco Batteries Example - continued

Exponential Smoothing

Exponential smoothing model:

Ft+1 = (1 – a )Ft + aAt

  = Ft + a (At – Ft )

Ft+1 is the forecast for time period t+1,

Ft is the forecast for period t,

At is the observed value in period t, and

a is a constant between 0 and 1, called the smoothing constant.

Highly effective approach.

10

Exponential Smoothing

The monthly sales for Telco Batteries, Inc. were as follows:

MONTH SALES
February 21
March 15
April 14
May 13
June 16
July 18
August 20

a. Calculate an Exponential Smoothing forecast with alpha = 0.2, for September

b. Calculate an Exponential Smoothing forecast with alpha = 0.3, for September

c. Which Exponential Smoothing forecast is more accurate?

Exponential Smoothing Example - Continued

alpha
Month Sales 0.2 0.3 AD(0.2) AD(0.3) SE(0.2) SE(0.3) APE(0.2) APE(0.3)
February 21 21 21
March 15 21 21 6.00 6.00 36.00 36.00 0.40 0.40
April 14 19.80 19.20 5.80 5.20 33.64 27.04 0.41 0.37
May 13 18.64 17.64 5.64 4.64 31.81 21.53 0.43 0.36
June 16 17.51 16.25 1.51 0.25 2.29 0.06 0.09 0.02
July 18 17.21 16.17 0.79 1.83 0.62 3.34 0.04 0.10
August 20 17.37 16.72 2.63 3.28 6.93 10.75 0.13 0.16
September 17.89 17.71
MAD 3.73 3.53
MSE 18.55 16.45
MAPE 0.25 0.23

AD - Absolute Deviation SE Squared error

APE - Absolute Percentage Error

Practice

Attendance in each time period. Please forecast the attendance using exponential smoothing (alpha=0.4 and 0.6).

Use MAD, MSE as guidance, find the better alpha setting for each forecasting model.

Trend Models

Trend is the long-term sweep or general direction of movement in a time series.

We’ll now consider some nonstationary time series techniques that are appropriate for data exhibiting upward or downward trends.

An Example

WaterCraft Inc. is a manufacturer of personal water crafts (also known as jet skis).

The company has enjoyed a fairly steady growth in sales of its products.

The officers of the company are preparing sales and manufacturing plans for the coming year.

Forecasts are needed of the level of sales that the company expects to achieve each quarter.

Forecasting Models With Linear Trends

Double Moving Average

Double Exponential Smoothing

Based on the linear trend equation (simple linear regression with time as the independent variable.

Autoregressive models

Linear Trend Model Example

Quarter Guests (in thousands)
Winter 2003 73
Spring 2003 104
Summer 2003 168
Fall 2003 74
Winter 2004 65
Spring 2004 82
Summer 2004 124
Fall 2004 52
Winter 2005 89
Spring 2005 146
Summer 2005 205
Fall 2005 98

Attendance at Orlando’s newest Disneylike attraction, Vacation World, are as shown in the table

Develop a regression equation that models the trend in the data.

Calculate the attendance forecast for year 2006 using the regression equation developed.

Model with Trend & Seasonality

Seasonality is a regular, repeating pattern in time series data.

May be additive or multiplicative in nature…

Multiplicative time series model is commonly used as shown below:

Y = T*S

where Y = actual value of time series

T = trend component

S = seasonal component

The goal of the time series decomposition method is to identify the values of components of a time series (trend, cyclical, seasonal, irregular), and use these components for forecasting re-composition of the model.

Seasonal Index Example

Quarter Guests (in thousands)
Winter 2003 73
Spring 2003 104
Summer 2003 168
Fall 2003 74
Winter 2004 65
Spring 2004 82
Summer 2004 124
Fall 2004 52
Winter 2005 89
Spring 2005 146
Summer 2005 205
Fall 2005 98

Attendance at Orlando’s newest Disneylike attraction, Vacation World, are as shown in the table

Compute the seasonal index using the data

Calculate the seasonal forecast for the year 2006.

Get the linear trends in 2006

Methods available

1. Use excel function

=Tend(Ys, Xs, Period No.)

See Disney.xls

2. Run regression to read intercept and coefficient.

3. Fit a trend line while plotting out the data

Y=3.87X+81.49

Then, compute Seasonal Indices

2003 2004 2005 Quarter Average Seasonally Index
Winter 73 65 89 75.6667 0.7094
Spring 104 82 146 110.6667 1.0375
Summer 168 124 205 165.6667 1.5531
Fall 74 52 98 74.6667 0.7000
106.6667

Finally, get the Forecasts

Forecast = Linear Trend * Corresponding Seasonal Index

E. g., in fall 2003, or 4th period, the average index for fall is 0.7, S4=0.7;

the linear trend for 4th period is : L4=2.87*4+81.49=97

Therefore, F4=L4*S4=97*0.7=68

Final Case Study Forecasting in Hospital Example

Forecasting in Hospital

The number of nurses needed in Hayward Hospital’s surgical division varies from quarter to quarter. This variation causes the hospital difficulty in hiring and scheduling nurses in the surgical division. It seems to the operations manager at the hospital that there are always either too many nurses or not enough nurses scheduled to do the work in the surgical divan from quarter to quarter. Furthermore, nurses cannot be shifted to and from other departments due to the special surgical training required in the wing and because of an understanding with the nurses union. If too many nurses are scheduled, the salary expense and fringe benefits are too high and personnel problems seem to increase. On the other hand, if too few are scheduled overtime must be worked, increasing overhead costs and angering doctors.

The operations staff has been using a simple rule to schedule nurses. The average of the number of nurses needed in the past four quarters is the number scheduled to work next quarter. The operations manager wonders if there is a better way to forecast the number of nurses needed. She has had an operations analyst prepare historical data for the past three years with the number of nurses needed in the surgical division:

Forecasting in Hospital

Year

Quarter

Period

# of

nurses

1997

I

1

14

II

2

10

III

3

6

IV

4

14

1998

I

5

16

II

6

14

III

7

11

IV

8

12

1999

I

9

15

II

10

13

III

11

10

IV

12

18

Hospital Example (K=3)

Hospital Example (Alpha = 0.2 )

Hospital Example: Linear Trend Projection

Regression line (Obtained from Excel)

Demand(y) = 10.8636 + 0.2902 * Time(x)

Hospital Example: Linear Trend Projection

Computing Multiplicative Seasonal Indices

Hospital Example

Quarter

1997

1998

1999

Quarterly

average

Seasonal

Index

I

14

16

15

15.000

0

1.1765

II

10

14

13

12.3333

0.9673

III

6

11

10

9.0000

0.7059

IV

14

12

18

14.6667

1.1503

Average

12.7500

Seasonal Model - Hospital Example

Year

Quarter

P

eriod

# of

Nurses

Trend

Forecast

Seasonal

Index

Seasonal

Forecast

Error

2

1997

I

1

14

11.2

1.1765

13.1

0.8

II

2

10

11.4

0.9671

11.1

1.1

III

3

6

11.7

0.7059

8.3

5.2

IV

4

14

12.0

1.1505

13.8

0.0

1998

I

5

16

12.3

1.1765

14.5

2.3

II

6

14

12.6

0.9671

12.2

3.3

III

7

11

12.9

0.7059

9.1

3.6

IV

8

12

13.2

1.1505

15.2

10.0

1999

I

9

15

13.5

1.1765

15.9

0.7

II

10

13

13.8

0.9671

13.3

0.1

III

11

10

14.1

0.7059

9.9

0.0

IV

12

18

14.3

1.1505

16.5

2.2

Total

29.4

MSE

2.5

2000

I

13

14.6

1.1765

17.2

II

14

14.9

0.9671

14.4

III

15

15.2

0.7059

10.7

IV

16

15.5

1.1505

17.8

Month

Sales

MA (2)

MA(3)

February

21

March

15

April

14

18

May

13

14.5

16.7

June

16

13.5

14.0

July

18

14.5

14.3

August

20

17

15.7

September

19

18.0

n

F

A

=

MAD

n

1

=

i

t

t

å

-

(

)

n

F

A

=

MSE

n

1

=

i

2

t

t

å

-

n

=

MAPE

n

1

=

i

å

-

t

t

t

A

F

A

Month

Period

Sales

MA (2)

Error2

Abs.

Deviation

MA(3)

Error2

Abs.

Deviation

February

1

21

March

2

15

April

3

14

18

16

4

May

4

13

14.5

2.25

1.5

16.7

13.4

3.7

June

5

16

13.5

6.25

2.5

14.0

4.0

2.0

July

6

18

14.5

12.25

3.5

14.3

13.4

3.7

August

7

20

17

9

3

15.7

18.8

4.3

September

8

19

18.0

MAD

2.9

3.42

MSE

9.15

12.42

tF

10

bb

t



0

5

10

15

20

123456789101112

Time Period

Number of Nurses

Chart1

14
10
6
14
16
14
11
12
15
13
10
18
Number of Nurses
Time Period
Number of Nurses

Sheet1

Year Quarter Period Number of Nurses
1996 I 1 14
II 2 10
III 3 6
IV 4 14
1997 I 5 16
II 6 14
III 7 11
IV 8 12
1998 I 9 15
II 10 13
III 11 10
IV 12 18

Sheet1

0
0
0
0
0
0
0
0
0
0
0
0
Number of Nurses
Time Period
Number of Nurses

Sheet2

Sheet3

Year

Quarter

Period

# of

nurses

MA(

3

)

Forecast

Error

Errors

2

Absolute

deviation

1997

I

1

14

II

2

10

III

3

6

IV

4

14

10

4

16

4

1998

I

5

16

10

6

36

6

II

6

14

12

2

4

2

III

7

11

14.7

-

3.7

13.44

3.7

IV

8

12

13.7

-

1.7

2.78

1.7

1999

I

9

15

12.3

2.7

7.11

2.7

II

10

13

12.7

0.3

0.11

0.3

III

11

10

13.3

-

3.3

11.11

3.3

IV

12

18

12.7

5.3

28.44

5.3

Total

119

29

MSE

13.22

MAD

3.22

2000

I

13

13.7

II

14

III

15

IV

16

Year

Quarter

Period

# of nurses

MA(3)

Forecast

Error

Errors2

Absolute deviation

1997

I

1

14

II

2

10

III

3

6

IV

4

14

10

4

16

4

1998

I

5

16

10

6

36

6

II

6

14

12

2

4

2

III

7

11

14.7

-3.7

13.44

3.7

IV

8

12

13.7

-1.7

2.78

1.7

1999

I

9

15

12.3

2.7

7.11

2.7

II

10

13

12.7

0.3

0.11

0.3

III

11

10

13.3

-3.3

11.11

3.3

IV

12

18

12.7

5.3

28.44

5.3

Total

119

29

MSE

13.22

MAD

3.22

2000

I

13

13.7

II

14

III

15

IV

16

Year

Quarter

Period

# of

Nurses

ES

(

a

=0.2)

Forecast

Error2

Abs

deviation

1997

I

1

14

II

2

10

14.00

16.00

4.00

III

3

6

13.20

51.84

7.20

IV

4

14

11.76

5.02

2.24

1998

I

5

16

12.21

14.38

3.79

II

6

14

12.97

1.07

1.03

III

7

11

13.17

4.72

2.17

IV

8

12

12.74

0.55

0.74

1999

I

9

15

12.59

5.80

2.41

II

10

13

13.07

0.01

0.07

III

11

10

13.06

9.35

3.06

IV

12

18

12.45

30.84

5.55

Total

MSE

12.69

MAD

2.93

2000

I

13

13.56

II

1

4

III

15

IV

16

Year

Quarter

Period

# of Nurses

ES (=0.2)

Forecast

Error2

Abs deviation

1997

I

1

14

 

II

2

10

14.00

16.00

4.00

 

III

3

6

13.20

51.84

7.20

 

IV

4

14

11.76

5.02

2.24

1998

I

5

16

12.21

14.38

3.79

 

II

6

14

12.97

1.07

1.03

 

III

7

11

13.17

4.72

2.17

 

IV

8

12

12.74

0.55

0.74

1999

I

9

15

12.59

5.80

2.41

 

II

10

13

13.07

0.01

0.07

 

III

11

10

13.06

9.35

3.06

 

IV

12

18

12.45

30.84

5.55

 

 

 

Total

 

 

 

MSE

12.69

 

 

 

MAD

2.93

2000

I

13

 

13.56

 

II

14

 

 

III

15

 

 

IV

16

 

Year Quarter Period

(X)

# of Nurses

(Y)

1997 I 1 14

II 2 10

III 3 6

IV 4 14

1998 I 5 16

II 6 14

III 7 11

IV 8 12

1999 I 9 15

II 10 13

III 11 10

IV 12 18

Average 6.5 12.75

Total 78 153

Year

Quarter

Period (X)

# of Nurses (Y)

1997

I

1

14

II

2

10

III

3

6

IV

4

14

1998

I

5

16

II

6

14

III

7

11

IV

8

12

1999

I

9

15

II

10

13

III

11

10

IV

12

18

Average

6.5

12.75

Total

78

153

Year

Quarter

Period

# of Nurses

Forecast

Error2

Abs

deviation

1997

I

1

14

11.15

8.10

2.85

II

2

10

11.44

2.09

1.44

III

3

6

11.73

32.88

5.73

IV

4

14

12.02

3.90

1.98

1998

I

5

16

12.31

13.58

3.69

II

6

14

12.60

1.95

1.40

III

7

11

12.90

3.59

1.90

I

V

8

12

13.19

1.40

1.19

1999

I

9

15

13.48

2.32

1.52

II

10

13

13.77

0.59

0.77

III

11

10

14.06

16.45

4.06

IV

12

18

14.35

13.35

3.65

MSE/MAD

8.35

2.51

2000

I

13

14.64

II

14

14.93

III

15

15.22

IV

16

15.51

Year

Quarter

Period

# of Nurses

Forecast

Error2

Abs deviation

1997

I

1

14

11.15

8.10

2.85

II

2

10

11.44

2.09

1.44

III

3

6

11.73

32.88

5.73

IV

4

14

12.02

3.90

1.98

1998

I

5

16

12.31

13.58

3.69

II

6

14

12.60

1.95

1.40

III

7

11

12.90

3.59

1.90

IV

8

12

13.19

1.40

1.19

1999

I

9

15

13.48

2.32

1.52

II

10

13

13.77

0.59

0.77

III

11

10

14.06

16.45

4.06

IV

12

18

14.35

13.35

3.65

MSE/MAD

8.35

2.51

2000

I

13

14.64

II

14

14.93

III

15

15.22

IV

16

15.51