Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
25 views15 pages

Chapter 5 - Basic Forecasting Method - 2024

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views15 pages

Chapter 5 - Basic Forecasting Method - 2024

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

10/1/2024

Chapter 5. Basic Forecasting Methods

Nguyen VP Nguyen, Ph.D.


Department of Industrial & Systems Engineering, HCMUT
Email: [email protected]

Page 79
(P.34 E9)

1
10/1/2024

Naïve Forecasts
• Uses a single previous value of a time series as the basis of
a forecast.
• Virtually no cost
• Data analysis is nonexistent
• Easily understandable
• Cannot provide high accuracy
 If it were true, future will always be the same as the past

Some notation:
 Forecast at time t is 𝑌 𝑡
 Actual observation at time t is Y(t)
 Today is temperature is 98 F, Y(Today) = 98
 𝑌 Tomorrow = 98
 𝑌 Day after) = 98

Last Period Demand (Naïve Model)


• Stable time series data
 The forecast for the next period is simply the actual demand
observed in the current period.
Yˆt 1  Yt
where 𝑌t+1 = forecast made at time t for time/period t+1
𝑌 = actual demand in the period t
 This model is particularly useful when demand is stable, and
there is no trend or seasonality. Its forecasts can be very
inaccurate for more complex, non-stationary time series.
 It’s also helpful as a benchmark to evaluate the performance
of more complex forecasting models.
4

2
10/1/2024

Naïve Forecasts

• Seasonal variations
 Forecast is the same as the last actual observation when
we were in the same point in the cycle, where a cycle lasts
n periods. ˆYt 1  Yt  n
• Data with trends
 There is constant trend, the change from (t-2) to (t-1) will
be exactly as the change from (t-1) to (t)

Yˆt 1  Yt  (Yt  Yt 1 )

The naïve drift method

• The method incorporates the overall trend (drift) in the


data series from the first observation to the last and
extrapolates the trend observed in the historical data.
• not be suitable when the time
series has seasonality,
 Y Y  cyclical patterns, the trend is
Y t  h  Yt   t 1  h nonlinear.
 t 1  • the trend between the first
and the last observed value
where: is representative of the
overall trend in the series,
Y1 is the first observed value
which might not include
Yt is the last observed value series with structural breaks.
t is the total number of observations
h is the number of periods ahead you are forecasting
6

3
10/1/2024

The naïve drift method

• This method is used for a quick, interpretable, and


trend-adjusted forecast without developing a more
complex model.
• Example: Alphabet Inc. (GOOG), Historical Prices,
Close* (Close price adjusted for splits)

Modified Naive Model

• Forecast value is equal to the previous observed


value plus a proportion of the most recently observed
rate of change in the variable.
• Use (Yt-1-Yt-2) to consider the direction from which we
arrived at the most recent observation.

Yt  Yt 1  p Yt 1  Yt  2 
where
Y1 is the first observed value.
p is the proportion of the change between
periods t-2 and t-1 that we choose to include in
the forecast
9

4
10/1/2024

Forecast Accuracy of Naïve Model vs. Modified Naive Model

• Example 1: The quarterly sales of saws from 2000 to


2006 for the Acme Tool Company.
Naïve Modified Naïve
p 0.6

MAD 152.308 MAD 151.852


MSE 39907.692 MSE 29074.074
RMSE 199.769 RMSE 170.511
MAPE 0.357 MAPE 0.368

MPE -0.005 MPE -0.072


ME 14.615 ME 7.407
10

Forecast Accuracy of Naïve Model vs. Modified Naive Model


- Forecast Accuracy Interpretation
• A forecast error is considered small or large?
 Consider all sets of Forecast Accuracy MAD, MSE, RMSE, MAPE
 Every forecast value is deviated an average value of___MAD_____
 If the percentage error MAPE is low, close to zero, the every forecast
value is not biased by a percentage of _a%__
• A smaller accuracy measures indicates a better fit of the
model to the data

11

5
10/1/2024

Associative Forecasting - Regression Analysis


• Based on identification of related variables that can be
used to predict values of the variable of interest.
 Sales of bikes in an area may be related to the percentage of
the young population living in that area.
 Ice cream sales can be related to temperature
 House sales forecasts on mortgage refinancing rates,
smaller rates imply higher sales.
 Changes in interest rate leads to certain business activities
– House sales
– Industrial investments
 Increase in energy cost leads to price increases in products
and services

Associative Forecasting - Regression Analysis

• Find an association between the predictor and the


predicted
• Predictor variables - used to predict values of variable
interest, sometimes called independent variables
• Predicted variable = Dependent variable
• Regression - technique for fitting a line to a set of
points
• Linear regression is the most widely used form of
regression
 The objective is to obtain an equation of a straight line that minimizes
the sum of squared vertical deviations of data points from the line.

6
10/1/2024

Associative Forecasting - Regression Analysis


• Regression analysis established a temporal
relationship for the forecast variable.
 The variable to be predicted (demand) is referred to as the
dependent variable
 The variable of time-stamp (dấu thời gian) used in predicting
is called the independent variable.
• The simplest of relationship is a linear regression.
• The basic equation for the straight line that express
demand (Y) as a function of time (t) is
Yt   0  1t   t
Yt  b0  b1t
Yt   0  1 X t   t
14

Regression Analysis: Trend Models


• Three three trend model types are especially useful in forecasting:

Yt  b0  b1t for t  1, 2, , n linear trend


All three models can be
Yt  b0 eb1t for t  1, 2, , n exponential trend fitted by Excel,
Y  b  b t  b t 2 for t  1, 2, , n quadratic trend InputAnalyzer, MINITAB,
t 0 1 2
Matlab
𝑌 : dependent variable at time t
b0: constant term
b1: linear coefficient (quad) / Growth rate (expo)
b2: quadratic coefficient
• Trend model types are the simplest model and may suffice for short-run
forecasting or as a baseline model (the first simple attempt at modelling
which provides a baseline metric as a reference point)
• Linear model:
 a straight-line relationship between the independent variable (often time) and
the dependent variable.
 Use when the data shows a constant rate of change over time.
15

7
10/1/2024

Regression Analysis: Trend Models


• Quadratic Trend Model: Yt  b0  b1t  b2t 2 for t  1, 2, , n quadratic trend
 the relationship between the independent and dependent
variable is represented by a second-degree polynomial.
 Use when the data shows a curve, with the rate of change in
the dependent variable increasing or decreasing over time.
• Exponential Trend Model: Yt  b0 eb1t for t  1, 2, , n exponential trend
 The dependent variable grows or declines at a constant
percentage rate over time.
 Use when the data shows exponential growth or decay, such
as population growth or compound interest
• Any trend model’s forecasts become less reliable as
they are extrapolated farther into the future.

16

Regression Analysis: Assessing Fit


• Several methods and metrics used for assessing the fit of a
regression model:
 Coefficient of Determination (R2):
͟ R2 represents the proportion of the variance in the dependent variable that is
predictable from the independent variable(s).
͟ Values of R2 range from 0 to 1; a higher indicates a better fit. However, R2 can be
artificially high if overfitting occurs.
 Adjusted *R2:
͟ Similar to R2 but adjusts for the number of predictors in the model.
 MAD, MSE, RMSE, MAPE:
͟ These metrics provide a measure of the average error in the model predictions.
͟ Lower values indicate better fit,
͟ especially useful when comparing different models.
 Residual Plots:
͟ Plotting residuals (the differences between observed and predicted values) can help
assess the fit.
 Normality of Residuals:
͟ For inference purposes, the residuals should ideally follow a normal distribution.
͟ Histograms, Q-Q plots, or statistical tests like the Shapiro-Wilk test can be used to
assess the normality of residuals.
 F-Test in ANOVA, T-Tests for Individual Coefficients, Durbin-Watson
17
Test, AIC and BIC

8
10/1/2024

Techniques for Averaging


• Simple Averages
• Moving averages (MA)
 Naïve methods just trace the actual data with a lag of one period. They don’t
smooth
 MA uses a number of the most recent actual data to smooth
 Advantage=Easy to compute and easy to understand
 Disadvantage=All values in the average are weighted equally

• Weighted moving averages


 Similar to moving average
 It assigns more weight to the most recent values in a time series
 Idea: most recent observations must be better indicators of the
future than older observations
• Exponential smoothing

Simple Averages
• A simple average or simple moving average (SMA) uses the
mean of all relevant historical observations to compute the
initialization part of the data and to forecast the next period
t

Initialization Y  Y  ...  Yt Y i

part: Yˆt 1  1 2  i 1
t t
where: 𝑌 = forecast made at for period t for time/period t+1 ,
Yi = actual demand in periods i,
t = number of time periods which we count

• SMA is used when the forces generating the series to be


forecast have stabilized and the environment in which the
series exists is generally unchanging.

19

9
10/1/2024

Moving Averages (MAs)


• Simple moving averages (SMA) uses the mean of all the data to
forecast while moving averages (MAs) is more concerned with
recent observations, that means a new mean is computed by
adding the newest value and dropping the oldest.
• By definition,
 MAs - moving averages are a series of averages calculated using sequential
segments of data points over a series of values.
 Segments have a moving length, which defines the number of data points to
include in each average.
• Moving averages can
 smooth time series data,
 remove seasonal patterns and reveal underlying trends
• Smoothing
 is the process of removing random variations that appear as coarseness in a
plot of raw time series data.
 reduces the noise to emphasize the series that can contain trends and
cycles.
20

Moving Averages (MA) or Trailing Moving Average (TMA)

• A moving average of order k, MA(k), is the mean value of


k consecutive observations.is computed by
k

Y  Y  Y  ...  Yt  k 1 Y t i 1
Yˆt 1  t t 1 t  2  i 1
k k
where: 𝑌 = forecast demand for period t+1
Yt-i = actual demand in periods t-i
k = number of terms in the moving average
• The moving average for time period t is the arithmetic
mean of the k most recent observations.
• The moving average model does not handle trend or
seasonality very well, although it does better than the
simple average method.
• The choice of the value of k should be determined by
experimentation and often lies within the ranges of 3 to 8.
21

10
10/1/2024

Ex: Three period moving average forecast

Month Demand
1 42 MA(6,3) = (43 + 40 + 41) / 3
2 40 = 41.33.
3 43 If Y6 = 39, then
4 40 MA(7,3) = (40 + 41 + 39) / 3
5 41 = 40.00
6 39

Simple Moving Average


Note the sensitivity of forecasts
Averaging (over time) techniques are used to smooth variations in the data.

Actual
MA(t,5)
47
45
43
41
39
37
MA(t,3)
35
1 2 3 4 5 6 7 8 9 10 11 12
t

 Yi
Y t 1  MAt 1, k  i  t  k 1
,
k
MAt 1, k : MA forecast made in period t using n actual observations

11
10/1/2024

Weighted average

Moving Average
• Advantage=Easy to compute and easy to
understand
• Disadvantage=All values in the average are
weighted equally

Weighted Moving Average


• Similar to moving average
• It assigns more weight to the most recent
values in a time series
 Idea: most recent observations must be better
indicators of the future than older observations

Weighted average

Compute a weighted average forecast using a


Month Demand weight of 0.4 for the most recent period, 0.3
1 42 for the next most recent, 0.2 for the next and
0.1 for the next.
2 40
3 43
Continuing with the data on the left
4 40 Y^6 = .40(41)+.30(40)+.20(43)+.10(40)=41.0
5 41 If the actual demand for period 6 is 39,
6 39 Y^7 = .40(39)+.30(41)+.20(40)+.10(43)=40.2

• The weighted average is more reflective of


the most recent occurrences.

12
10/1/2024

Moving Averages (MA) or Trailing Moving Average (TMA)


• The number of points k used for the average increases,
the curve becomes smoother and smoother. Choosing a
value for k is a balance between eliminating noise while
still capturing the data’s true structure.
 A small number k is most desirable
 A small number k places heavy weight on recent historical
observations, that might catch up more rapidly to the current level
 A large number k is desirable when there are wide, infrequent
fluctuations in the series
 For smoothing out: MA(4) yields an average of the four quarters,
MA(12), eliminates or averages out the seasonal effects
• Minitab can be used to compute a k moving average
• Check the autocorrelation function for the residuals from
the k moving average method
26

Double Moving Averages (DMA)


• If time series has a linear trend we use Double Moving
Averages DMA which averages of moving averages, that
means
 One set of moving averages is computed, and
 then a second set is computed as a moving average of the first set
• First, compute the moving average of order k Count an amount of k, use
the subscript k= 0…1…2…k-1

• Second, compute the second moving average

One set of moving averages is computed, and then a second set is


computed as a moving average of the first set
27

13
10/1/2024

Double Moving Averages (DMA)


• Third, calculate a forecast by DMA, compute the
coefficient of the “linear trend line” by adding to the single
moving average Mt the difference between the single and
the second moving averages (Mt-M’t), we get

• Fourth, compute an additional adjustment factor, which is


similar to a slope measure that can change over the series
where
k = the number of periods in the
moving average

• Last, make the forecast p periods into the future Y t  p  at  bt p


where
p = the number of periods ahead to be forecast
28

Centered Moving Average (CMA)

• The Centered Moving Average smoothing method


looks forward and backward in time to express the
current “forecast” as a mean of the current
observation and observations on either side of the
current data.
• Therefore, when calculating a simple moving average,
it is beneficial to use an odd number of points (k) so
that the calculation is symmetric
• For example, using k = 3 periods, the CMA is:
a 5 point moving average

29

14
10/1/2024

Centered Moving Average (CMA)


• When k is odd (k = 3, 5, etc.), the simple moving average is
easy to calculate.
• When k is even, the mean of an even number of data points
would lie between two data points and would not be correctly
centered.
 In this case, we would take a double moving average to get the
resulting CMA centered properly.
• Centered moving averages (CMA) are computed by
averaging across data both in the past and future of a given
time point.
• Therefore, they cannot be used for forecasting because at
the time of forecasting (because the future is typically
unknown)
30

Centered Moving Average (CMA)


Time Period Data Value
2022 Quarter I 818
2022 Quarter II 861
2022 Quarter III 844
2022 Quarter IV 906 𝑌 𝑌
2023 Quarter I 867
2023, Quarter II 899
• k=3, 3-Quarter Centered Moving Average for 2022, Quarter IV:
 844  906  867  872.3
𝑌
3
• k=4, 4-Quarter Centered Moving Average for 2022, Quarter IV:

𝑌  0.5861 844  906  867  0.5844  906  867  899  874.25


4 4

31

15

You might also like