🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

4 Basics of Time Series.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Transcript

Applied Econometrics Introduction to Time Series Econometrics Lecture Handout 4 Autumn 2023 D.Sc. (Econ.) Elias Oikarinen Professor (Associate) of Economics University of Oulu, Oulu Business School 1 This Handout • Basic information on time series and time series econometrics • What is time serie...

Applied Econometrics Introduction to Time Series Econometrics Lecture Handout 4 Autumn 2023 D.Sc. (Econ.) Elias Oikarinen Professor (Associate) of Economics University of Oulu, Oulu Business School 1 This Handout • Basic information on time series and time series econometrics • What is time series data about • What is ”special” with time series econometrics • Various possible uses of time series econometrics • Key issues and terminology (autocorrelation, stationarity) • Several time series graphs • Time series econometrics is our main topic for the next 3 weeks • Brooks, Chapter 6 (early parts) • Enders, pp. 1-75 POLL 2 What Are Time Series Data about? • Basic idea: Time series data are data collected on the same observational unit at multiple time periods, i.e., observations of a time series are collected as time goes by. • The observations are usually indexed with t, time. • The observations can be, for example, annual, monthly, daily, or intra-daily. • Time series models are often not based on a theoretical economic model. • This is particularly prominent for forecasting models • For example, changes in GDP can affect share prices, but share prices are observed daily (or even intra-daily) and GDP is normally observed quarterly • In a model forecasting daily stock returns, we would not therefore include GDP changes 3 Numerous Economic Fundamentals • Macroeconometrics is generally based on time series data and time series econometrics • There are extensive and long time series data on numerous economic fundamentals, e.g. • GDP • Consumption • Household indebtedness • Inflation and Interest rates, etc. • Real vs. nominal terms? • Natural log transformed or not? • Seasonally adjusted or not? 4 Nominal GDP, Finland • Quarterly over 1975Q1 – 2023Q2 (last observation are preliminary numbers): 194 observations • ”Current prices” = nominal • Seasonally adjusted; GDP movements typically exhibit notable seasonal variation 5 Credit to GDP Ratio for Finland • Private sector credit • Quarterly data for the period 1970Q1 – 2023Q1; 213 obs. 6 Inflation rate (%), Finland • Change in the consumer price index (CPI), 2000Q1 to 2020Q2 • Note: Quarterly changes – annualized inflation  4 x presented values • Note the substantial seasonal variation D_LN_EKI .020 .016 .012 .008 .004 .000 -.004 -.008 00 02 04 06 08 10 12 14 16 18 20 7 Inflation rate, Finland: Seasonally Adjusted • Eviews: Proc – Seasonal Adjustment – Tramo/Seats (UG I, pp. 491-495) Final seasonally adjusted series .012 .008 .004 .000 -.004 -.008 -.012 00 02 04 06 08 10 12 14 16 18 20 8 Inflation rate, Finland: Seasonally Adjusted (monthly, 12/1951-8/2022) 9 Examples of Capital Market Time Series • Financial time series • Financial econometrics is largely based on time series econometrics • Stock market indices and returns, transaction volumes… • Bond yields, etc. • Often high frequency available • Other capital market times series • Housing price indices • Credit supply, etc. • Real vs. nominal terms? • Natural log transformed or not? • Seasonally adjusted or not? 10 Real vs. Nominal Housing Price Indices, Helsinki Metro Area • Natural log form, 1975Q1 to 2020Q2 7.5 7.0 6.5 6.0 5.5 5.0 4.5 4.0 75 80 85 90 95 p_real 00 05 10 15 20 p_nominal 11 S&P 500 Total Return Index • Nominal; 7817 daily observations (11.9.1989 - 11.9.2020) 12 11.9.2019 11.9.2017 11.9.2015 11.9.2013 11.9.2011 11.9.2009 11.9.2007 11.9.2005 11.9.2003 11.9.2001 11.9.1999 11.9.1997 11.9.1995 11.9.1993 11.9.1991 11.9.1989 S&P 500 Total Return Index • Natural log transformed index • Note: Quadratic trend removed 9,5 9 8,5 8 7,5 7 6,5 6 5,5 5 13 19.4.2020 19.4.2019 19.4.2018 19.4.2017 19.4.2016 19.4.2015 19.4.2014 19.4.2013 19.4.2012 19.4.2011 19.4.2010 19.4.2009 19.4.2008 19.4.2007 19.4.2006 19.4.2005 Neste Share Return in Helsinki Stock Exchange • Daily returns, 18.4.2005 to 11.9.2020 0,25 0,2 0,15 0,1 0,05 0 -0,05 -0,1 -0,15 14 Some (Key) Uses of Time Series Data • Forecasting • Estimation of dynamic causal effects, e.g. • If the ECB tightens the monetary policy, what will be the effect on the rates of inflation and unemployment in the Euro area in 3 months? In 12 months? • What is the effect over time on cigarette consumption of a increase in the cigarette tax? • Important for various policy evaluations and recommendations • Modeling risks, e.g. volatility in the stock market • Testing economic theories, e.g. • Whether the efficient market hypothesis / CAPM / APT holds • Whether the purchasing power theory holds in practice • Applications outside of economics include environmental and climate modeling, engineering (system dynamics), computer science (network dynamics),… 15 Time Series Data raises New Technical Issues • Time lags (in e.g. the reaction of one variable to shocks in another variable) • Correlation over time (serial correlation, a.k.a. autocorrelation) • Calculation of standard errors when the errors are serially correlated • Data stationarity and “spurious regression” complications • We consider only consecutive, evenly-spaced observations (missing and unevenly spaced data introduce technical complications) 16 Why Use Natural Logs • Closer to normal distribution • Elasticity interpretation • Removes quadratic trend • When computing mean returns for assets • Log-returns, i.e. changes in natural log return indices, better reflect long-term mean returns 17 Some Terminology 18 Stochastic Process • Time series (series of observations) {y1,…,yT} is generated by some stochastic process, i.e. by some random process: Data-generating process (DGP) • The data that we observe is generated by DGP; we observe a sample based on which we try to model the underlying stochastic process, i.e. the DGP 19 Stationarity • We assume that the time series for which we estimate regressions models are stationary (this assumption will be relaxed later on when we discuss the concept of cointegration) • Basic idea: a stationary time series is independent of the moment in time • The concept of stationarity that we consider and refer to is also called “covariance stationarity” or “weak stationarity” (this concept of stationarity is the one typically referred to in the literature) • POLL: are you familiar with the concept of stationarity / stationary variables 20 Stationarity: Conditions • Formally, a stochastic process is (covariance) stationary if for all t and t − s: • There is no trend in the time series, so its expected value µ is timeinvariant and finite • The (long-run) variance is also time-invariant and finite • The covariance between observations depends only on the length of time between the observations, s, not on the timing of the observation (t); In other words, the autocovariance is the same • Between Monday's and Wednesday's observations as between Tuesday's and Thursday’s observations. • Between quarter 1 and 3 observations as between quarter 2 and 4 observations (and thereby also between q 3 vs. 1 and q 4 vs. 2 observations, of course) 21 Stationary vs. Nonstationary Time Series • Neste share return (POLL) 0,25 0,2 0,15 0,1 0,05 0 -0,05 -0,1 Daily return 20-day rolling volatility (sd.) 19.4.2020 19.4.2019 19.4.2018 19.4.2017 19.4.2016 19.4.2015 19.4.2014 19.4.2013 19.4.2012 19.4.2011 19.4.2010 19.4.2009 19.4.2008 19.4.2007 19.4.2006 19.4.2005 -0,15 22 Stationary vs. Nonstationary Time Series • Neste total return index (which curve is in natural log form?) 5 90 4,5 80 4 70 3,5 60 3 50 2,5 40 2 30 1,5 1 20 0,5 10 18.4.2020 18.4.2019 18.4.2018 18.4.2017 18.4.2016 18.4.2015 18.4.2014 18.4.2013 18.4.2012 18.4.2011 18.4.2010 18.4.2009 18.4.2008 18.4.2007 18.4.2006 0 18.4.2005 0 23 Stationarity • Time series analysis should always begin by verifying whether the time series in question is stationary or non-stationary • Conventional estimation techniques and testing procedures do not generally apply for non-stationary time series! • Time series are often non-stationary in “levels”, e.g.: consumer price index, GDP, share prices, housing prices • “Differenced” variables usually are stationary, e.g.: GDP growth, stock market returns, housing price change… • Stationary time series are called I(0) 24 Difference and Trend Stationary • A common term is also difference stationary: in such a case, yt is non-stationary, but yt = yt – yt-1 is stationary • Such time series yt are called I(1): integrated of order one • There also are variables that need to be differenced twice in order to get stationary series: I(2), integrated of order two • E.g. consumer cost index is often found to be I(2), which means that the change in the index, i.e. inflation rate, is I(1), and the change in the inflation rate is I(0), stationary • Some variables can be trend stationary • Becomes stationary after removing a deterministic trend from it Typical examples are ones coming from the following DGPs / models: Difference stat. : yt =  + yt-1 + ut ,  = constant term, ”drift” Trend stationary: yt =  + t + ut , t = time 25 A. What is a trend? (Stock and Watson slides…) A trend is a persistent, long-term movement or tendency in the data. Trends need not be just a straight line! © Pearson Education Limited 2015 B. Deterministic and stochastic trends • A deterministic trend is a nonrandom function of time (e.g. yt = t, or yt = t2). • A stochastic trend is random and varies over time • An important example of a stochastic trend is a random walk: Yt = Yt–1 + ut, where ut is serially uncorrelated If Yt follows a random walk, then the value of Y tomorrow is the value of Y today, plus an unpredictable disturbance. © Pearson Education Limited 2015 B. Deterministic and stochastic trends Four artificially generated random walks, T = 200: © Pearson Education Limited 2015 B. Deterministic and stochastic trends Two key features of a random walk: (i) YT+h|T = YT – Your best prediction of the value of Y in the future is the value of Y today – To a first approximation, log stock prices follow a random walk (more precisely, stock returns are unpredictable) (ii) Suppose Y0 = 0. Then var(Yt) = t u2 . – This variance depends on t (increases linearly with t), so Yt isn’t stationary (recall the definition of stationarity). © Pearson Education Limited 2015 B. Deterministic and stochastic trends A random walk with drift is Yt = β0 +Yt–1 + ut, where ut is serially uncorrelated The “drift” is β0: If β0 ≠ 0, then Yt follows a random walk around a linear trend. You can see this by considering the hstep ahead forecast: YT+h|T = β0h + YT The random walk model (with or without drift) is a good description of stochastic trends in many economic time series. © Pearson Education Limited 2015 B. Deterministic and stochastic trends Where we are headed is the following practical advice: If Yt has a random walk trend, then ΔYt is stationary and regression analysis should be undertaken using ΔYt instead of Yt. Upcoming specifics that lead to this advice: • Relation between the random walk model and AR(1), AR(2), AR(p) (“unit autoregressive root”) • The Dickey-Fuller test for whether a Yt has a random walk trend © Pearson Education Limited 2015 Trend, Random Walk, Stationarity: An Example • Stock return should be “white noise”, i.e. returns are not predictable (if the efficient market hypothesis holds) yt - yt-1 =  + ut Where yt denotes natural log of stock return index value in period t,  the mean return over time and the error term, ut, is white noise, i.e. unpredictable  No trend, stationary variable (best guess always the mean,  ) • Then return index = random walk with drift yt =  + yt-1 + ut  Stochastic trend  yt is difference stationary, i.e. I(1), non-stationary 32 19.4.2020 19.4.2019 19.4.2018 19.4.2017 19.4.2016 19.4.2015 19.4.2014 19.4.2013 19.4.2012 19.4.2011 19.4.2010 19.4.2009 19.4.2008 19.4.2007 19.4.2006 18.8.2020 18.12.2019 18.4.2019 18.8.2018 18.12.2017 18.4.2017 18.8.2016 18.12.2015 18.4.2015 18.8.2014 18.12.2013 18.4.2013 18.8.2012 18.12.2011 18.4.2011 18.8.2010 18.12.2009 18.4.2009 18.8.2008 18.12.2007 18.4.2007 18.8.2006 18.12.2005 18.4.2005 • Neste share return, and return index (natural logs) 19.4.2005 Trend, Random Walk, Stationarity: An Example 5 4,5 4 3,5 3 2,5 2 1,5 1 0,5 0 0,25 0,2 0,15 0,1 0,05 0 -0,05 -0,1 -0,15 33 Autocorrelation (serial correlation) The correlation of a series with its own lagged values is called autocorrelation or serial correlation.    The first autocovariance of Yt is cov(Yt,Yt–1) The first autocorrelation of Yt is corr(Yt,Yt–1) Thus cov(Yt ,Yt1 ) corr(Yt,Yt–1) = var(Yt ) var(Yt1 )  = ρ1 These are population correlations 34 Autocorrelation 35 Sample Autocorrelations The jth sample autocorrelation is an estimate of the jth population autocorrelation: ˆ j = Where 1 T (Yt  Y j 1,T )(Yt  j  Y1,T  j ) =  T t  j 1 Where Y j1,T is the sample average of Yt computed over observations t = j+1,…,T.   The summation is over t=j+1 to T The divisor is T, not T – j (this is the conventional definition used for time series data) 36 Sample Autocorrelation Function • In the case that j = 0, the autocorrelation at lag zero is obtained, i.e. the correlation of Yt with Yt, which is of course 1 ˆ j against j = 0, 1, 2, . . . , produces a graph known • Plotting  as the autocorrelation function (ACF) • Stationarity of the process is assumed in ACF computation • There is no theoretical ACF for nonstationary series; However, plotting ACF gives information regarding the stationarity of time series • Autocorrelations of non-stationary series decay very slowly • If autocorrelations decay rapidly, the series usually is stationary 37 ACF of Nonstationary Series • Helsinki metro area housing price index (in logs) • Eviews: View – Correlogram • Formal test of autocorrelation: Ljung-Box Q-test (Brooks, pp. 254-255; Enders, p. 68) Null hypothesis: No autocorrelation at the j first lags, e.g., all first 5 autocorrelations are zero • Several other tests also available 38 ACF of Stationary Series • Helsinki metro area housing price index (in logs): first difference (i.e. price change) 39 Stationary or Nonstationary? 40 White Noise • Formal definition of a white noise process: (1) E(yt) =  (2) var(yt) = 2 (3) cov(yt – yt-j) = 0 for all j = 1, 2, 3, … , • Constant mean and variance, and zero autocovariances • Thus, white noise process does not exhibit any patterns: no predictability based on previous observations • Best forecast for yt+1 is always  • In other words: Each observation is uncorrelated with all other values in the sequence • Hence, the autocorrelation function will be zero apart from a single peak of 1 at j = 0. • If additionally μ = 0, the process is known as zero mean white noise – residual series are typically assumed to be like this 41 Share Return – White Noise? • As said, if the efficient market hypothesis holds, share returns (at least excess returns) should be white noise • Neste share return autocorrelation function: POLL 42 Implications of Autocorrelation • Predictability of future values based on previous values • The annualized variance of autocorrelated series depends on the considered time horizon / data frequency • Positive autocorrelation: momentum effect, mean aversion • Negative autocorrelation: mean reversion • An interested student can study more by reading about variance ratio statistics & tests and their implications 43

Tags

economics time series applied econometrics
Use Quizgecko on...
Browser
Browser