Applied time series for macroeconomics

Page 1

Preface and acknowledgements It is quite possible that what looked like a good match to the eye would not seem at all a good match when subjected to strict analysis. [Yule (1926, p. 26)]. Macroeconomics is about answering questions like: What will the inflation rate be the coming quarters? What explains economic cycles where booms are followed by busts? Do output and consumer prices fall if the interest rate is increased? Have all recessions been preceded by an increase in the price of crude oil? The goal of this book is to give an intuitive yet formal understanding of the basic techniques used in applied econometrics to answer questions like these. The focus is on time series econometrics with applications in macroeconomics and international finance. Throughout the book we will cover univariate and multivariate models of stationary and nonstationary time series, including structural vector autoregression (SVAR) models and instrument variable (IV) methods. Much focus is also devoted to the topic of macroeconomic forecasting, using both univariate and multivariate models. The book is designed primarily for use in courses given to master students in econometrics with special emphasis on time series. However, the first parts of the book emphasising univariate methods can be used in courses given to final year undergraduates, while the parts covering forecasting and multivariate models can be used as a supplement to a reference book used in courses given to first year PhD students. We do not intend this book to be a complete reference. For more rigorous treatment of many of the topics discussed we refer the reader to Hamilton (1994) and Lutkepohl (2005). One of the guiding principles of this book is operationality, and we have emphasized ready access to the computer programs used in its preparation. The MATLAB codes, data files and descriptions are available from the website developed for this book: http://home.bi.no/a1010297/timeseries. If the link does not work, please contact one of the authors.


8

PREFACE

AND ACKNOWLEDGEMENTS

The framework of the book grew out of lecture notes developed by Hilde C. Bjørnland for master and PhD courses in applied time series econometrics at the University of Oslo and BI Norwegian Business School. We thank in particular Ida Wolden Bache for contributing actively to the development of these courses at an early stage. Our work has benefited from comments by many friends and colleagues. Our grateful thanks go to Knut Are Aastveit, Drago Bergholt, Eleonora Granziera, Steffen Grønneberg, Anne Sofie Jore and Bjørn Naug for having commented constructively on our work. We would also like to thank Q. Farooq Akram for sharing his data. We owe much to the present and past nowcasting teams of Norges Bank.1 Special thanks to Francesco Ravazzolo, Christie Smith and Shaun Vahey for influencing and shaping our perception of how forecasting should be done. We have also benefited from comments by many students, especially those attending the Master programme at the BI Norwegian Business School. Special thanks to Stefanie Fernandez for comments on an earlier draft and to Stein-Erik Hjørring for invaluable editorial help in the final stage.

Plan of the book Throughout the course of this book we will present the necessary tools to study economic time series. The book is organized as follows. The first part of this book deals with stationary univariate time series. We start by reviewing some of the basic concepts and definitions used in statistical analysis in Chapter 1. In particular we review the concept of random numbers, differences between a population and a sample, and finally the ordinary least squares estimator (OLS). Chapters 2–3 provide us with the necessary tools to describe and forecast stationary time series. Most data in macroeconomics and finance can be described as time series: a set of repeated observations over time of the same variable, such as consumer prices, gross domestic product (GDP), stock prices, exchange rates, etc. Accordingly, to be able to understand macroeconomic fluctuations and financial markets we need to learn about the basic definitions and tools used for univariate time series analysis. An important area of application for time series data and models is forecasting. To be able to predict or forecast the future with a reasonable degree of accuracy is fundamental, as most decisions taken today are based on what we think will happen in the future. We therefore devote much emphasis on macroeconomic forecasting. Following the analysis of stationarity, Chapters 4 and 5 introduce nonstationary time series so that we can analyse the trend in the data and the fluctuations around the trend (i.e., the business cycles). We will present and compare several detrending methods used to extract the business cycle, including the popular band-pass and Hodrick-Prescott filter.

1

The views expressed are those of the authors and do not necessarily reflect those of Norges Bank.


PREFACE

AND ACKNOWLEDGEMENTS

9

The final four chapters in this book deal with multivariate methods to study comovement among variables. Many of the concepts discussed there will be multivariate extensions of the tools and concepts introduced in Chapter 2. However, some are new and relate only to multivariate models, like the discussion of simultaneity and the identification of structural shocks. We start by introducing the concept of simultaneity in Chapter 6 and illustrate the usefulness of instrumental variable (IV) regression for dealing with this problem. In Chapter 7 we introduce vector autoregressive (VAR) models, which is used throughout the final three chapters. We first discuss stability properties and show how one can derive the moving average representation of the VAR. Then we discuss issues related to specification, estimation and forecasting of the VAR, and finally we introduce an important concept called Granger causality. Chapter 8 is the main chapter on vector autoregression techniques where we deal with the simultaneity problem first introduced in Chapter 6. We show how various methods can be used to identify the structural vector autoregressive (SVAR) model, and discuss how one can construct and interpret structural shocks. Key is the study of impulse responses and variance decompositions. Chapter 9 concludes the book with conditions and methods that permit us to work with nonstationary data in a multivariate setting directly. Such conditions are commonly referred to as cointegration.



Contents Preface and acknowledgements 7 Plan of the book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1

2

Introduction 1.1 Random variables - some preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.1 Population moments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.2 Sample moments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.3 A brief review of probability. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Ordinary least squares and assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Monte Carlo simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.1 Bias variance trade-off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Appendices 1.A The bootstrap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

19 19 20 21 24 25 34 37

Time series 2.1 Fundamentals of time series. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 White noise, difference equations and lag operators . . . . . . . . . . . . 2.1.2 Conditional and unconditional moments . . . . . . . . . . . . . . . . . . . . 2.1.3 Stationarity, autocorrelation function and ergodicity . . . . . . . . . . . . 2.1.4 Multipliers and impulse responses . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Moving average (MA) processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.1 Higher order MA processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Autoregressive (AR) processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.1 Higher order AR processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.2 Autoregressive moving average (ARMA) processes . . . . . . . . . . . . 2.4 Estimation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.1 OLS and AR models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.2 Lag selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.3 Structural breaks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5 An example: GDP and inflation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Appendices 2.A Simulating time series data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

41 46 46 50 52 53 54 56 57 62 64 65 65 66 68 68 74

40

75


12 3

4

CONTENTS

Forecasting 3.1 Forecasting with autoregressive processes . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1 Point forecast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2 Optimal mean squared error prediction . . . . . . . . . . . . . . . . . . . . 3.1.3 Uncertainty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Forecast evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Bias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Root mean squared error (RMSE) . . . . . . . . . . . . . . . . . . . . . . . . 3.2.3 Comparing different forecasts . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Forecasting experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Model combination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.1 Linear opinion pool and weights . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.2 Diversification gains in theory. . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.3 Diversification gains in practice . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Forecasting with other time series models . . . . . . . . . . . . . . . . . . . . . . . 3.6 An example: Forecasting Norwegian GDP growth . . . . . . . . . . . . . . . . . 3.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Appendices 3.A Density forecasting and evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.A.1 Evaluating density forecasts . . . . . . . . . . . . . . . . . . . . . . . . . . . .

77 78 79 80 82 85 86 86 89 90 93 94 94 97 101 102 105

Nonstationarity 4.1 Deterministic trends. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Stochastic trends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.1 Random walk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.2 Random walk with drift . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Implications of nonstationarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Tests for unit root . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.1 Augmented Dickey-Fuller (ADF) test . . . . . . . . . . . . . . . . . . . . . 4.4.2 Unit root versus structural break . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.3 KPSS test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5 Persistence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

109 111 112 112 114 115 116 116 120 121 122 123

106 106


CONTENTS

5

6

7

13

Trend and Cycles 5.1 Statistical detrending methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Deterministic trend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 Linear filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1 Hodrick-Prescott (HP) filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.2 Band pass filters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4 Beveridge-Nelson (BN) Decomposition . . . . . . . . . . . . . . . . . . . . . . . . . 5.5 An example: Stylized facts of business cycles . . . . . . . . . . . . . . . . . . . . 5.6 Spurious cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Appendices 5.A Spectral analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.A.1 Linear filters - Implications. . . . . . . . . . . . . . . . . . . . . . . . . . . . .

125 128 128 130 131 133 136 140 144 146

Simultaneity 6.1 Simultaneous equation bias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Instrumental variable regression (IV) . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.1 Instrumental variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.2 Instrumental variables estimation. . . . . . . . . . . . . . . . . . . . . . . . . 6.3 Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.4 An example: Return to education . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Appendices 6.A The general IV regression model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

155 156 159 159 163 165 168 170

Vector autoregression (VAR) 7.1 The VAR model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.1 The companion form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.2 Stability of VARs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.3 Wold representation/decomposition theorem . . . . . . . . . . . . . . . . 7.2 Moving average representation of a VAR . . . . . . . . . . . . . . . . . . . . . . . . 7.3 Estimating a VAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.3.1 Choice of variables and lags . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.3.2 An example: A VAR model for GDP and unemployment . . . . . . . 7.4 VAR forecasts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.4.1 Point forecast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.4.2 MSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.4.3 Uncertainty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.4.4 Forecast failure in macroeconomics. . . . . . . . . . . . . . . . . . . . . . . 7.5 Granger causality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Appendices 7.A Short introduction to linear algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . .

175 176 177 178 179 180 185 186 187 189 189 190 191 192 192 195

147 152

171

196


14

CONTENTS

8

Structural vector autoregression (SVAR) 8.1 Identification – Cholesky decomposition . . . . . . . . . . . . . . . . . . . . . . . . 8.2 A structural VAR model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.1 From structural to reduced form VAR . . . . . . . . . . . . . . . . . . . . . 8.2.2 Identification of the structural model. . . . . . . . . . . . . . . . . . . . . . 8.3 The impulse response function (IRF) . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3.1 Forecast error variance decomposition . . . . . . . . . . . . . . . . . . . . . 8.4 Two empirical examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.4.1 Effects of monetary policy shocks. . . . . . . . . . . . . . . . . . . . . . . . 8.4.2 Effects of oil price shocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.5 Alternative restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.5.1 Long-run restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.5.2 A special case of long-run restrictions. . . . . . . . . . . . . . . . . . . . . 8.5.3 Sign restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.6 An example: The exchange rate puzzle revisited. . . . . . . . . . . . . . . . . . . 8.7 Limitation of the VAR approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

199 201 203 204 205 208 211 213 213 218 220 221 224 225 227 231 233

9

Cointegration 9.1 Spurious regressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2 Cointegration defined. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.3 Testing for cointegration – single equation . . . . . . . . . . . . . . . . . . . . . . . 9.3.1 Engle-Granger approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.3.2 An example: Consumption and income . . . . . . . . . . . . . . . . . . . . 9.4 Error Correction Model (ECM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5 Cointegration in a multivariate setting . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5.1 Vector error correction model (VECM) . . . . . . . . . . . . . . . . . . . . 9.5.2 Testing for cointegration – the Johansen approach . . . . . . . . . . . . 9.5.3 Identification of the cointegrating relations . . . . . . . . . . . . . . . . . 9.5.4 Cointegration and common trends . . . . . . . . . . . . . . . . . . . . . . . . 9.5.5 Weak exogeneity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.6 An example: Purchasing power parity (PPP). . . . . . . . . . . . . . . . . . . . . . 9.7 Final comments: VAR in levels or differences . . . . . . . . . . . . . . . . . . . . 9.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

235 236 240 241 241 243 245 248 249 251 252 254 255 255 259 261

Index

263

Bibliography

267


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.