FASE II - Tema 7

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 27

FASE II: TEMA 6

AAAAAAAAAABBBBBBBBBB

1
Slides by
Slides by

JohnJohn
Loucks
Loucks
St. Edward’s
St. Edward’s
University
University
Chapter 6, Part B
Time Series Analysis and
Forecasting
 Linear Trend Projection
 Seasonality
Linear Trend Projection

 If a time series exhibits a linear trend, the method of


least squares may be used to determine a trend line
(projection) for future forecasts.
 Least squares, also used in regression analysis,
determines the unique trend line forecast which
minimizes the mean square error between the trend
line forecasts and the actual observed values for the
time series.
 The independent variable is the time period and the
dependent variable is the actual observed value in the
time series.
Linear Trend Projection

 Using the method of least squares, the formula for the


trend projection is:
  = b0 + b1t

  where: = linear trend forecast in period t


b0 = y-intercept of the linear trend line
b1 = slope of the linear trend line
t = the time period
Linear Trend Projection

 For the trend projection equation


  = b0 + b1t
𝑛

  ∑ (𝑡 −´
𝑡 )( 𝑌 𝑡 −𝑌
´ )
𝑏1 = 𝑡 =1
𝑛
(𝑡 −´
𝑡)
2 𝑏  0 =𝑌´ −𝑏 1 ´𝑡

𝑡=1

where: Yt = actual value of the time series in period t


n = number of periods in the time series
  = average values of the time series

  = mean value of t
Linear Trend Projection

 Example: Auger’s Plumbing Service


The number of plumbing repair jobs performed by
Auger's Plumbing Service in the last nine months is
listed on the right.
Month Jobs Month Jobs
Forecast the number of
March 353 August 409
repair jobs Auger's will
April 387 Septem. 399
perform in December
May 342 October 412
using the least squares
June 374 Novem. 408
method.
July 396
Linear Trend Projection

 Example: Auger’s Plumbing Service


 (month) t t-

(Mar.) 1 -4 16 353 -33.67 134.68


(Apr.) 2 -3 9 387 0.33 -0.99
(May) 3 -2 4 342 -44.67 89.34
(June) 4 -1 1 374 -12.67 12.67
(July) 5 0 0 396 9.33 0
(Aug.) 6 1 1 409 22.33 22.33
(Sep.) 7 2 4 399 12.33 24.66
(Oct.) 8 3 9 412 25.33 75.99
(Nov.) 9 4 16 408 21.33 85.32
Sum 45 60 3480 444.00
Linear Trend Projection

 Example: Auger’s Plumbing Service


 ´ 45 ´ = 3480 =386.667
 𝑌
𝑡= =5
9 9

  = = 7.12

  b0 =
 = 351.07 + (7.12)(10) = 422.27
Linear Trend Projection

 Example: Auger’s Plumbing Service


Forecast for December (Month 10) using a
three-period (k = 3) weighted moving average with
weights of .6, .3, and .1
Month Jobs Month Jobs
for the newest to oldest
March 353 August 409
data, respectively. Then,
April 387 Septem. 399
compare this Month 10
May 342 October 412
weighted moving average
June 374 Novem. 408
forecast with the Month 10
July 396
trend projection forecast.
Linear Trend Projection

 Example: Auger’s Plumbing Service


• Three-Month Weighted Moving Average
The forecast for December will be the weighted
average of the preceding three months: September,
October, and November.
 = .1YSep. + .3YOct. + .6YNov.
= .1(399) + .3(412) + .6(408)
= 408.3
• Trend Projection
  = 422.27 (from earlier slide)
Linear Trend Projection

 Example: Auger’s Plumbing Service


• Conclusion
Due to the positive trend component in the time
series, the trend projection produced a forecast that is
more in line with the trend that exists. The weighted
moving average, even with heavy (.6) weight placed
on the current period, produced a forecast that is
lagging behind the changing data.
Seasonality without Trend

 To the extent that seasonality exists, we need to


incorporate it into our forecasting models to ensure
accurate forecasts.
 We will first look at the case of a seasonal time
series with no trend and then discuss how to model
seasonality with trend.
Seasonality without Trend

 Example: Umbrella Sales


Year Quarter 1 Quarter 2 Quarter 3 Quarter 4
1 125 153 106 88
2 118 161 133 102
3 138 144 113 80
4 109 137 125 109
5 130 165 128 96

 Sometimes it is difficult to identify patterns in a time


series presented in a table.
 Plotting the time series can be very informative.
Seasonality without Trend

 Example: Umbrella Sales


• Time Series Plot
Seasonality without Trend

 Example: Umbrella Sales


• The time series plot does not indicate any long-term
trend in sales.
• However, close inspection of the plot does reveal a
seasonal pattern.
 The first and third quarters have moderate sales,
 the second quarter the highest sales, and
 the fourth quarter tends to be the lowest quarter
in terms of sales.
Seasonality without Trend

 We will treat the season as a categorical variable.


 Recall that when a categorical variable has k levels,
k – 1 dummy variables are required.
 If there are four seasons, we need three dummy
variables.
 Qtr1 = 1 if Quarter 1, 0 otherwise
 Qtr2 = 1 if Quarter 2, 0 otherwise
 Qtr3 = 1 if Quarter 3, 0 otherwise
Seasonality without Trend

 Example: Umbrella Sales


• General Form of the Equation is:
 = b0 + b1(Qtr1t) + b2(Qtr2t) + b3(Qtr3t)

• Optimal Model is:


t  95.0
SalesSales  29.0(
t = 95.0 Qtr 1t)t +) 57.0(Qtr2
57.0(Qtr t) + 2
t )  26.0(
t) Qtr 3 )
+ 29.0(Qtr1 26.0(Qtr3
t

• The forecasts of quarterly sales in year 6 are:


 Qtr 1: Sales = 95 + 29(1) + 57(0) + 26(0) = 124
 Qtr 2: Sales = 95 + 29(0) + 57(1) + 26(0) = 152
 Qtr 3: Sales = 95 + 29(0) + 57(0) + 26(1) = 121
 Qtr 4: Sales = 95 + 29(0) + 57(0) + 26(0) = 95
Seasonality without Trend

 Example: Umbrella Sales


Year Quarter 1 Quarter 2 Quarter 3 Quarter 4
1 125 153 106 88
2 118 161 133 102
3 138 144 113 80
4 109 137 125 109
5 130 165 128 96
Average 124 152 121 95

 We could have obtained the quarterly forecasts for


next year by simply computing the average number
of umbrellas sold in each quarter.
Seasonality and Trend

 We will now extend the curve-fitting approach to


include situations where the time series contains both
a seasonal effect and a linear trend.
 We will introduce an additional variable to represent
time.
Seasonality and Trend

 Example: Terry’s Tie Shop


Business at Terry's Tie Shop can be viewed as
falling into three distinct seasons: (1) Christmas
(November and December); (2) Father's Day (late
May to mid June); and (3) all other times.
Average weekly sales ($) during each of the
three seasons during the past four years are shown
on the next slide.
Seasonality and Trend

 Example: Terry’s Tie Shop

Season
Year 1 2 3
1 1856 2012 985
2 1995 2168 1072
3 2241 2306 1105
4 2280 2408 1120

Determine a forecast for the average weekly


sales in year 5 for each of the three seasons.
Seasonality and Trend

 Example: Terry’s Tie Shop


 There are three seasons, so we will need two
dummy variables.
 Seas1t = 1 if Season 1 in time period t,
= 0 otherwise
 Seas2t = 1 if Season 2 in time period t,
= 0 otherwise

  General Form of the Equation is:
= b0 + b1(Seas1t) + b2(Seas2t) + b3(t)
 Optimal Model
Salest = 797.0 + 1095.43(Seas1t) + 1189.47(Seas2t) + 36.47(t)
Seasonality and Trend

 Example: Terry’s Tie Shop


 The forecasts of average weekly sales in the three
seasons of year 5 (time periods 13, 14, and 15) are:
Seas. 1: Sales13 = 797 + 1095.43(1) + 1189.47(0) + 36.47(13)
= 2366.5

Seas. 2: Sales14 = 797 + 1095.43(0) + 1189.47(1) + 36.47(14)


= 2497.0

Seas. 3: Sales15 = 797 + 1095.43(0) + 1189.47(0) + 36.47(15)


= 1344.0
End of Chapter 6, Part B
Puntos a Tratar:

• Objetivo:

1.1.
1.2.
1.3.
1.4.
1.5.
26
AAAAAAAAAABBBBBBB

1.1. XXXXXXZZZZZZ

27

You might also like