Time Series Analysis

Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

Time Series Analysis

Introduction
• Time Series Analysis is a way of studying the characteristics of the response
variable concerning time as the independent variable.
• To estimate the target variable in predicting or forecasting, use the time
variable as the reference point.
• Time Series Analysis represents a series of time-based orders, it would be Years,
Months, Weeks, Days, Horus, Minutes, and Seconds.
• It is an observation from the sequence of discrete time of successive intervals.
• Some real-world application of Time Series Analysis includes weather
forecasting models, stock market predictions, signal processing, and control
systems.
What Is Time Series Analysis?
• Time series analysis (TSA) is a specific way of analyzing a sequence of data
points collected over time.
• In TSA, analysts record data points at consistent intervals over a set period
rather than just recording the data points intermittently or randomly.
Objectives of Time Series Analysis
• To understand how time series works and what factors affect a certain
variable(s) at different points in time.
• Time series analysis will provide the consequences and insights of the given
dataset’s features that change over time.
• Supporting to derive the predicting the future values of the time series variable.
• Assumptions: There is only one assumption in TSA, which is “stationary,” which
means that the origin of time does not affect the properties of the process
under the statistical factor.
Significance of Time Series
• TSA is the backbone for prediction and forecasting analysis, specific to time-
based problem statements.
• Analyzing the historical dataset and its patterns
• Understanding and matching the current situation with patterns derived from
the previous stage.
• Understanding the factor or factors influencing certain variable(s) in different
periods.
Continue…
• With the help of “Time Series,” we can prepare numerous time-based analyses
and results.
• Forecasting: Predicting any value for the future.
• Segmentation: Grouping similar items together.
• Classification: Classifying a set of items into given classes.
• Descriptive analysis: Analysis of a given dataset to find out what is there in it.
• Intervention analysis: Effect of changing a given variable on the outcome.
Components of Time Series Analysis
• Trend: In which there is no fixed interval and any divergence within the given
dataset is a continuous timeline. The trend would be Negative or Positive or
Null Trend
• Seasonality: In which regular or fixed interval shifts within the dataset in a
continuous timeline. Would be bell curve or saw tooth
• Cyclical: In which there is no fixed interval, uncertainty in movement and its
pattern
• Irregularity: Unexpected situations/events/scenarios and spikes in a short time
span.
Limitations of Time Series Analysis
• Time series has the below-mentioned limitations; we have to take care of those
during our data analysis.
• Similar to other models, the missing values are not supported by TSA
• The data points must be linear in their relationship.
• Data transformations are mandatory.
• Models mostly work on Uni-variate data.
Data Types of Time Series
• While discussing TS data types, there are two major types – stationary and non-
stationary.
• Stationary: A dataset should follow the below thumb rules without having
Trend, Seasonality, Cyclical, and Irregularity components of the time series.
• The mean value of them should be completely constant in the data during the
analysis. The variance should be constant with respect to the time-frame
• A time series is said to be stationary if its mean and variance are constant over
time and the value of the covariance between two time periods depends only
on the distance between the two time periods and not the actual time at which
the covariance is computed
• Non- Stationary: If either the mean-variance or covariance is changing with
respect to time, the dataset is called non-stationary.
The importance of stationary time series
• First, if a time series is nonstationary, we can study its behavior only for the
period under consideration, such as the one in our dollar/euro exchange rate.
• Each time series will therefore be a particular episode. As a result, it is not
possible to generalize it to other time periods.
• For forecasting purposes, therefore, nonstationary time series will be of little
practical value.
Continue…
• Second, if we have two or more nonstationary time series, regression analysis
involving such time series may lead to the phenomenon of spurious or
nonsense regression.
• That is, if you regress a nonstationary time series on one or more nonstationary
time series, you may obtain a high R2 value and some or all of the regression
coefficients may be statistically significant on the basis of the usual t and F
tests.
• Unfortunately, in cases of nonstationary time series these tests are not reliable,
for they assume that the underlying time series are stationary
Test of Stationarity
• ways to examine the stationarity of a time series:
• (1) Graphical analysis
• (2) unit root analysis
• Graphical analysis
• A rough and ready method of testing for stationarity is to plot the time series,
as we
• Very often such an informal analysis will give some initial clue whether a given
time series is stationary or not.
• Such an intuitive feel is the starting point of more formal tests of stationarity.
The unit root test of stationarity

• where that is, the first difference of the log of the


exchange rate, t is the time or trend variable taking value of 1, 2, till the end of
the sample, and ut is the error term.

• we regress the first differences of the log of exchange rate on the trend variable
and the one-period lagged value of the exchange rate.
• The null hypothesis is that B3, the coefficient of LEX t–1 is zero. This is called the
unit root hypothesis.
• The alternative hypothesis is: B3 < 0. A nonrejection of the null hypothesis
would suggest that the time series under consideration is nonstationary.
• The Dickey Fuller test is conducted to check for the stationarity of the time
series.
• Use the DF critical values to find out if calculated t value of the coefficient of
LEX t–1 (= B3), exceeds the DF critical value.

• If in an application the computed t (= tau) value of the estimated B3 is greater
(in absolute value) that the critical DF value, we reject the unit root hypothesis
– that is, we conclude that the time series under study is stationary.
• In that case the conventional t test is valid.
• On the other hand, if it does not exceed the critical tau value, we do not reject
the hypothesis of unit root and conclude that the time series is nonstationary.
• Look at the coefficient of LEX lagged one period. Its t (=tau) value is –3.0265.
• If you look at the conventionally computed p or probability value of this
coefficient, it is 0.0025, which is very low.
• Hence you would be tempted to conclude that the estimated coefficient of
about –0.004 is statistically different from zero and so the US/EU time series is
stationary.
• However, the DF critical values are: –3.9619 (1% level), –3.4117 (5% level) and –
3.1277 (10% level). The computed t value is –3.0265.
• In absolute terms, 3.0265 is smaller than any of DF critical t values in absolute
terms. Hence, we conclude that the US/EU time series is not stationary.
• The DF test can be performed in three different forms:
• In each case the null hypothesis is that B3 =0 (i.e. unit root) and the alternative
hypothesis is that B3 < 0 (i.e. no unit root).
• However, the critical DF values are different for each of these models. Which
model holds in an application is an empirical question.
• But guard against model specification errors.
• If model (13.7) is the “correct” model, fitting either model (13.5) or (13.6)
would constitute a model specification error: here the omission of an important
variable(s).
• Which of the Equations (13.5), (13.6), and (13.7) should we use in practice?
Here are some guidelines.
• 1 Use Eq. (13.5) if the time series fluctuates around a sample average of zero.
• 2 Use Eq. (13.6) if the times series fluctuates around a sample average that is
nonzero.
• 3 Use Eq. (13.7) if the time series fluctuates around a linear trend. Sometimes
the trend could be quadratic.
• In the literature, model (13.5) is called a random walk model without drift (i.e.
no intercept), model (13.6) is called a random walk with drift (i.e. with an
intercept), B1 being the drift (or shift) parameter, and model (13.7) is a random
walk model with drift and deterministic trend, so called because a deterministic
trend value B2 is added for each time period.
Augmented Dickey-Fuller (ADF) Test

• In Models (13.5), (13.6), and (13.7) it was assumed that the error term ut is
uncorrelated.
• But if it is correlated, which is likely to be the case with model (13.7), Dickey
and Fuller have developed another test, called the augmented Dickey–Fuller
(ADF) test.
• This test is conducted by “augmenting” the three equations by adding the
lagged values of the dependent variable ∆LEXt as follows:
• where is a pure white noise error term and where m is the maximum
length of the lagged dependent variable, which is determined empirically.
• The objective is to make the residuals from Eq. (13.7) purely random.
• ADF test is done with the following assumptions:
• Null Hypothesis (H0): Series is non-stationary
• Alternate Hypothesis (HA): Series is stationary
• p-value >0.05 Fail to reject (H0)
• p-value <= 0.05 Accept (H1)
Trend stationary vs. difference stationary time
series
• A common practice to make such a trending time series stationary is to remove
the trend from it.
• This can be accomplished by estimating the following regression:

• where t (time) is a trend variable taking chronological values, 1, 2, ..., 2,355, and
vt is the error term with the usual properties.
• After running this regression, we obtain

• The estimated error term in the above equation vt , now represents the
detrended LEX time series, that is LEX with the trend removed.
• The procedure just described is valid if the original LEX series has a
deterministic trend. The residuals obtained from the above regression are
shown in the below figure
• This figure very much resembles the first figure. If you subject the series in
figure 2 to unit root analysis, you will find that the detrended LEX series is still
nonstationary.
• Therefore, the de-trending procedure just outlined will not make a
nonstationary time series stationary, because such a procedure is valid only if
the series contains a deterministic trend.
• If a time series becomes stationary if we detrend it in the manner suggested, it
is called a trend stationary (stochastic) process (TSP).
• A process with a deterministic trend is nonstationary but not a unit root
process.
• Instead of detrending a time series in the manner suggested above, suppose we
take the first differences of LEX (subtract the preceding value of LEX from its
current value).
• If a time series becomes stationary after we take its first differences, we call
such a time series a difference stationary (stochastic) process (DSP)
Integrated time series
• If such a time series becomes stationary after differencing it once, it is said to
be integrated of order one, denoted as I(1).
• If it has to be differenced twice (i.e. difference of difference) to make it
stationary, it is said to be integrated of order two, denoted as I(2).
• If it has to be differenced d times to make it stationary, it is said to be
integrated of order d, denoted as I(d).
• A stationary time series is I(0), that is, integrated of order zero.
• Therefore the terms “stationary time series” and “time series integrated of
order zero” mean the same thing.
• By the same token, if a time series is integrated, it is nonstationary
• It may be added that an I(0) series fluctuates around its mean with constant
variance, while an I(1) series meanders wildly. Another way of putting this is
that an I(0) series is mean reverting, whereas an I(1) series does not show such
a tendency.
• It can drift away from the mean permanently. That is why an I(1) series is said
to have a stochastic trend.
• Most nonstationary economic time series generally do not need to be
differenced more than once or twice.
• To sum up, a nonstationary time series is known variously as an integrated time
series or a series with stochastic trend.
Random Walk Model
• A special type of nonstationary time series that figures prominently in the
finance literature, namely the random walk time series.
• Random walk assumes that in each period the variable takes a random step
away from its previous value, and the steps are independently and identically
distributed in size (“i.i.d.”).
• This is equivalent to saying that the first difference of the variable is a series to
which the mean model should be applied.
• A random walk is a time series model such that
• where is a discrete white noise series.

You might also like