Econometría 2: Análisis de series de Tiempo Karoll GOMEZ kgomezp@unal.edu.co http://karollgomez.wordpress.com Primer semestre 2016
I. Introduction
Content: 1. General overview 2. Times-Series vs Cross-section data 3. Time series components 4. How to deal with trend and seasonal components? 5. Stationarity concept
Introduction: Definition I. Overview: A time series is a set of observations X t (or denoted by Y t ), each one being recorded at a specific time t with 0 < t < T. Time series analysis refers to the branch of statistic where observation are collected sequentially in time, usually but no necessarily at equally spaced time points.
Introduction: Data
Introduction: Data
Introduction: Goals
Introduction: The importance of forecasting
Introduction: Times-Series in Economics Macro vs Financial Time series Macro limited by small number of observations available over long horizon. A typical data set has at best 20 years of monthly or 40 years of quarterly data, which sum up to less than 300 observations. This allows us to study linear relations between variables or model means. Macro Time series mostly focuses on means Financial data usually high-frequency over short period of time. This allows us to model volatility and higher moments. Examples: stock prices. Financial data mostly focuses on variances and higher moments.
Introduction: Examples
Introduction: Examples
Introduction: Examples
Introduction: Examples
Introduction: Examples
Introduction: Times-Series vs Cross-section II. Times-Series vs Cross-section data The main difference between time series and cross-section data is in dependence structure. Cross-section econometrics mainly deals with i.i.d. observations, while in time series each new arriving observation is stochastically depending on the previously observed. The dependence is our best friend and a great enemy. On one side, the dependence screw up your inferences: the Central Limit Theorem should be corrected to hold for dependent observations. That bring us to the task of correcting our procedures for dependence. On the other side, the dependence allow us to do more by exploiting it. For example, we can make forecasts (which are almost non-sense in cross-section).
Introduction: iid vs no-iid data
Introducción: iid vs no-iid data Then if the underlying common probability model for the X s is N(µ, σ 2 ) the sample mean and the sample variance are independently distributed. Question: What can one expect regarding the status of independence or dependence between sample mean and sample variance when the random variables X s are allowed to be non-iid or non-normal? Answer: The sample mean and the variance may or may not follow independent probability models!
Introducción: Consequences no-iid data The main consequences of long-range correlations in supposedly i.i.d. data are: The effects are mild for point estimation, but drastic for standard errors, confidence intervals and tests for not very small samples, and they increase exponentially with the size of the data set. Typical example: The true variance of the arithmetic mean of 130 observations can easily be 20 times the variance derived under the independence assumption.
Introduction: Time series Plot Times-Series components (types of dynamic variation)
Introduction: Types of variation Are the series completely random?
Introduction: types of variation
Introduction: types of variation
Introduction: Types of variation Trend Component
Introduction: Types of variation Sesonal Component
Introduction: Types of variation Cyclical Component
Introduction: Types of variation Irregular Component
Introduction: Types of variation
Introduction: Types of variation
Introduction: Types of variation
Introduction: Types of variation How to deal with trend and seasonal components? A. Time series with a trend component: curve Fitting, Filtering and differencing methods. B. Time series with a seasonal component: Seasonal filtering and Seasonal differencing methods
Introduction: Time series with trend A. Time series with a trend component There are two types of trends: Deterministic Stochastic A trending mean is a common violation of stationarity.
Introduction: Stochastic vs determisnistic There are two popular models for nonstationary series with a trending mean: 1. Trend stationary: The mean trend is deterministic. Once the trend is estimated and removed from the data, the residual series is a stationary stochastic process. 2. Difference stationary: The mean trend is stochastic. Differencing the series one or several times yields a stationary stochastic process.
Introduction: Trend features The distinction between a deterministic and stochastic trend has important implications for the long-term behavior of a process: * Time series with a deterministic trend always revert to the trend in the long run (the effects of shocks are eventually eliminated). Forecast intervals have constant width. ** Time series with a stochastic trend never recover from shocks to the system (the effects of shocks are permanent)
Introduction: Deterministic and Stochastic component of a trend Example: Considering the following process (Random walk plus drift): The solution is given by: X t = X t 1 + α + ε t X t = X 0 + αt + T t=1 where X 0 is an initial value, and the average behavior of X t in the long-run will be determined by the parameter α, which is the (unconditional) expected change in X t. ε t
Introduction: Deterministic vs Stochastic Trends We see that the random walk with drift has a trend, which includes a stochastic and deterministic component (that can account for a time series tendency to increase on average over time). 1 Deterministic part: series always changes by the same fixed amount from one period to the next. E[X t ] = X 0 + αt 2 Stochastic part: series changes from one period to the next is totally stochastic. T E[X t ] = X 0 + t=1 ε t
Introduction: Transitory vs Permanent effect of a trend What happend when a ε t shock occurs? 1 Deterministic part: E[X t ] = X 0 + αt which means X t will exhibit only temporary departures from the trend when a ε t shock occurs. 2 Stochastic part: E[X t ] = X 0 + which means X t will exhibit permanent departures from the trend when a ε t shock occurs. T t=1 ε t
Introduction: Deterministic vs Stochastic Trends The appropriate way to remove the trend components is the following (necessary to attained a stationary series): I Deterministic trend: Detrending (Curve-fitting or Filtering) II Stochastic trend: Differentiation
Introduction: Time series with trend I. Deterministc trend
Introduction: Time series with trend
Introduction: Time series with trend
Introduction: Curve fitting method
Introduction: Smoothing methods
Introduction: Smoothing methods
Introduction: Smoothing methods
Introduction: Differencing method II. Stochastic trend
Introduction: Modeling Seasonal variation B. Time series with a seasonal component
Introduction: Modeling Seasonal variation
Introduction: Eliminating seasonal variation
Introduction: Modeling Seasonal variation
Introduction: Stationary vs Non-stationary series Stationarity in Time Series: A key idea in time series is that of stationarity. Roughly speaking, a time series is stationary if its behavior does not change over time. This means, for example, that the values always tend to vary about the same level and that their variability is constant over time. Obviously, not all time series are stationary. Indeed, non-stationary series tend to be the rule rather than the exception. However, some time series are related in simple ways to models which are stationary. Two important examples of this are:
Introduction: Stationary vs Non-stationary series
Introduction: Stationary vs Non-stationary series Are always those models a valid representation of trending time series? Answer: NO! Why might the trend model not be a valid representation? The trend and cyclical components of the time series might not be determined independently of one another. For instance, technology shocks might affect both the cyclical and trend behavior of the series.
Introduction: Stationary vs Non-stationary series What about integrated models? The Integrated model ( or random walk model) has a stochastic trend and may be a good starting point for describing the way many financial market prices and returns seem to behave. However, realizations of random walks will not usually be characterized by the tendency to grow over time that is so apparent in many macroeconomic time series. That is, the stochastic trend in the random walk is not sufficient to explain the kind of trend behavior we observe in the typical macroeconomic time series.
Introduction: Stationary vs Non-stationary series The general pattern of this data does not change over time so it can be regarded as stationary
Introduction: Stationary vs Non-stationary series There is a steady long-term increase in the yields. Over the period of observation a trend-plus-stationary series model looks like it might be appropriate. An integrated stationary series is another possibility (if trend is stochastic instead of deterministic).
Introduction: Stationary vs Non-stationary series There is clearly a strong seasonal effect on top of a general upward trend.
Introduction: Stationary vs Non-stationary series In summary: We know there are differences in the dynamic behavior of times series: the nature of the trend, the long-run behavior, and seasonal and/or components. In fact, there are different approaches to modeling trends in time series. Which process will be a valid representation of a trending time series? and How should we choose? It will not be obvious just by looking at the data. Time series plot helps but it is not enough! Does one or the other seem more plausible based on the economic theory (if there is any) that underlies the econometric model? How to apply formal tests to help select the appropriate form of the model?
Introduction: Stationary vs Non-stationary series Objectives of this course: Description - summary statistics, graphs. Analysis and interpretation - find a model to describe the time dependence in the data, can we interpret the model? Forecasting or prediction - given a sample from the series, forecast the next value, or the next few values
Exercise in R Exercise 1 in R We are going to analyze three time series: 1. Age of Death of Successive Kings of England 2. The number of births per month in New York city, from January 1946 to December 1959 3. The monthly sales for a souvenir shop at a beach resort town in Queensland, Australia, for January 1987-December 1993. Goals: Plot and to do a basic statistical analysis of the series Identify what components are presents in the series Decompose a time series into different components and interpret the results