2. Types of Unit Root Tests
• The Dickey Fuller Test/ Augmented Dickey Fuller Test
• The Elliott–Rothenberg–Stock Test, which has two subtypes:
1. The P-test (panel unit root test) that is based on a notion of median
unbiased estimation that uses the invariance property and the median
function of panel pooled OLS estimator, and takes the error term’s serial
correlation into account.
2. The DF-GLS test can be applied to detrended data without intercept.
• The Schmidt–Phillips Test: Subtypes are the rho-test and the tau-test.
• The Phillips–Perron (PP) Test is a modification of the Dickey Fuller test,
and corrects for autocorrelation and heteroscedasticity in the errors.
• The Zivot-Andrews test allows a break at an unknown point in the
intercept or linear trend (4).
3. Dickey Fuller Test
The Dickey Fuller Test is a statistical hypothesis
test that measures the amount of stochasticity in a
time series model. The Dickey Fuller Test is based
on linear regression.
The Dickey Fuller test above actually creates a t-
statistic that is compared to predetermined
critical values. Being below that critical statistic
allows us to reject the null hypothesis and accept
the alternative
4. Unit root
A unit root process is a data-generating process whose first
difference is stationary. In other words, a unit root
process yt has the form
yt = yt–1 + stationary process.
A unit root test attempts to determine whether a given time
series is consistent with a unit root process.
The next section gives more details of unit root processes,
and suggests why it is important to detect them.
5. What does a unit root test do?
In statistics, a unit root test tests whether a time
series variable is non-stationary and
possesses a unit root.
The null hypothesis is generally defined as the
presence of a unit root and
the alternative hypothesis is either stationarity,
trend stationarity or explosive root depending on
the test used.
6. Modeling Unit Root Processes
There are two basic models for economic data with linear growth
characteristics:
• Trend-stationary process (TSP): yt = c + δt + stationary process,
I(O)
• Unit root process, also called a Difference-stationary process
(DSP): Δyt = δ + stationary process, I(1)
Here Δ is the differencing operator, Δyt = yt – yt–1 = (1 – L)yt, where L is the lag operator
defined by Liyt = yt – i.
7. Unit root
The processes are indistinguishable for finite data.
In other words, there are both a TSP and a DSP that fit a
finite data set arbitrarily well.
However, the processes are distinguishable when restricted
to a particular subclass of data-generating processes, such
as AR(Autoregressive processes)(p) processes.
After fitting a model to data, a unit root test checks if the AR
(1)- autoregressive pane data- coefficient is 1.
8. Unit root
There are two main reasons to distinguish between these
types of processes:
• Forecasting
• Spurious Regression
10. ADF
Serial correlation can be an issue, in which case
the Augmented Dickey-Fuller (ADF) test can be
used.
The ADF is handles bigger and more complex
models.
11. Below are the results from an Augmented Dickey Fuller Test
from two different data sets.
One being stochastic in nature, the other naught.
The first test color coded in purple has a high p value and a test
statistic well higher the highest critical value (absolute values).
This means it has a unit root process and therefore is stochastic
in nature. We fail to reject the null hypothesis. (vice versa)
12. The test is color coded in green and has a low p value and a test
statistic well below the lowest critical value.
This means it does not have a unit root process and therefore is
non-stochastic in nature.
We reject the null hypothesis and accept the alternative (desired
for significance)
13. Forecasting
A Trend Stationary process -TSP and a differentiated -DSP produce
different forecasts. Basically, shocks to a TSP return to the trend line
c+δt as time increases. In contrast, shocks to a DSP might be persistent
over time.
For example, consider the simple trend-stationary model
y1,t=0.9y1,t−1+0.02t+ε1,t
and the difference-stationary model subtracting Yt-1 from Yt, taking
the difference Yt - Yt-1) correspondingly to DY=Yt - Yt-1 = εt or Yt -
Yt-1 = α + εt and then the process becomes difference-stationary.
y2,t=0.2+y2,t−1+ε2,t.
15. TSP trend stationarity process
Examine the fitted parameters by passing the estimated
model to summarize, and you find estimate did an
excellent job.
The TSP has confidence intervals that do not grow with
time, whereas the DSP has confidence intervals that grow.
Furthermore, the TSP goes to the trend line quickly, while
the DSP does not tend towards the trend line
y=0.2t asymptotically.
17. Spurious Regression-
In statistics, a spurious relationship or spurious
correlation[1][2] is a mathematical relationship in
which two or more events or variables
are associated but not causally related,
due to either coincidence or the presence of a
certain third, unseen factor (referred to as a
"common response variable",
18. Spurious Regression- illegitimate not true??
The presence of unit roots can lead to false inferences in regressions between time
series.
Suppose xt and yt are unit root processes with independent increments, such as
random walks with drift
xt = c1 + xt–1 + ε1(t)
yt = c2 + yt–1 + ε2(t),
where εi(t) are independent innovations processes. Regressing y on x results, in
general, in a nonzero regression coefficient, and significant coefficient of
determination R2. This result holds despite xt and yt being independent random
walks.
19. Spurious Regression
If both processes have trends (ci ≠ 0), there is a correlation
between x and y because of their linear trends.
However, even if the ci = 0, the presence of unit roots in
the xt and yt processes yields correlation.
20. Testing unit root
There are four Econometrics Toolbox™ tests for unit roots. These functions test for the existence of
a single unit root. When there are two or more unit roots, the results of these tests might not be valid.
Modeling Unit Root Processes
There are two basic models for economic data with linear growth characteristics:
Trend-stationary process (TSP): yt = c + δt + stationary process
Unit root process, also called a difference-stationary process (DSP): Δyt = δ + stationary
process
Here Δ is the differencing operator, Δyt = yt – yt–1 = (1 – L)yt, where L is the lag operator
defined by Liyt = yt – i.
21. Testing for Unit Roots
Transform Data
Choose Models to Test
Determine Appropriate Lags
Conduct Unit Root Tests at Multiple Lags
22. Transform Data
Transform your time series to be approximately linear
before testing for a unit root.
If a series has exponential growth, take its logarithm.
For example, GDP and consumer prices typically have
exponential growth, so test their logarithms for unit roots.
23. Choose Models to Test
•For adf test or pp test, choose model in as follows:
•If your data shows a linear trend, set model to 'TS'.
•If your data shows no trend, but seem to have a
nonzero mean, set model to 'ARD'.
•If your data shows no trend and seem to have a zero
mean, set model to 'AR' (the default).
24. Determine Appropriate Lags
Setting appropriate lags depends on the test you use:
Adf test — One method is to begin with a maximum lag,
Then, test down by assessing the significance of the
coefficient of the term at maximum lag of p
25.
26. Unit root test : Augmented Dickey Fuller test (ADF)
Explanation of the Dickey-Fuller test.
A simple AR model can be represented as:
where
yt is variable of interest at the time t
ρ is a coefficient that defines the unit root
ut is noise or can be considered as an error term.
If ρ = 1, the unit root is present in a time series, and the time series is
non-stationary.
27. ADF
If a regression model can be represented as
Where
Δ is a difference operator.
ẟ = ρ-1
So here, if ρ = 1, which means we will get the differencing as the error term and
if the coefficient has some values smaller than one or bigger than one, we will
see the changes according to the past observation.
28. There can be three versions of the test.
test for a unit root
test for a unit root with constant
test for a unit root with the constant and deterministic trends
with time
29. So if a time series is non-stationary, it will tend to return an
error term or a deterministic trend with the time values.
If the series is stationary, then it will tend to return only an
error term or deterministic trend.
In a stationary time series, a large value tends to be
followed by a small value, and a small value tends to be
followed by a large value.
And in a non-stationary time series the large and the small
value will accrue with probabilities that do not depend on
the current value of the time series.
30. The augmented dickey- fuller test is an extension of the
dickey-fuller test, which removes autocorrelation from the
series and then tests similar to the procedure of the dickey-
fuller test.
The augmented dickey fuller test works on the statistic,
which gives a negative number and rejection of the
hypothesis depends on that negative number;
the more negative magnitude of the number represents the
confidence of presence of unit root at some level in the
time series.
31. We apply ADF on a model, and it can be represented
mathematically as
Where
ɑ is a constant
???? is the coefficient at time.
p is the lag order of the autoregressive process.
Here in the mathematical representation of ADF, we have
added the differencing terms that make changes between
ADF and the Dickey-Fuller test.
32. The unit root test is then carried out under the null
hypothesis ???? = 0 against the alternative hypothesis of
???? < 0. Once a value for the test statistic.
In statistics, a unit root test tests whether a time series
variable is non-stationary and possesses a unit root.
The null hypothesis is generally defined as the presence
of a unit root and the alternative hypothesis is either
stationarity, trend stationarity or explosive root depending
on the test used.
33. ADF
A key point to remember here is: Since the null hypothesis
assumes the presence of a unit root,
It can be compared to the relevant critical value for the
Dickey-Fuller test. The test has a specific distribution
simply known as the Dickey–Fuller table for critical values.
the p-value obtained by the test should be less than the
significance level (say 0.05) to reject the null hypothesis.
Thereby, inferring that the series is stationary.
34. Implementation of ADF Test
To perform the ADF test in any time series package, stats model provides the
implementation function ad fuller().
Function ad fuller() provides the following information.
p-value
Value of the test statistic
Number of lags for testing consideration
The critical values
Next in the following we perform unit root test and interpret
35. Autocorrelation
‘Just as correlation measures the extent of a linear relationship between two
variables, autocorrelation measures the linear relationship between lagged values of
a time series.’ Autocorrelation means that the linear model is self aware, it is
constantly taking into account a past version of itself.
A time lag is when the model measures its current performance in comparison to past
performance after a given set of time.
This is yet another way of measuring the stationarity of a model.
It is a simpler approach than trying to color code your graphs based on the outcome
of your AD Fuller results.
36. Below is the correlogram for Google stocks over a period
of 5 years. The lines being extremely close to one and in
a slight descending visual pattern indicates high
amounts of autocorrelation.
37. Looking at the second correlogram below, we can see that
autocorrelation is very low and random meaning our model is
stable.
Usually correlograms start with the first lag being fully correlated
with itself at 1.
The closer to 0 each lag lies, the less autocorrelation present in
the model.
38. Differencing
Differencing is a technique that can be applied to a data set in order to remove any
sort of stochasticity.
It is a method to make a non-stationary time series stationary — compute the
differences between consecutive observations.
This is a technique applied after a unit root test and autocorrelation test have been
run.
The 2 lines of code for differencing
39. Next week we will perform
Unit root test and OLS Eview
Thank you