CS代考 Predictive Analytics – Exponential Smoothing for Forecasting

Predictive Analytics – Exponential Smoothing for Forecasting

Predictive Analytics
Exponential Smoothing for Forecasting

Copyright By PowCoder代写 加微信 powcoder

Discipline of Business Analytics, The University of School

This week: Exponential Smoothing

1. Simple exponential smoothing

2. Trend corrected exponential smoothing

3. Holt winters smoothing

4. Damped trend exponential smoothing

Chapter 8 of the book: https://otexts.com/fpp3/expsmooth.html

Exponential smoothing methods

Exponential smoothing forecasts are weighted averages of past
observations, where the weights decay exponentially as we go
further into the past.

Exponential smoothing can be useful when the time series
components are changing over time.

Simple exponential smoothing

Simple exponential smoothing

The simple exponential smoothing (SES) method specifies the
forecasting rule

ŷt+1 = ℓt (forecast equation)
ℓt = αyt + (1 − α)ℓt−1 (smoothing equation)

for an initial value ℓ0 and 0 ≤ α ≤ 1.

ℓt is known as the level of the time series.

Exponentially weighted moving average

ℓ1 = αy1 + (1 − α)ℓ0

ℓ2 = αy2 + (1 − α)ℓ1
= αy2 + (1 − α)αy1 + (1 − α)2ℓ0

ℓ3 = αy3 + (1 − α)ℓ2
= αy3 + (1 − α)αy2 + (1 − α)2αy1 + (1 − α)3ℓ0

ℓ4 = αy4 + (1 − α)ℓ3
= αy4 + (1 − α)αy3 + (1 − α)2αy2 + (1 − α)3αy1 + (1 − α)4ℓ0

Exponentially weighted moving average

It follows that

ℓt =αyt + (1 − α)ℓt−1
=αyt + (1 − α)αyt−1 + (1 − α)2αyt−2 + . . . + (1 − α)t−1αy1

+ (1 − α)tℓ0.

Simple exponential smoothing is also known as the exponentially
weighted moving average (EWMA) method.

Simple exponential smoothing

• Useful for forecasting time series with changing levels.

• A higher α gives larger weight to recent observations, making
the forecasts more adaptive to recent changes in the series.

• A lower α leads to a larger weights for past observations,
making the forecasts smoother.

• Initialisation: we typically set ℓ0 = y1 for simplicity.
Alternatively, we can treat it as a parameter.

Example: AUD/USD exchange rate

Example: AUD/USD exchange rate

Estimation

We estimate α by least squares (empirical risk minimisation).

α̂ = argmin

(yt − ℓt−1)2

Each ℓt is a nonlinear function of α, so that there is no formula for
α̂. We use numerical optimisation methods to obtain the solution.

Statistical model

In order to say more about the simple exponential smoothing
method, we need to formulate it as a statistical model. We assume

Yt = ℓt−1 + εt,
ℓt = αyt + (1 − α)ℓt−1,

where the errors εt are i.i.d with constant variance σ2.

Statistical model

In forecasting, we want to:

1. compute point forecasts for multiple forecasting horizons h.

2. compute interval forecasts for multiple forecasting horizons h.

In order to do this for the exponential smoothing method, we
rewrite the model in error correction form.

Error correction form

We obtain the error correction form as

ℓt = αYt + (1 − α)ℓt−1

= ℓt−1 + α(Yt − ℓt−1)

= ℓt−1 + αεt.

Hence, we can rewrite the model as:

Yt+1 = ℓt + εt+1,
ℓt = ℓt−1 + αεt.

Error correction form

Using ℓt = ℓt−1 + αεt,

ℓt+1 = ℓt + αεt+1

ℓt+2 = ℓt+1 + αεt+2
= ℓt + αεt+1 + αεt+2

ℓt+3 = ℓt+2 + αεt+3
= ℓt + αεt+1 + αεt+2 + αεt+3

ℓt+h = ℓt +

Constant plus noise representation

Using Yt = ℓt−1 + εt and the previous slide,

Yt+1 = ℓt + εt+1

Yt+2 = ℓt+1 + εt+2
= ℓt + αεt+1 + εt+2

Yt+3 = ℓt+2 + εt+3
= ℓt + αεt+1 + αεt+2 + εt+3

Yt+h = ℓt+h−1 + εt+h

αεt+i + εt+h

Point forecast

Constant plus noise representation of future observations:

Yt+h = ℓt +

αεt+i + εt+h

From the linearity of expectations, the point forecast for any
horizon h is

ŷt+h = E(Yt+h|y1:t)

αεt+i + εt+h

∣∣∣∣∣ y1:t

Forecast variance

Var(Yt+1|y1:t) = Var(ℓt + εt+1|y1:t)

Var(Yt+2|y1:t) = Var(ℓt + αεt+1 + εt+2|y1:t)
= σ2(1 + α2)

Var(Yt+h|y1:t) = Var

αεt+h−i + εt+h

∣∣∣∣∣ y1:t

= σ2(1 + (h − 1)α2)

Forecast equations for simple exponential smoothing

ŷt+h = ℓt

Var(Yt+h|y1:t) = σ2(1 + (h − 1)α2)

Interval forecast

If we assume that εt ∼ N(0, σ2),

Yt+h|y1:t ∼ N

1 + (h − 1)α2

To compute an interval forecast, we use the estimated values of α

ℓ̂t ± zcrit ×

σ̂2 [1 + (h − 1)α̂2],

t=1(yt − ℓt−1)2

If the errors are not normal, you should use the Bootstrap method
or other distributional assumptions.

Example: AUD/USD exchange rate

Trend corrected exponential

Trend corrected exponential smoothing

The trend corrected or Holt exponential smoothing method
allows for a time-varying trend:

ŷt+1 = ℓt + bt (forecast equation)
ℓt = αyt + (1 − α)(ℓt−1 + bt−1) (smoothing equation)
bt = β(ℓt − ℓt−1) + (1 − β)bt−1 (trend equation)

for an initial values ℓ0 and b0, 0 ≤ α ≤ 1, and 0 ≤ β ≤ 1.

Trend corrected exponential smoothing

Consider the simple time series trend model

ℓt = a + b × t,
Yt = ℓt + εt.

What is ℓt − ℓt−1 here?

Trend corrected exponential smoothing model

The statistical model is

Yt+1 = ℓt + bt + εt+1,
ℓt = αYt + (1 − α)(ℓt−1 + bt−1),
bt = β(ℓt − ℓt−1) + (1 − β)bt−1,

where the errors εt are i.i.d with constant variance σ2.

The least squares estimates of α and β are

α̂, β̂ = argmin

(yt − ℓt−1 − bt−1)2

Error correction form

ℓt = αYt + (1 − α)(ℓt−1 + bt−1)
= ℓt−1 + bt−1 + α(Yt − ℓt−1 − bt−1)
= ℓt−1 + bt−1 + αεt

bt = β(ℓt − ℓt−1) + (1 − β)bt−1
= bt−1 + β(ℓt − ℓt−1 − bt−1)
= bt−1 + βα(ℓt−1 + bt−1 + αεt − ℓt−1 − bt−1)
= bt−1 + βαεt

Error correction form

Yt+1 = ℓt + bt + εt+1
ℓt = ℓt−1 + bt−1 + αεt
bt = bt−1 + βαεt

Constant plus noise representation

Yt+1 = ℓt + bt + εt+1

Yt+2 = ℓt+1 + bt+1 + εt+2
= ℓt + 2bt + α(1 + β)εt+1 + εt+2

Yt+3 = ℓt+2 + bt+2 + +εt+3
= ℓt+1 + 2bt+1 + α(1 + β)εt+2 + εt+3
= ℓt + 3bt + α(1 + 2β)εt+1 + α(1 + β)εt+2 + εt+3

Yt+h = ℓt + hbt + α

(1 + iβ)εt+h−i + εt+h

Point forecast

Constant plus noise representation of future observations:

Yt+h = ℓt + hbt + α

(1 + iβ)εt+h−i + εt+h

From the linearity of expectations, the point forecast for any
horizon h is

ŷt+h = E(Yt+h|y1:t)

ℓt + hbt + α

(1 + iβ)εt+h−i + εt+h

∣∣∣∣∣ y1:t

= ℓt + hbt.

Forecast variance

Var(Yt+1|y1:t) = Var(ℓt + bt + εt+1|y1:t)

Var(Yt+2|y1:t) = Var(ℓt + 2bt + α(1 + β)εt+1 + εt+2|y1:t)
= σ2(1 + α2(1 + β)2)

Var(Yt+h|y1:t) = Var

ℓt + hbt + α

(1 + iβ)εt+h−i + εt+h|y1:t

Forecast equations for the trend corrected smoothing method

Point forecast:

ŷt+h = ℓ̂t + hb̂t

Var(Yt+h|y1:t) = σ2

We compute interval forecasts as before.

Example: assaults in Sydney

Example: assaults in Sydney

Example: visitor arrivals

Example: visitor arrivals

• Exponential smoothing methods for forecast

• Simple exponential smoothing

• Trend corrected exponential smoothing

• Error correction forms for constructing forecasts: point
forecast, interval forecast and density forecast.

Holt winters smoothing

exponential smoothing

The Holt-Winters exponential smoothing method extend the
trend corrected method to seasonal data. It allows for additive or
multiplicative seasonality.

Additive Smoothing (key concept)

ŷt+1 = ℓt + bt + St+1−L (forecast equation)
ℓt = α(yt − St−L) + (1 − α)(ℓt−1 + bt−1) (level)
bt = β(ℓt − ℓt−1) + (1 − β)bt−1, (trend)
St = δ(yt − ℓt) + (1 − δ)St−L, (seasonal indices)

for a seasonal frequency L, initial values ℓ0, b0, and Si−L for
i = 1, . . . , L, and parameters 0 ≤ α ≤ 1, 0 ≤ β ≤ 1, 0 ≤ δ ≤ 1.

Multiplicative Smoothing (key concept)

ŷt+1 = (ℓt + bt) × St+1−L (forecast equation)
ℓt = α(yt/St−L) + (1 − α)(ℓt−1 + bt−1) (level)
bt = β(ℓt − ℓt−1) + (1 − β)bt−1, (trend)
St = δ(yt/ℓt) + (1 − δ)St−L, (seasonal indices)

for a seasonal frequency L, initial values ℓ0, b0, and Si−L for
i = 1, . . . , L, and parameters 0 ≤ α ≤ 1, 0 ≤ β ≤ 1, 0 ≤ δ ≤ 1.

Additive v.s. Multiplicative

• Additive smoothing is
appropriate when the
variation (around the trend,
or the seasonal pattern)
doesn’t change over time

• Multiplicative smoothing is
appropriate when the
variation (around the trend,
or the seasonal pattern)
changes over time.

Statistical model

As before, we formulate a statistical model by specifying an
observation equation.

Yt+1 = ℓt + bt + St+1−L + εt+1,

where εt+1 is i.i.d with variance σ2

Multiplicative:

yt+1 = (ℓt + bt) × St+1−L + εt+1,

where εt+1 is i.i.d with variance σ2.

Estimation

We estimate α, β and δ by least squares.

α̂, β̂, δ̂ = argmin

(yt − ℓt−1 − bt−1 − St−L)2

Multiplicative:

α̂, β̂, δ̂ = argmin

(yt − (ℓt−1 + bt−1) × St−L)2

Forecast equations

ŷt+h = ℓ̂t + hb̂t + St−L+(h mod L)

Var(Yt+h|y1:t) = σ2

[α(1 + iβ) + Ii,Lδ(1 − α)]2

where mod is the modulo operator, Ii,L = 0 if h mod L ̸= i and
Ii,L = 1 if h mod L = i.

Multiplicative:

ŷt+h = (ℓ̂t + hb̂t) × St−L+(h mod L)

No simple expression exists for the variance in the multiplicative

Example: assaults in estimated parameters are α̂ = 0.117, β̂ = 0.023, and
δ̂ = 0.370.

Example: visitor arrivals

The estimated parameters are α̂ = 0.154, β̂ = 0.088, and
δ̂ = 0.271.

Example: visitor arrivals

Damped trend exponential

Damped trend exponential smoothing

Damped trend exponential smoothing addresses the problem
that extrapolating trends indefinitely into the future can lead to
implausible forecasts.

Model and forecast

yt+1 = ℓt + ϕbt + εt+1,
ℓt = αyt + (1 − α)(ℓt−1 + ϕbt−1),
bt = β(ℓt − ℓt−1) + (1 − β)ϕbt−1,

where ϕ is the damping parameter, with 0 ≤ ϕ ≤ 1.

Forecast equation:

ŷt+h = ℓt + ϕbt + ϕ2bt + ϕ3bt + . . . + ϕhbt

We can extend it to allow for additive or multiplicative seasonality.

Illustration: visitor arrivals

Review questions

• What is exponential smoothing?

• What is the difference between simple, trend corrected, and
Holt-Winters exponential smoothing methods?

• Derive the point forecasts and forecast variances for the SES
and trend corrected methods, starting from the model
equations.

• Explain how to compute forecast intervals based on the SES
and trend corrected methods.

Simple exponential smoothing
Trend corrected exponential smoothing
Holt winters smoothing
Damped trend exponential smoothing

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com