Title: Time Series Analysis
1Time Series Analysis
- Materials for this lecture
- Lecture 6 Lags.XLS
- Lecture 6 Stationarity.XLS
- Read Chapter 15 pages 30-37
- Read Chapter 16 Section 15
2Time Series Analysis
- Comprehensive forecasting methodology for
univariate distributions - Best for variables unrelated to other variables
in a structural model - Autoregressive process in past will prevail
- Yt f(Yt-1, Yt-2, Yt-3, Yt-4, )
- Assumptions are
- E(Mean of ê) 0.0
- Variance of êt constant
3Time Series Analysis
- Steps for estimating a times series model are
- Graph the data series to see what patterns are
present trend, cycle, seasonal, and random - Test data for Stationarity with a Dickie Fuller
Test - If original series is not stationary then
difference it until it is - Number of Differences (p) to make a series
stationary is determined using the D-F Test - Use the stationary (differenced) data series to
determine the number of Lags that best forecasts
the historical period - Given a stationary series use the Schwarz
Criteria (SIC) or autocorrelation table to
determine the best number of lags (q) to include
when estimating the model - Estimate the AR(p,q) Model and make a forecast
4Time Series Analysis Assumptions
- Assume series you are forecasting is random
- No trend, seasonal, or cyclical pattern remains
in series - Series is stationary or white noise
- To guarantee this assumption we make the data
stationary - Assume the variability is the same for the future
as for the past - s2Ti s2t
- Can test for constant variance by testing
correlation over time - Crucial assumption because if s2 changes
overtime, then forecast will explode overtime
5Make Data Series Stationary
- Take differences of the data to make it
stationary - First difference all T obs. of Y to calculate
D1,t - D1,t Yt Yt-1
- Calculate first difference of D1,t for a Second
Difference of Y or - D2,t D1,t D1,t-1
- Calculate first difference of D2,t for a Third
difference of Y or - D3,t D2,t D2,t-1
- Stop differencing data when series is stationary
6Make Data Series Stationary
- Example Difference table for a time series data
set - D1t in period 1 is 0.41 71.47-71.06
- D2t in period 1 is -1.82 -1.41 0.41
- Etc.
7Test for Stationarity
- Dickie-Fuller Test for stationarity
- First D-F test -- is original data stationary?
- Estimate regression Y a b D1,t
- Calculate the t ratio for b to see if a
significant slope exists - D-F Test statistic is the t-statistic more
negative than -2.9, we declare the dependent
series (Y in this case) stationary at alpha 0.05
level - Thus D-F statistic of -3.0 is more negative than
-2.90 so the original series is stationary and
differencing is not necessary
8Test for Stationarity
- Second D-F Test for stationarity of the D1,t
series, in other words will the series be
stationary with one differencing? - Estimate regression for D1,t a b D2,t
- t statistic on slope b is the second D-F test
statistic - Third D-F Test for stationarity of the D2,t
series, in other words will the series be
stationary with two differences? - Estimate regression for D2,t a b D3,t
- t statistic on slope b is the third D-F test
statistic - Continue with a fourth and fifth DF test if
necessary
9Test for Stationarity
- How does D-F test work?
- If a series is stationary, it oscillates about
its own mean and has a slope of zero - If a 1 period lag Yt-1 is used to predict Yt ,
they are good predictors of each other because
they have the same mean. The t-statistic on b
will be significant for D1,t a
b D2,t - Lagging the data 1 period causes the two series
to be inversely related so the slope is negative
in the OLS equation. That explains why the t
coefficient of -2.9 is negative. The -2.9
represents a 5 1 tail test statistic.
10Test for Stationarity
- Estimated regression for Y a b D1,t
- DF is -1.868 the t ratio
- Intercept not zero so mean of Y is not constant
11Test for Stationarity
- Estimated regression for D1,t a b D2,t
- DF is -12.948 the t ratio
- Intercept is 0.121 or about zero, so the mean
is more likely to be constant
12Test for Stationarity
- Estimated regression for D2,t a b D3,t
- DF is -24.967 the t ratio
- Intercept is about zero
13Test for Stationarity
- Dickie Fuller test in Simetar
- DF ( Data Series, Trend, No Lags, No. Diff )
- Where Data series is the location of the data,
- Trend is True or False
- No. Lags is optional if data are to be
lagged - No. Diff is the number of differences to
test
14Test for Stationarity
- The number of differences that make the data
series stationary is the one that has a DF test
stat more negative than -2.9 - Here it is 1 difference no matter if trend
included or not
Lecture 5
15Summarize Stationarity
- Yt is the original data series
- Di,t is the ith difference of the Yt series
- We difference the data to make it stationary
- This guarantees the assumption that mean is
constant - Dickie Fuller test is used to determine the Di,t
difference needed to make series stationary - DF(Data, Trend, , No. of Differences)
- Test 0 to 6 differences with and without trend
and zero lags - Select the difference with a DF test stat. More
negative than -2.90
16Test for Stationarity
- Once we have determined the number of differences
we know what form the auto regressive (AR) model
will be fit - AR ( No. Differences, No. Lags) or AR(p,q)
- If the series is stationary with 1 difference we
will fit the model - D1,t a b1 D1,t-1 b2 D1,t-2
- The only question that remains is how many lags
(q) of Di,t will we need to forecast the series - To determine the number of lags we use several
tests
17Number of Lags for TS Model
- Partial autocorrelation coefficients used to
estimate number of lags of Di,t to include in
model. Assume D1,t is stationary then - To test for one lag use b1 from regression model
- D1,t a b1 D1,t-1
- To test for two lags use b2 from regression model
- D1,t a b1 D1,t-2 b2 D1,t-2
- To test for three lags use b3 from regression
model - D1,t a b1 D1,t-1 b2 D1,t-2 b3 D1,t-3
- After each regression we only use the beta (bi)
for the longest number of lags. - Use the t stat on the bi to determine
contribution of the lags to explain D1t - So this calls for running lots of regressions
with different numbers of lags, right?
18Number of Lags for TS Model
- Find the optimal number of lags the easy way
- Use Simetar to build a SAC table
- AUTOCORR(Data Series, No. Lags, No. Diff)
- Pick best no. of lags based on the last lag with
a statistically significant t value
19Number of Lags for TS Model
- Bar chart of autocorrelation coefficients in
AUTOCORR(Data Series, No. Lags, No. Diff) - The explanatory power of the distant lags is not
large enough to warrant including in the model,
based on their t stats, so do not include them.
20Autocorrelation Charts of Sample Autocorrelation
Coefficients (SAC)
21Note Partial vs. Sample Autocorrelation
- Partial autocorrelation coefficients (PAC) show
the contribution of adding one more lag. - It takes into consideration the impacts of lower
order lags - A beta for the 3rd lag shows the contribution of
3rd lag after having lags 1-2 in place - D1,t a b1 D1,t-1 b2 D1,t-2 b3 D1,t-3
- Sample autocorrelation coefficients (SAC) show
contribution of adding a particular lag. - A SAC for 3 lags shows the contribution of just
the 3rd lag. - Thus the SAC does not equal the PAC
22Number of Lags for Time Series Model
- Some authors suggest using SAC to determine the
number of differences to achieve stationarity - If the SAC cuts off or dies down rapidly it is an
indicator that the series is stationary - If the SAC dies down very slowly, the series is
not stationary - This is a good check of the DF test, but we will
rely on the DF test for stationarity
23Number of Lags for Time Series Model
- Schwarz Criteria (SIC) tests for the number of
lags in a TS model - Goal is to find the number of lags which
minimizes the SIC - In Simetar use the ARLAG() function which returns
the optimal number of lags based on SIC - ARLAG(Data Series, No. of Diff, No. of Lags)
24Schwarz Criteria and ARLAG Tables
ARLAG indicates no. of lags to minimize SC 1
lag, given the no. of differences.
Pick the no. of lags to Minimize the SC 1 lag
Autocorr finds no. of lags where AC drops 1 lag
25Summarize Stationarity/Lag Determination
- Make the data series stationary by differencing
the data - Use the Dickie-Fuller Test (df lt -2.90) to find
Di series that is stationary - Use the DF() function in Simetar
- Determine the number of Lags for the Di series
- Use the sample autocorrelation coefficients for
alternative lag models - AUTOCORR() function in Simetar
- Minimize the Schwarz Criteria
- ARLAG() or ARSCHWARZ() functions in Simetar