You are on page 1of 33

Introduction to Forecasting

• What is forecasting?
– Primary Function is to Predict the Future using (time
series related or other) data we have in hand
Characteristics of Forecasts

• They are usually wrong!


• A good forecast is more than a single number
– Includes a mean value and standard deviation
– Includes accuracy range (high and low)
• Aggregated forecasts are usually more accurate
• Accuracy erodes as we go further into the future.
• Forecasts should not be used to the exclusion of known
information
What Makes a Good Forecast?

• It should be timely
• It should be as accurate as possible
• It should be reliable
• It should be in meaningful units
• It should be presented in writing
• The method should be easy to use and
understand in most cases.
Time Series Methods
• A time series is just collection of past values of
the variable being predicted. Also known as naïve
methods. Goal is to isolate patterns in past data.
(See Figures on following pages)
– Trend
– Seasonality
– Cycles
– Randomness
The Difficulty with Long-Term
Forecasts –an afterthought!
Quantitative Forecasting
• Select several forecasting methods
• ‘Forecast’ the past
• Evaluate forecasts
• Select best method
• Forecast the future
• Monitor continuously forecast accuracy
Quantitative Forecasting
Methods Quantitative
Forecasting

Time Series Causal


Models Models

Moving Exponential Trend


Regression
Average Smoothing Models
What is a Time Series?
• Set of evenly spaced numerical data
– Obtained by observing response variable at
regular time periods
• Forecast based only on past values
– Assumes that factors influencing past, present,
& future will continue
Time Series Components

Trend Cyclical

Seasonal Irregular
Trend Component
• Overall Upward or Downward Movement
• Data Taken Over a Period of Years
Pollutant

Time
Cyclical Component
• Upward or Downward Swings
• May Vary in Length
• Usually Lasts 2 - 10 Years
Pollutant

Time
Seasonal Component
• Upward or Downward Swings
• Regular Patterns
• Observed Within One Year
Pollutant

Time
Irregular Component
• Erratic, unsystematic, ‘residual’ fluctuations
• Due to random variation or unforeseen © 1984-1994 T/Maker Co.

events
• Short duration &
nonrepeating
Time Series Forecasting
Time
Series

Smoothing No Yes Trend


Methods Trend? Models

Moving Exponential
Average Smoothing

Auto-
Linear Quadratic Exponential Regressive
Moving Average Method
• Series of arithmetic means
• Used only for smoothing
– Provides overall impression of data over time

Used for elementary forecasting


Moving Average Graph

8 Actual
6
4
2
0
93 94 95 96 97 98
Year
Exponential Smoothing
[Graph]
Pollution
Actual
8
6
4
2
0
93 96 97 98 99
Year
Linear Time-Series Model
Yi  b0  b1X 1i

Y b1 > 0

b1 < 0

Time, X1
Quadratic Time-Series
Forecasting Model
• Used for forecasting trend
• Relationship between response variable Y &
time X is a quadratic function
• Coded years used
• Quadratic model

Yi  b0  b1X 1i  b11X 1i
2
Quadratic Time-Series
Model Relationships
Y b11 > 0 Y b11 > 0

Year, X1 Year, X1

Y b11 < 0 Y b11 < 0

Year, X1 Year, X1
Exponential Time-Series
Forecasting Model
• Used for forecasting trend
• Relationship is an exponential function
• Series increases (decreases) at increasing
(decreasing) rate
Exponential Time-Series
Model Relationships

Y b1 > 1

0 < b1 < 1
Year, X1
Autoregressive Modeling
• Used for forecasting trend
• Like regression model
– Independent variables are lagged response
variables Yi-1, Yi-2, Yi-3 etc.
• Assumes data are correlated with past data
values
– 1st Order: Correlated with prior period
• Estimate with ordinary least squares
Forecasting Guidelines
• No pattern or direction in forecast error
– ei = (Actual Yi - Forecast Yi)
– Seen in plots of errors over time
• Smallest forecast error
– Measured by mean absolute deviation
• Simplest model
– Called principle of parsimony
Pattern of Forecast Error
Trend Not Fully Accounted
for Desired Pattern

Error Error

0 0

Time (Years) Time (Years)


Residual Analysis
e e

0 0

T T
Random errors Cyclical effects not accounted for

e e

0 0

T T
Trend not accounted for Seasonal effects not accounted for
Principal of Parsimony
• Suppose two or more models provide
good fit for data
• Select the Simplest Model
– Simplest model types:
• least-squares linear
• least-square quadratic
• 1st order autoregressive
– More complex types:
• 2nd and 3rd order autoregressive
• least-squares exponential
ANFIS System
• Learning algorithm is a hybrid supervised method based on
gradient descent and Least-squares
• Forward phase: signals travel up to layer 4 and the relevant
parameters are fitted by least squares
• Backward phase: the error signals travel backward and the
premise parameters are updated as in backpropagation
• Fuzzy toolbox Matlab
• Mackey-Glass prediction / excellent non-linear fitting and
generalization / less parameters and training time is
comparable with ANN methods
An ANFIS model with
four rules
Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 Layer 6
x1 x2
A1 1 N1 1
x1

A2 2 N2 2
y

B1 3 N3 3
x2

B2 4 N4 4
Learning in an ANFIS with two membership
functions assigned to each input (one epoch)
y
Training Data
2 ANFIS Output

-1

-2

-3
1
0.5 10
8
0 6
-0.5 4
2
-1 0
x2 x1
Learning in an ANFIS with two membership
functions assigned to each input (100 epochs)
y
Training Data
2 ANFIS Output

-1

-2

-3
1
0.5 10
8
0 6
-0.5 4
2
-1 0
x2 x1

You might also like