Академический Документы
Профессиональный Документы
Культура Документы
Lesson #2
Method Introduction
• One of the simpler methods to use for forecasting
• Estimates a line through the data
• Uses the estimated line equation to forecast future values.
• Method Format:
– Y=a+b*t
Model Characteristics
• Method Characteristics
– Fits a line to the data
– Estimating a line which minimizes the errors between actual
data points and model estimates
• When to use Method
– Estimate trend
– Estimate trend magnitude
• When not to use
– Estimate anything beyond a simple linear relationship.
Forecasting Steps
1. Objective Setting
2. Method Selection
3. Model Evaluation
4. Find Best Models
5. Use Best Models
Objective Setting
• Simpler is better
• Linear Regression allows to test whether a line fitted to the data
works as a model. Objectives should take that principal under
consideration.
• Example Objectives for M2 Money Stock (see next slide):
– Test if M2 has a linear trend over time.
– If M2 exhibits a statistically significant trend , what is its
magnitude and does it make sense?
– If model looks good, Create a forecast based off model.
8000.0
7000.0
6000.0
5000.0
4000.0
3000.0
2000.0
1000.0
0.0
May-79 Nov-84 May-90 Oct-95 Apr-01 Oct-06 Apr-12
Method Selection
• Observe time series qualities: trend, seasonality, cyclicality, and
randomness.
• Adjust time frame, units, periods to forecast as needed.
• Determine if linear regression is a possible candidate based on
method characteristics.
– Determine if transforming the units will enable use of model.
• 8 Different Unit Transformation Techniques
Build Model
• Software finds us the best fit line to the data: (Minimizing the Sum
of Squared Errors)
M2 Money Stock (Billions of $'s)
9000.0
8000.0
7000.0
6000.0
5000.0
4000.0
3000.0
2000.0
1000.0
0.0
May-79 Nov-84 May-90 Oct-95 Apr-01 Oct-06 Apr-12
Copyright 2010 DeepThought, Inc. 8
Linear Regression and Model Statistics
Evaluate Model
• Descriptive Statistics
– Mean
– Variance & Standard Deviation
• Accuracy / Error
– SSE
– RMSE
– MAPE
– R-Squared; Adjusted R-Squared
• Statistical Significance
– F-Test
– P-Value F-Test
Copyright 2010 DeepThought, Inc. 9
Linear Regression and Model Statistics
Descriptive Statistics
Mean
The average value of the data set.
*http://images.google.com/imgres?
imgurl=http://www.cs.princeton.edu/introcs/11gaussian/images/stddev.png&imgrefurl=http://www.cs.princeton.edu/introcs/11gaussi
an/&usg=__7JZMBeSrlQKPfVL2YCVuV8HVXkY=&h=206&w=570&sz=18&hl=en&start=54&um=1&tbnid=5jb7PXr6kgP08M:&tbnh=48&tb
nw=134&prev=/images%3Fq%3Dstandard%2Brandom%2Bdistribution%26ndsp%3D18%26hl%3Den%26client%3Dfirefox-a%26rls
%3Dorg.mozilla:en-US:official%26hs%3DXpO%26sa%3DN%26start%3D36%26um%3D1
Copyright 2010 DeepThought, Inc. 10
Linear Regression and Model Statistics
M2 Example
M2 Money Stock (Billions of $'s)
• Mean
9000.0
– 4214.38 8000.0
7000.0
6000.0
5000.0
• Variance 4000.0
3000.0
– 3346475.10 2000.0
1000.0
0.0
May-79 Nov-84 May-90 Oct-95 Apr-01 Oct-06 Apr-12
• SD (Standard Deviation)
– 1829.34
Accuracy/Error
SSE
• Sum of Square Errors (SSE) – Sums the Errors between the actual
values and model values
• Measures the total error of the model
• M2 Example:
M2 Money Stock (Billions of $'s)
– SSE: 316778645.89 9000.0
8000.0
7000.0
6000.0
5000.0
4000.0
3000.0
2000.0
1000.0
0.0
May-79 Nov-84
Copyright 2010 DeepThought, Inc. May-90 Oct-95 Apr-01 Oct-06 Apr-12
13
Linear Regression and Model Statistics
RMSE
• The square root of the sum of square error divided by the number
of observations.
• An averaged out total of errors based upon the number of
observations.
• Simple way to compare models based on error.
• M2 Example:
– RMSE: 456.82
MAPE
M2 Example
• R2 M2 Money Stock (Billions of $'s)
– 93.76%
9000.0
8000.0
7000.0
6000.0
• Adjusted R2 5000.0
– 93.76%
4000.0
3000.0
2000.0
1000.0
0.0
May-79 Nov-84 May-90 Oct-95 Apr-01 Oct-06 Apr-12
Statistical Significance
F-Test
F-Test P-Value
M2 Example
• F-Test M2 Money Stock (Billions of $'s)
– 22778.98
9000.0
8000.0
7000.0
6000.0
• F-Test P-Value 5000.0
– 0.00
4000.0
3000.0
2000.0
1000.0
0.0
May-79 Nov-84 May-90 Oct-95 Apr-01 Oct-06 Apr-12
Use Model
• Understand Limitations of Model.
– Only measures a trend.
– A long term average.
• Answer Objectives.
– Does M2 has a linear trend.
– If trend exists, what is its magnitude.
– If model statistically significant, forecast.
M2 Example
• M2 = 1145.31 + 4.04 * Time
• Next Period is 1519
• Forecast for that period is:
– Y = 1145.31 + 4.04 * 1519
• Y = 7283.446866