Fitting Trend Lines

advertisement
Fitting Trend Lines
Basic Curve Fitting
Using Regression Analysis in Eviews
Examining Historical Time Series Data: A Review
• Plotting Raw & Transformed Data
• Look for Patterns
– Trends
– Linear/Nonlinear
Li
/N li
– Cycles
– Seasonality
– Outliers
– Structural Change
18000
16000
14000
12000
10000
8000
6000
4000
1992
1993
1994
1995
1996
1997
USLD1
Simple Time Lines:
Estimates & Projections
• Summarizing the Data
• Identifying a Pattern
– Seasonality One Pattern
– TREND Another
A h
• What happens as time passes • Moving up or down?
USLD1
18,000
16,000
14,000
12,000
10,000
8,000
6,000
4,000
1992
1993
1994
1995
1996
1
Constructing Simple Time Lines
• Using a Ruler and a Pencil Creates a Line
– Line Summarizes Data
– Direction & Steepness Indicates Trend
• NOTE: A Line Determined by an Intercept and a Slope
• Y = B
Y B0 + B
B1 *(time)
*( i )
– "time" is whatever is used on the horizontal axis
USLD1
– Usually a “counter” variable
• 1,2,3,4,5…..
18,000
16,000
14,000
12,000
B1
10,000
8,000
B0
6,000
4,000
1992
1993
1994
1995
1996
Computerā€Based "Fitting" a Line • Computer Chooses Values of Coefficients:
– Y = B0 + B1*(time)
– B0 & B1 are Assigned Estimated Values
– This is “Estimating an Equation”
• Plotting the Estimated Equation
Pl tti th E ti t d E
ti
–
–
–
–
Finding the Values Predicted by the Equation
Plugging in Values for “time”
Calculating Values for Y
Showing Them on a Graph
18,000
16,000
14,000
12,000
B1
10,000
8,000
B0
6,000
4,000
1992
1993
1994
USLD1
1995
1996
USLD1F
"Fitting" a Line with EVIEWS
Y = B0 + B1*(time)
• Focus on Commands (easy & quick)
• Alternative Using Mouse/Menus
2
"Fitting" a Line with EVIEWS Y = B0 + B1*(time)
• EVIEWS Commands:
– GENR TIME=@TREND(92.1) (creates counter)
– LS USLD1 C TIME (estimates the equation)
– FORECAST YHAT FORECAST YHAT (creates predicted values (creates predicted values “YHAT”)
YHAT )
– PLOT USLD1 YHAT (plots both series)
– Definitions:
• USLD1 is Series of Interest (Y)
• C is a Constant (B0)
• TIME is a "counter" variable 1,2,3,4....
• YHAT is the Equation’s Prediction of USLD1
Generating the “time” variable
• GENR TIME=@TREND(92.1)
– TIME is a "counter" variable 1,2,3,4....
Estimating the Equation
• Commands vs. Mouse
3
Create Predicted Value “YHAT”
• Command: FORECAST YHAT
• Mouse Result of Forecast Procedure
Alternative Approach to Plotting
• Eviews Command:
– PLOT USLD1 USLD1F
4
Alternative Approach to Plotting
Aside: Comparison of Plots
Sample Regression Line Output
• SMPL 92.1 97.2
• LS USLD1 C TIME
USLD1 = 8336.767 + 319.546*(time)
319
8336
5
Wrap Up:
• What a Trend Line Is
• Mechanics in Eviews:
– Fitting a Trend Line – Viewing a Plot of a Trend Line
Vi i
l
f
d Li
– Several Approaches, Choose Your Favorite
6
Download