450 likes | 975 Views
Time Series Analysis. What is a time series?. A time series is any series of data that varies over time. For example Quarterly GDP of Laos Hourly price of stocks and shares Weekly quantity of beer sold in a pub Each time-series is one realization of a stochastic (i.e. random) process.
E N D
What is a time series? A time series is any series of data that varies over time. For example • Quarterly GDP of Laos • Hourly price of stocks and shares • Weekly quantity of beer sold in a pub • Each time-series is one realization of a stochastic (i.e. random) process
Stationary Time Series Has constant Mean and constant Variance across time Has a theoretical covariance between values of Xtthat depends only on the difference apart in time
Stationary time series WHITE NOISE PROCESS Xt = ut ut ~ IID(0, σ2 )
Many Economic Series are not stationary Share Prices Exchange Rate Income
Non Stationary Time Series There is no long-run mean for the time-series and/or The variance is time dependent and goes to infinity as time approaches to infinity
Spurious Regression • The results of classical econometric theory are derived under the assumption that variables of interests are stationary. • A Spurious or Nonsensical relationship may result when one Non-stationary time series is regressed on one or more Non-stationary time series.
An example of Non-stationary time series RANDOM WALK Xt = Xt-1 + utut ~ IID(0, σ2 ) Xt = X0 + u1 + u2 +…+ ut Variance: Var(Xt) = Var(X0) + Var(u1) +…+ Var(ut) = 0 + σ2 +…+ σ2 = t σ2 (variance is not constant through time)
Non-stationary time series: Random WalkXt = Xt-1 + utut ~ IID(0, σ2 )
What is a “Unit Root”? • If a Non-Stationary Time Series Xt has to be “differenced” d times to make it stationary, then Xt is said to contain d “Unit Roots”. It is customary to denote Xt ~ I(d) which reads “Xt is integrated of order d”
Establishment of Stationarity Using Differencing of Integrated Series • If Xt ~ I(1), then Zt= Xt – Xt-1 is Stationary • If Xt ~ I(2), then Zt= Xt – Xt-1 – (Xt – Xt-2 ) is Stationary
Random Walks • A random walk is as a unit root process • A random walk process is “integrated of order one, [I(1)],” meaning a first difference will be stationary, “I(0)”.
Removing trend and seasonality in a time-series • Economic time series often have a trend • One possibility to remove a linear trend involves regressing the series on t, which can be modeled as xt = a0 + a1t + et • Then analyze the residuals from the detrended series.
Seasonality • Sometimes time-series data exhibits some seasonality. • Example: Quarterly data on retail sales will tend to jump up in the 4th quarter • As with trends, the series can be seasonally adjusted by adding a set of seasonal dummies in the above regression.
Alternatively, • We can simply remove trend or seasonality by calculating first difference or seasonal difference.
A trending series or seasonal series cannot be stationary, since the mean is changing over time. • After the adjustment, the remaining maybe stationary and can be analyzed.
Times-Series Analysis --- (Box-Jenkins Approach analysis, ARIMA analysis) Differencing the series to achieve stationarity Identify model to be tentatively entertained Estimate the parameters of the tentative model No Diagnostic checking. Is the model adequate? Use the model for forecasting Yes
ARIMA Analysis • We use an autoregressive integrated moving average (ARIMA) model to fit the data. • If time-series data is already stationary, can use autoregressive moving average (ARIMA) model to fit the data.
We will use ARMA model to fit a stationary time-series data. • ARMA (p, q) refers to a model with p autoregressive terms and q moving average terms. • An ARMA (p,q) process is a stationary process in the following form :
An AR(1) Process (ARMA(p=1,q=0)) • An autoregressive process of order one [AR(1)] can be characterized as one where xt = rxt-1 + et , t = 1, 2,… with et being an iid sequence with mean 0 and variance se2 • For this process to be stationary, it must be the case that |r| < 1
Random Walks • A random walk is an AR(1) model where r = 1 • A random walk series is not stationary.
An MA(1) Process (ARMA(p=0,q=1)) • A moving average process of order one [MA(1)] can be characterized as one where xt = et + 1et-1, t = 1, 2, … with et being an iid sequence with mean 0 and variance s2e • This is a stationary sequence. • Variables 1 period apart are correlated, but 2 periods apart they are not.
How to choose p and q? Check ACF and PACF graphs • Correlogram – graph showing the ACF and the PACF at different lags. • Autocorrelation function (ACF)- ratio of sample covariance (at lag k) to sample variance • Partial autocorrelation function (PACF) – measures correlation between (time series) observations that are k time periods apart after controlling for correlations at intermediate lags (i.e., lags less than k). In other words, it is the correlation between Yt and Yt-k after removing the effects of intermediate Y’s.
Diagnostic Checking—Is our model good enough? How do we know that the model we estimated is a reasonable fit to the data? • Check residuals after the modeling Rule of thumb: None of the ACF and the PACF are individually statistically significant Formal test: Ljung-Box Q is estimated autocorrelation at lag h.
Some issues in the time-series modeling • Do not know the underlying cause; we still do not understand why the series is behaving this or that way. • Judgmental decisions on the choice of AR, MA, p, q. Also, model identification requires large number of observations but often times-series data is not very long. • The model you fitted in past data may not work well in current or future data.