0% found this document useful (0 votes)
6 views

Chapter 5 - Basic Forecasting Method - 2024-Bị Cắt Xén

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)
6 views

Chapter 5 - Basic Forecasting Method - 2024-Bị Cắt Xén

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/ 8

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
Chapter 5. Basic Forecasting Methods • Cannot provide high accuracy
 If it were true, future will always be the same as the past

Nguyen VP Nguyen, Ph.D.


Some notation:
 Forecast at time t is 𝑌 𝑡
Department of Industrial & Systems Engineering, HCMUT  Actual observation at time t is Y(t)
Email: [email protected]  Today is temperature is 98 F, Y(Today) = 98
 𝑌 Tomorrow = 98
 𝑌 Day after) = 98
1

Last Period Demand (Naïve Model)


• Stable time series data
Page 79  The forecast for the next period is simply the actual demand
(P.34 E9)
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.
2 4
Naïve Forecasts The naïve drift method

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


• Seasonal variations trend-adjusted forecast without developing a more
 Forecast is the same as the last actual observation when complex model.
we were in the same point in the cycle, where a cycle lasts
n periods. • Example: Alphabet Inc. (GOOG), Historical Prices,
ˆYt 1  Yt  n Close* (Close price adjusted for splits)
• 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 Modified Naive Model

• The method incorporates the overall trend (drift) in the • Forecast value is equal to the previous observed
data series from the first observation to the last and value plus a proportion of the most recently observed
extrapolates the trend observed in the historical data. rate of change in the variable.
• not be suitable when the time
series has seasonality, • Use (Yt-1-Yt-2) to consider the direction from which we
 Y Y  cyclical patterns, the trend is arrived at the most recent observation.
Y t  h  Yt   t 1  h nonlinear.
 t 1  • the trend between the first
and the last observed value Yt  Yt 1  p Yt 1  Yt  2 
where: is representative of the
overall trend in the series, where
Y1 is the first observed value
which might not include Y1 is the first observed value.
Yt is the last observed value series with structural breaks. p is the proportion of the change between
t is the total number of observations
periods t-2 and t-1 that we choose to include in
h is the number of periods ahead you are forecasting
the forecast
6 9
Associative Forecasting - Regression Analysis
Forecast Accuracy of Naïve Model vs. Modified Naive Model
• Based on identification of related variables that can be
• Example 1: The quarterly sales of saws from 2000 to used to predict values of the variable of interest.
2006 for the Acme Tool Company.  Sales of bikes in an area may be related to the percentage of
Naïve Modified Naïve the young population living in that area.
p 0.6  Ice cream sales can be related to temperature
 House sales forecasts on mortgage refinancing rates,
MAD 152.308 MAD 151.852 smaller rates imply higher sales.
MSE 39907.692 MSE 29074.074  Changes in interest rate leads to certain business activities
RMSE 199.769 RMSE 170.511 – House sales
MAPE 0.357 MAPE 0.368 – Industrial investments
 Increase in energy cost leads to price increases in products
MPE -0.005 MPE -0.072 and services
ME 14.615 ME 7.407
10

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


Associative Forecasting - Regression Analysis
- Forecast Accuracy Interpretation
• A forecast error is considered small or large? • Find an association between the predictor and the
 Consider all sets of Forecast Accuracy MAD, MSE, RMSE, MAPE predicted
 Every forecast value is deviated an average value of___MAD_____ • Predictor variables - used to predict values of variable
 If the percentage error MAPE is low, close to zero, the every forecast interest, sometimes called independent variables
value is not biased by a percentage of _a%__
• Predicted variable = Dependent variable
• A smaller accuracy measures indicates a better fit of the
• Regression - technique for fitting a line to a set of
model to the data
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.

11
Associative Forecasting - Regression Analysis Regression Analysis: Trend Models
• Regression analysis established a temporal • Quadratic Trend Model: Yt  b0  b1t  b2t 2 for t  1, 2, , n quadratic trend
relationship for the forecast variable.  the relationship between the independent and dependent
 The variable to be predicted (demand) is referred to as the variable is represented by a second-degree polynomial.
dependent variable  Use when the data shows a curve, with the rate of change in
 The variable of time-stamp (dấu thời gian) used in predicting the dependent variable increasing or decreasing over time.
is called the independent variable. • Exponential Trend Model: Yt  b0 eb1t for t  1, 2, , n exponential trend

• The simplest of relationship is a linear regression.  The dependent variable grows or declines at a constant
percentage rate over time.
• The basic equation for the straight line that express  Use when the data shows exponential growth or decay, such
demand (Y) as a function of time (t) is as population growth or compound interest
Yt   0  1t   t • Any trend model’s forecasts become less reliable as
Yt  b0  b1t they are extrapolated farther into the future.
Yt   0  1 X t   t
14 16

Regression Analysis: Assessing Fit


Regression Analysis: Trend Models • Several methods and metrics used for assessing the fit of a
• Three three trend model types are especially useful in forecasting: regression model:
 Coefficient of Determination (R2):
Yt  b0  b1t for t  1, 2, , n linear trend ͟ R2 represents the proportion of the variance in the dependent variable that is
predictable from the independent variable(s).
All three models can be
Yt  b0 eb1t for t  1, 2, , n exponential trend
͟ Values of R2 range from 0 to 1; a higher indicates a better fit. However, R2 can be
fitted by Excel, artificially high if overfitting occurs.

Y  b btb t 2
for t  1, 2, , n quadratic trend InputAnalyzer, MINITAB,  Adjusted *R2:
t 0 1 2
Matlab ͟ Similar to R2 but adjusts for the number of predictors in the model.
𝑌 : dependent variable at time t  MAD, MSE, RMSE, MAPE:
b0: constant term ͟ These metrics provide a measure of the average error in the model predictions.
b1: linear coefficient (quad) / Growth rate (expo) ͟ Lower values indicate better fit,
b2: quadratic coefficient ͟ especially useful when comparing different models.
• Trend model types are the simplest model and may suffice for short-run  Residual Plots:
forecasting or as a baseline model (the first simple attempt at modelling ͟ Plotting residuals (the differences between observed and predicted values) can help
assess the fit.
which provides a baseline metric as a reference point)
• Linear model:  Normality of Residuals:
͟ For inference purposes, the residuals should ideally follow a normal distribution.
 a straight-line relationship between the independent variable (often time) and ͟ Histograms, Q-Q plots, or statistical tests like the Shapiro-Wilk test can be used to
the dependent variable. assess the normality of residuals.
 Use when the data shows a constant rate of change over time.
15
 F-Test in ANOVA, T-Tests for Individual Coefficients, Durbin-Watson
17
Test, AIC and BIC
Moving Averages (MAs)
Techniques for Averaging • Simple moving averages (SMA) uses the mean of all the data to
• Simple Averages forecast while moving averages (MAs) is more concerned with
recent observations, that means a new mean is computed by
• Moving averages (MA) adding the newest value and dropping the oldest.
 Naïve methods just trace the actual data with a lag of one period. They don’t
smooth • By definition,
 MA uses a number of the most recent actual data to smooth  MAs - moving averages are a series of averages calculated using sequential
 Advantage=Easy to compute and easy to understand segments of data points over a series of values.
 Disadvantage=All values in the average are weighted equally  Segments have a moving length, which defines the number of data points to
include in each average.
• Weighted moving averages • Moving averages can
 Similar to moving average  smooth time series data,
 remove seasonal patterns and reveal underlying trends
 It assigns more weight to the most recent values in a time series
 Idea: most recent observations must be better indicators of the
• Smoothing
future than older observations  is the process of removing random variations that appear as coarseness in a
plot of raw time series data.
• Exponential smoothing  reduces the noise to emphasize the series that can contain trends and
cycles.
20

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


• A simple average or simple moving average (SMA) uses the • A moving average of order k, MA(k), is the mean value of
mean of all relevant historical observations to compute the k consecutive observations.is computed by
initialization part of the data and to forecast the next period k
t

Y Y  Y  Y  ...  Yt  k 1 Y t i 1
Initialization Y  Y  ...  Yt i
Yˆt 1  t t 1 t  2  i 1

part: Yˆt 1  1 2  i 1
k k
t t where: 𝑌 = forecast demand for period t+1
where: 𝑌 = forecast made at for period t for time/period t+1 , Yt-i = actual demand in periods t-i
Yi = actual demand in periods i, k = number of terms in the moving average
t = number of time periods which we count • The moving average for time period t is the arithmetic
mean of the k most recent observations.
• SMA is used when the forces generating the series to be • The moving average model does not handle trend or
forecast have stabilized and the environment in which the seasonality very well, although it does better than the
series exists is generally unchanging. 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.
19 21
Ex: Three period moving average forecast Weighted average

Month Demand Moving Average


1 42 MA(6,3) = (43 + 40 + 41) / 3 • Advantage=Easy to compute and easy to
understand
2 40 = 41.33.
• Disadvantage=All values in the average are
3 43 If Y6 = 39, then weighted equally
4 40 MA(7,3) = (40 + 41 + 39) / 3
5 41 = 40.00 Weighted Moving Average
• Similar to moving average
6 39
• 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

Simple Moving Average Weighted average


Note the sensitivity of forecasts
Compute a weighted average forecast using a
Averaging (over time) techniques are used to smooth variations in the data. Month Demand weight of 0.4 for the most recent period, 0.3
Actual
MA(t,5) 1 42 for the next most recent, 0.2 for the next and
47 0.1 for the next.
45
2 40
43 3 43
41
Continuing with the data on the left
39
4 40 Y^6 = .40(41)+.30(40)+.20(43)+.10(40)=41.0
37
MA(t,3) 5 41 If the actual demand for period 6 is 39,
35
1 2 3 4 5 6 7 8 9 10 11 12
6 39 Y^7 = .40(39)+.30(41)+.20(40)+.10(43)=40.2
t

 Yi
• The weighted average is more reflective of
Y t 1  MAt 1, k  i  t  k 1
, the most recent occurrences.
k
MAt 1, k : MA forecast made in period t using n actual observations
Double Moving Averages (DMA)
Moving Averages (MA) or Trailing Moving Average (TMA)
• Third, calculate a forecast by DMA, compute the
• The number of points k used for the average increases, coefficient of the “linear trend line” by adding to the single
the curve becomes smoother and smoother. Choosing a moving average Mt the difference between the single and
value for k is a balance between eliminating noise while
still capturing the data’s true structure. the second moving averages (Mt-M’t), we get
 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
• Fourth, compute an additional adjustment factor, which is
fluctuations in the series similar to a slope measure that can change over the series
 For smoothing out: MA(4) yields an average of the four quarters, where
MA(12), eliminates or averages out the seasonal effects k = the number of periods in the
moving average
• Minitab can be used to compute a k moving average
• Check the autocorrelation function for the residuals from • Last, make the forecast p periods into the future Y t  p  at  bt p
where
the k moving average method p = the number of periods ahead to be forecast
26 28

Double Moving Averages (DMA)


Centered Moving Average (CMA)
• If time series has a linear trend we use Double Moving
Averages DMA which averages of moving averages, that • The Centered Moving Average smoothing method
means
looks forward and backward in time to express the
 One set of moving averages is computed, and
 then a second set is computed as a moving average of the first set
current “forecast” as a mean of the current
• First, compute the moving average of order k Count an amount of k, use observation and observations on either side of the
the subscript k= 0…1…2…k-1
current data.
• Therefore, when calculating a simple moving average,
• Second, compute the second 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
One set of moving averages is computed, and then a second set is
computed as a moving average of the first set
27 29
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

You might also like