You are on page 1of 50

Manajemen Persediaan

3- Peramalan
Agenda
 Metode Peramalan Kuantitatif
 Time Series
 Average
 Exponential Smoothing
 Causal
 Regresi
 Kesalahan Peramalan
Metode Time Series
 Digunakan untuk membuat analisis
detail dari pola demand masa lalu dan
memproyeksikan pola tersebut untuk
masa yang akan datang
Average

Time Series: Moving average

• The moving average model uses the last t periods in order to


predict demand in period t+1.
• There can be two types of moving average models: simple
moving average and weighted moving average
• The moving average model assumption is that the most
accurate prediction of future demand is a simple (linear)
combination of past demand.
Time series: simple moving average

In the simple moving average models the forecast value is

At + At-1 + … + At-n
Ft+1 =
n

t is the current period.


Ft+1 is the forecast for next period
n is the forecasting horizon (how far back we look),
A is the actual sales figure from each period.
Example: forecasting sales at Kroger

Kroger sells (among other stuff) bottled spring water

Month Bottles
Jan 1,325
Feb 1,353
Mar 1,305 What will
the sales be
Apr 1,275
for July?
May 1,210
Jun 1,195
Jul ?
What if we use a 3-month simple moving average?

AJun + AMay + AApr


FJul = = 1,227
3

What if we use a 5-month simple moving average?

AJun + AMay + AApr + AMar + AFeb


FJul = = 1,268
5
1400
1350
1300
5-month
1250
MA forecast
1200
3-month
1150 MA forecast
1100
1050
1000
0 1 2 3 4 5 6 7 8

What do we observe?

5-month average smoothes data more;


3-month average more responsive
Stability versus responsiveness in
moving averages

950
900
850
d 800 Demand
n
a 750
m 700 3-Week
e 650
D 6-Week
600
550
500
1 2 3 4 5 6 7 8 9 10 11 12
Week
Time series: weighted moving average
We may want to give more importance to some of the data…

Ft+1 = wt At + wt-1 At-1 + … + wt-n At-n

wt + wt-1 + … + wt-n = 1

t is the current period.


Ft+1 is the forecast for next period
n is the forecasting horizon (how far back we look),
A is the actual sales figure from each period.
w is the importance (weight) we give to each period
Why do we need the WMA models?

Because of the ability to give more importance to what


happened recently, without losing the impact of the past.

Demand for Mercedes E-class Actual demand (past sales)


Prediction when using 6-month SMA
Prediction when using 6-months WMA

For a 6-month
SMA, attributing
equal weights to all
past data we miss
Time the downward trend
Jan Feb Mar Apr May Jun Jul Aug
Example: Kroger sales of bottled water

Month Bottles
Jan 1,325
Feb 1,353
What will
Mar 1,305
be the sales
Apr 1,275 for July?
May 1,210
Jun 1,195
Jul ?
6-month simple moving average…

AJun + AMay + AApr + AMar + AFeb + AJan


FJul = = 1,277
6

In other words, because we used equal weights, a slight downward


trend that actually exists is not observed…
What if we use a weighted moving average?

Make the weights for the last three months more than the first
three months…

6-month WMA WMA WMA


SMA 40% / 60% 30% / 70% 20% / 80%

July
1,277 1,267 1,257 1,247
Forecast

The higher the importance we give to recent data, the more we


pick up the declining trend in our forecast.
Month Bottles weight equal weight (40:60) bxw weight (30:70) bxw weight (20:80) bxw
Jan 1,325 0,133 0,177 0,100 0,133 0,067 0,088
Feb 1,353 0,133 0,180 0,100 0,135 0,067 0,090
Mar 1,305 0,133 0,174 0,100 0,131 0,067 0,087
Apr 1,275 0,200 0,255 0,233 0,298 0,267 0,340
May 1,21 0,200 0,242 0,233 0,282 0,267 0,323
Jun 1,195 0,200 0,239 0,233 0,279 0,267 0,319
Jul ? 1,277 1,267 1,257 1,247
Time Series: Exponential Smoothing (ES)

Main idea: The prediction of the future depends mostly on the


most recent observation, and on the error for the latest forecast.

Smoothing
constant
Denotes the importance
alpha α of the past error
Why use exponential smoothing?

1. Uses less storage space for data


2. Extremely accurate
3. Easy to understand
4. Little calculation complexity
5. There are simple accuracy tests
Exponential smoothing: the method

Assume that we are currently in period t. We calculated the


forecast for the last period (Ft-1) and we know the actual demand
last period (At-1) …

Ft  Ft1   ( At1  Ft1 )

The smoothing constant α expresses how much our forecast will


react to observed differences…
If α is low: there is little reaction to differences.
If α is high: there is a lot of reaction to differences.
Example: bottled water at Kroger

Month Actual Forecasted  = 0.2

Jan 1,325 1,370

Feb 1,353 1,361

Mar 1,305 1,359

Apr 1,275 1,349

May 1,210 1,334


=1,334+(0,2X(1,210-1,334))
Jun ? 1,309
Example: bottled water at Kroger

Month Actual Forecasted  = 0.8

Jan 1,325 1,370

Feb 1,353 1,334

Mar 1,305 1,349

Apr 1,275 1,314

May 1,210 1,283


=1,283+(0,8X(1,21-1,283))
Jun ? 1,225
Impact of the smoothing constant

1380
1360
1340
1320 Actual
1300
a = 0.2
1280
1260 a = 0.8
1240
1220
1200
0 1 2 3 4 5 6 7
Soal Latihan
periode waktu Nilai Pengamatan

1
Aktual
200
 Lakukan
2
3
135
195
peramalan
4
5
197
310 menggunakan
6 175
7 155  SMA 3 periode
8 130
9
10
220
277
 SMA 5 periode
11
12
235
-
 WMA 5 periode
(30(2):70(3))
 Eksponential
smoothing alpha
0,1;0,5; dan 0,9
Jawaban
Linear regression in forecasting

Linear regression is based on


1. Fitting a straight line to data
2. Explaining the change in one variable through changes in
other variables.

dependent variable = a + b  (independent variable)

By using linear regression, we are trying to explore which


independent variables affect the dependent variable
Example: do people drink more when it’s cold?

Alcohol Sales

Which line best


fits the data?

Average Monthly
Temperature
The best line is the one that minimizes the error

The predicted line is …

Y  a  bX

So, the error is …

εi  yi - Yi

Where: ε is the error


y is the observed value
Y is the predicted value
Least Squares Method of Linear Regression

The goal of LSM is to minimize the sum of squared errors…

Min i
 2
What does that mean?

Alcohol Sales ε ε
ε

So LSM tries to
minimize the distance
between the line and
the points!

Average Monthly
Temperature
Least Squares Method of Linear Regression

Then the line is defined by

Y  a  bX

(Y )(X 2 )  (X )(XY )


a  Y bX
(n)(X )  (X )
2 2

(n)(XY )  (X )(Y )


b
(n)(X 2 )  (X ) 2
Contoh Soal
 Berikut ini data mengenai
pengalaman kerja dan penjualan
 X=pengalaman kerja (tahun)
 Y=omzet penjualan (ribuan)

 Tentukan nilai a dan b!


___ ___
24 56
X  3 Y  7
8 8
(Y )(X 2 )  (X )(XY )
a  Y bX
(n)(X )  (X )
2 2

(n)(XY )  (X )(Y )


b
(n)(X 2 )  (X ) 2

(56)(96)  ( 24)(198) (8)(198)  (24)(56)


a b
(8)(96)  ( 24) 2 (8)(96)  (24) 2
5.376  4.752 1.584  1.344
a  3,25 b  1,25
768  576
768  576
Koefisien determinasi (R2)
(( n )(  XY )  ( X )( Y )) 2
R2 
( n(X 2 )  (X ) 2 (n(Y 2 )  (Y ) 2 )
((8)(198)  ( 24)(56)) 2
R 
2

(8(96)  ( 24) 2 (8( 448)  (56) 2 )


(1.584  1.344) 2
R2 
(768  576) (3.584  3.136)
( 240) 2 57.600
R 
2
  0,6696
(192)( 448) 86.016
a. Diperoleh nilai a = 3,25 dan nilai b =
1,25
b. Persamaan regresi linearnya adalah
Y=3,25+1,25X
How can we compare across forecasting models?

We need a metric that provides estimation of accuracy

Errors can be:

Forecast Error 1. biased (consistent)


2. random

Forecast error = Difference between actual and forecasted value


(also known as residual)
Kesalahan Peramalan
 Beberapa metode lebih ditentukan untuk
meringkas kesalahan (error) yang dihasilkan
oleh fakta (keterangan) pada teknik
peramalan.
 Sebagian besar dari pengukuran ini melibatkan
rata-rata beberapa fungsi dari perbedaan
antara nilai aktual dan nilai peramalannya.
 Perbedaan antara nilai observasi dan nilai
ramalan ini sering dimaksud sebagai residual.
Measuring Accuracy: MFE

MFE = Mean Forecast Error (Bias)


It is the average error in the observations

A F t t
MFE  i 1
n

1. A more positive or negative MFE implies worse


performance; the forecast is biased.
Measuring Accuracy: MAD

MAD = Mean Absolute Deviation


It is the average absolute error in the observations

 A F t t
MAD  i1
n

1. Higher MAD implies worse performance.


2. If errors are normally distributed, then σε=1.25MAD
MFE & MAD:
A Dartboard Analogy

Low MFE & MAD:

The forecast errors


are small &
unbiased
An Analogy (cont’d)

Low MFE but high


MAD:

On average, the
arrows hit the
bullseye (so much
for averages!)
MFE & MAD:
An Analogy

High MFE & MAD:

The forecasts
are inaccurate &
biased
Key Point

Forecast must be measured for accuracy!

The most common means of doing so is


by measuring the either the mean
absolute deviation or the standard
deviation of the forecast error
Measuring Accuracy: Tracking signal
The tracking signal is a measure of how often our estimations
have been above or below the actual value. It is used to decide
when to re-evaluate using a model.
n
RSFE  (At  Ft )
RSFE
TS 
i1 MAD
Positive tracking signal: most of the time actual values are
above our forecasted values
Negative tracking signal: most of the time actual values are
below our forecasted values

If TS > 4 or < -4, investigate!


Example: bottled water at Kroger

Month Actual Forecast Month Actual Forecast

Jan 1,325 1,370 Jan 1,325 1370

Feb 1,353 1,361 Feb 1,353 1306

Mar 1,305 1,359 Mar 1,305 1334

Apr 1,275 1,349 Apr 1,275 1290

May 1,210 1,334 May 1,210 1251

Jun 1,195 1,309 Jun 1,195 1175

Metoda A Metode B

Question: Which one is better?


Bottled water at Kroger: compare MAD and TS

MAD TS

Metode A 69,83 -6

Metode B 32,83 - 1,92

We observe that B performs a lot better than A

Conclusion: Probably there is trend in the data which


A cannot capture
Which Forecasting Method
Should You Use
 Gather the historical data of what you
want to forecast
 Divide data into initiation set and
evaluation set
 Use the first set to develop the models
 Use the second set to evaluate
 Compare the MADs and MFEs of each
model
Jadi,,pilih metode yang mana?? (hitung
MAD dan TS untuk masing-masing hasil
peramalan)

Periode Nilai SMA (3 SMA (5 WMA (5


waktu Pengamatan periode) periode) periode) Eksponential Smoothing
Aktual (30:70) α = 0,1 α = 0,5 α = 0,9
1 200 - - -
2 135 200 200 200
3 195 193,50 167,50 141,50
4 197 176,67 193,65 181,25 189,65
5 310 175,67 193,99 189,13 196,27
6 175 234,00 207,40 214,05 205,59 249,56 298,63
7 155 227,33 202,40 208,63 202,53 212,28 187,36
8 130 213,33 206,40 208,13 197,78 183,64 158,24
9 220 153,33 193,40 183,38 191,00 156,82 132,82
10 277 168,33 198,00 190,58 193,90 188,41 211,28
11 235 209,00 191,40 195,80 202,21 232,71 270,43
12 - 244,00 203,40 213,55 205,49 233,85 238,54
Nilai SMA (3 SMA (5 WMA (5
Pengamatan periode) periode) periode) Eksponential Smoothing
Aktual (30:70) α = 0,1 α = 0,5 α = 0,9
175,00 234,00 207,40 214,05 205,59 249,56 298,63
155,00 227,33 202,40 208,63 202,53 212,28 187,36
130,00 213,33 206,40 208,13 197,78 183,64 158,24
220,00 153,33 193,40 183,38 191,00 156,82 132,82
277,00 168,33 198,00 190,58 193,90 188,41 211,28
235,00 209,00 191,40 195,80 202,21 232,71 270,43
MFE -2.22 -1.166 -1.42 -0.168 -5.237 -11.12
MAD 69,33 50,9 55,5 48,46 56,59 62,09
TS -0,192 -0,137 -0,154 -0,020 -0,55 -1,07

You might also like