You are on page 1of 221

Time-Series Econometrics

A Concise Course

Francis X. Diebold
University of Pennsylvania

Edition 2016
Version 2016.02.15
Time Series Econometrics
Time Series Econometrics
A Concise Course

Francis X. Diebold
Copyright
c 2013-2016, by Francis X. Diebold.
All rights reserved.

This work is freely available for your use, but be warned: it is highly preliminary, significantly
incomplete, and rapidly evolving. It is licensed under the Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License. (Briefly: I retain copyright, but
you can use, copy and distribute non-commercially, so long as you give me attribution and do
not modify. To view a copy of the license, visit http://creativecommons.org/licenses/by-nc-
nd/4.0/.) In return I ask that you please cite the book whenever appropriate, as: Diebold,
F.X. (2016), Time Series Econometrics, Department of Economics, University of Pennsyl-
vania, http://www.ssc.upenn.edu/ fdiebold/Textbooks.html.
To Marc Nerlove,
who taught me time series,

and to my wonderful Ph.D. students,


his grandstudents
Brief Table of Contents

About the Author xv

About the Cover xvi

Guide to e-Features xvii

Acknowledgments xviii

Preface xxii

Chapter 1. Introduction 1

Chapter 2. The Wold Representation and its Approximation 5

Chapter 3. Spectral Analysis 25

Chapter 4. Markovian Structure, Linear Gaussian State Space, and Optimal (Kalman) Filtering 48

Chapter 5. Frequentist Time-Series Likelihood Evaluation, Optimization, and Inference 80

Chapter 6. Simulation for Economic Theory, Econometric Theory, Estimation, Inference, and
Optimization 92

Chapter 7. Bayesian Time Series Posterior Analysis by Markov Chain Monte Carlo 115

Chapter 8. Non-Stationarity: Integration, Cointegration and Long Memory 125

Chapter 9. Non-Linear Non-Gaussian State Space and Optimal Filtering 135

Chapter 10. Volatility Dynamics 142

Chapter 11. High Dimensionality 182

Appendices 183

Appendix A. Nonparametrics 184

Appendix B. A Library of Useful Books 193


Detailed Table of Contents

About the Author xv

About the Cover xvi

Guide to e-Features xvii

Acknowledgments xviii

Preface xxii

Chapter 1. Introduction 1
1.1 Economic Time Series and Their Analysis 1
1.2 A Practical Toolkit 1
1.2.1 Software (and a Tiny bit of Hardware) 1
1.2.2 Data 2
1.2.3 Markup 3
1.2.4 Version Control 3
1.3 Exercises, Problems and Complements 3
1.4 Notes 4

Chapter 2. The Wold Representation and its Approximation 5


2.1 The Environment 5
2.2 White Noise 6
2.3 The Wold Decomposition and the General Linear Process 7
2.4 Approximating the Wold Representation 9
2.4.1 The M A(q) Process 9
2.4.2 The AR(p) Process 9
2.4.3 The ARM A(p, q) Process 9
2.5 Wiener-Kolmogorov-Wold Extraction and Prediction 9
2.5.1 Extraction 9
2.5.2 Prediction 9
2.6 Multivariate 10
2.6.1 The Environment 10
2.6.2 The Multivariate General Linear Process 11
2.6.3 Vector Autoregressions 12
2.7 A Small Empirical Toolkit 18
2.7.1 Nonparametric: Sample Autocovariances 18
2.7.2 Parametric: ARM A Model Selection, Fitting and Diagnostics 18
2.8 Exercises, Problems and Complements 20
2.9 Notes 23

Chapter 3. Spectral Analysis 25


xii DETAILED TABLE OF CONTENTS

3.1 The Many Uses of Spectral Analysis 25


3.2 The Spectrum and its Properties 25
3.3 Rational Spectra 28
3.4 Multivariate 29
3.5 Filter Analysis and Design 32
3.6 Estimating Spectra 36
3.6.1 Univariate 36
3.6.2 Multivariate 38
3.7 Exercises, Problems and Complements 38
3.8 Notes 47

Chapter 4. Markovian Structure, Linear Gaussian State Space, and Optimal (Kalman) Filtering 48
4.1 Markovian Structure 48
4.1.1 The Homogeneous Discrete-State Discrete-Time Markov Process 48
4.1.2 Multi-Step Transitions: Chapman-Kolmogorov 48
4.1.3 Lots of Definitions (and a Key Theorem) 49
4.1.4 A Simple Two-State Example 50
4.1.5 Constructing Markov Processes with Useful Steady-State Distributions 51
4.1.6 Variations and Extensions: Regime-Switching and More 52
4.1.7 Continuous-State Markov Processes 53
4.2 State Space Representations 54
4.2.1 The Basic Framework 54
4.2.2 ARMA Models 56
4.2.3 Linear Regression with Time-Varying Parameters and More 61
4.2.4 Dynamic Factor Models and Cointegration 63
4.2.5 Unobserved-Components Models 64
4.3 The Kalman Filter and Smoother 65
4.3.1 Statement(s) of the Kalman Filter 66
4.3.2 Derivation of the Kalman Filter 67
4.3.3 Calculating P0 70
4.3.4 Predicting yt 70
4.3.5 Steady State and the Innovations Representation 71
4.3.6 Kalman Smoothing 73
4.4 Exercises, Problems and Complements 73
4.5 Notes 79

Chapter 5. Frequentist Time-Series Likelihood Evaluation, Optimization, and Inference 80


5.1 Likelihood Evaluation: Prediction-Error Decomposition and the Kalman Filter 80
5.2 Gradient-Based Likelihood Maximization: Newton and Quasi-Newton Methods 81
5.2.1 The Generic Gradient-Based Algorithm 81
5.2.2 Newton Algorithm 82
5.2.3 Quasi-Newton Algirithms 83
5.2.4 Line-Search vs. Trust Region Methods: Levenberg-Marquardt 83
5.3 Gradient-Free Likelihood Maximization: EM 84
5.3.1 Not-Quite-Right EM
(But it Captures and Conveys the Intuition) 85
5.3.2 Precisely Right EM 85
5.4 Likelihood Inference 87
5.4.1 Under Correct Specification 87
5.4.2 Under Possible Mispecification 88
5.5 Exercises, Problems and Complements 90
5.6 Notes 91
DETAILED TABLE OF CONTENTS xiii

Chapter 6. Simulation for Economic Theory, Econometric Theory, Estimation, Inference, and
Optimization 92
6.1 Generating U(0,1) Deviates 92
6.2 The Basics: c.d.f. Inversion, Box-Mueller, Simple Accept-Reject 94
6.2.1 Inverse c.d.f. 94
6.2.2 Box-Muller 95
6.2.3 Simple Accept-Reject 95
6.3 Simulating Exact and Approximate Realizations of Time Series Processes 97
6.4 more 97
6.5 Economic Theory by Simulation: Calibration 97
6.6 Econometric Theory by Simulation: Monte Carlo and Variance Reduction 97
6.6.1 Experimental Design 98
6.6.2 Simulation 99
6.6.3 Variance Reduction: Importance Sampling, Antithetics, Control Variates
and Common Random Numbers 100
6.6.4 Response Surfaces 105
6.7 Estimation by Simulation: GMM, SMM and Indirect Inference 106
6.7.1 GMM 106
6.7.2 Simulated Method of Moments (SMM) 106
6.7.3 Indirect Inference 107
6.8 Inference by Simulation: Bootstrap 108
6.8.1 i.i.d. Environments 108
6.8.2 Time-Series Environments 110
6.9 Optimization by Simulation 112
6.9.1 Local 112
6.9.2 Global 112
6.9.3 Is a Local Optimum Global? 113
6.10 Interval and Density Forecasting by Simulation 114
6.11 Exercises, Problems and Complements 114
6.12 Notes 114

Chapter 7. Bayesian Time Series Posterior Analysis by Markov Chain Monte Carlo 115
7.1 Bayesian Basics 115
7.2 Comparative Aspects of Bayesian and Frequentist Paradigms 115
7.3 Markov Chain Monte Carlo 117
7.3.1 Metropolis-Hastings Independence Chain 117
7.3.2 Metropolis-Hastings Random Walk Chain 117
7.3.3 More 117
7.3.4 Gibbs and Metropolis-Within-Gibbs 118
7.4 Conjugate Bayesian Analysis of Linear Regression 119
7.5 Gibbs for Sampling Marginal Posteriors 121
7.6 General State Space: Carter-Kohn Multi-Move Gibbs 121
7.7 Exercises, Problems and Complements 124
7.8 Notes 124

Chapter 8. Non-Stationarity: Integration, Cointegration and Long Memory 125


8.1 Random Walks as the I(1) Building Block: The Beveridge-Nelson Decomposition 125
8.2 Stochastic vs. Deterministic Trend 126
8.3 Unit Root Distributions 127
8.4 Univariate and Multivariate Augmented Dickey-Fuller Representations 128
8.5 Spurious Regression 129
8.6 Cointegration, Error-Correction and Grangers Representation Theorem 129
8.7 Fractional Integration and Long Memory 133
xiv DETAILED TABLE OF CONTENTS

8.7.1 Characterizing Integration Status 133


8.8 Exercises, Problems and Complements 133
8.9 Notes 134

Chapter 9. Non-Linear Non-Gaussian State Space and Optimal Filtering 135


9.1 Varieties of Non-Linear Non-Gaussian Models 135
9.2 Markov Chains to the Rescue (Again): The Particle Filter 135
9.3 Particle Filtering for Estimation: Doucets Theorem 135
9.4 Key Application I: Stochastic Volatility (Revisited) 135
9.5 Key Application II: Credit-Risk and the Default Option 135
9.6 Key Application III: Dynamic Stochastic General Equilibrium (DSGE) Macroe-
conomic Models 135
9.7 A Partial Solution: The Extended Kalman Filter 135

Chapter 10. Volatility Dynamics 142


10.1 Volatility and Financial Econometrics 142
10.2 GARCH 142
10.3 Stochastic Volatility 142
10.4 Observation-Driven vs. Parameter-Driven Processes 142
10.5 Exercises, Problems and Complements 181
10.6 Notes 181

Chapter 11. High Dimensionality 182


11.1 Exercises, Problems and Complements 182
11.2 Notes 182

Appendices 183

Appendix A. Nonparametrics 184


A.1 Density Estimation 184
A.1.1The Basic Problem 184
A.1.2Kernel Density Estimation 184
A.1.3Bias-Variance Tradeoffs 185
A.1.4Optimal Bandwidth Choice 186
A.2 Multivariate 187
A.3 Functional Estimation 189
A.4 Local Nonparametric Regression 189
A.4.1Kernel Regression 189
A.4.2Nearest-Neighbor Regression 190
A.5 Global Nonparametric Regression 191
A.5.1Series (Sieve, Projection, ...) 191
A.5.2Neural Networks 191
A.6 Time Series Aspects 191
A.7 Exercises, Problems and Complements 192
A.8 Notes 192

Appendix B. A Library of Useful Books 193


About the Author

Francis X. Diebold is Paul F. and Warren S. Miller Professor of Economics, and Professor
of Finance and Statistics, at the University of Pennsylvania, as well as Faculty Research As-
sociate at the National Bureau of Economic Research in Cambridge, Mass. He has published
widely in econometrics, forecasting, finance and macroeconomics, and he has served on the
editorial boards of numerous scholarly journals. He is an elected Fellow of the Econometric
Society, the American Statistical Association, and the International Institute of Forecasters;
the recipient of Sloan, Guggenheim, and Humboldt fellowships; and past President of the
Society for Financial Econometrics. Diebold lectures actively, worldwide, and has received
several prizes for outstanding teaching. He has held visiting appointments in Economics and
Finance at Princeton University, Cambridge University, the University of Chicago, the Lon-
don School of Economics, Johns Hopkins University, and New York University. His research
and teaching are firmly rooted in applications; he has served as an economist under Paul
Volcker and Alan Greenspan at the Board of Governors of the Federal Reserve System in
Washington DC, an Executive Director at Morgan Stanley Investment Management, Co-
Director of the Wharton Financial Institutions Center, and Chairman of the Federal Reserve
Systems Model Validation Council. All his degrees are from the University of Pennsylvania;
he received his B.S. from the Wharton School in 1981 and his economics Ph.D. in in 1986.
He is married with three children and lives in suburban Philadelphia.
About the Cover

The colorful graphic is by Peter Mills and was obtained from Wikimedia Commons. As
noted there, it represents the basins of attraction of the Gaspard-Rice scattering system
projected onto a double impact parameter (whatever that means). I used it mainly because
I like it, but also because its reminiscent of a trending time series.

For details see http://commons.wikimedia.org/wiki/File%3AGR_Basins2.tiff. The


complete attribution is: By Peter Mills (Own work) [CC-BY-SA-3.0 (http://creativecommons.
org/licenses/by-sa/3.0)], via Wikimedia Commons)
Guide to e-Features

Hyperlinks to internal items (table of contents, index, footnotes, etc.) appear in red.
Hyperlinks to bibliographic references appear in green.

Hyperlinks to the web appear in cyan.


Hyperlinks to external files (e.g., video) appear in blue.
Many images are clickable to reach related material.

Additional related materials are at http://www.ssc.upenn.edu/~fdiebold, includ-


ing book updates, presentation slides, datasets, and code.
Facebook group: Diebold Time Series Econometrics
Related blog (No Hesitations): fxdiebold.blogspot.com
Acknowledgments

All media (images, audio, video, ...) were either produced by me or obtained from the
public domain repository at Wikimedia Commons.
List of Figures

1.1 The R Homepage 2


1.2 Resources for Economists Web Page 3

3.1 Grangers Typical Spectral Shape of an Economic Variable 29


3.2 Gain of Differencing Filter 1 L 33
3.3 Gain of Kuznets Filter 1 34
3.4 Gain of Kuznets Filter 2 34
3.5 Composite Gain of Kuznets two Filters 35

6.1 Ripleys Horror Plots of pairs of (Ui+1 , Ui ) for Various Congruential


Generators Modulo 2048 (from Ripley, 1987) 93
6.2 Transforming from U(0,1) to f (from Davidson and MacKinnon, 1993) 94
6.3 Naive Accept-Reject Method 96

10.1 Time Series of Daily NYSE Returns 143


10.2 Correlogram of Daily NYSE Returns. 144
10.3 Histogram and Statistics for Daily NYSE Returns. 144
10.4 Time Series of Daily Squared NYSE Returns. 145
10.5 Correlogram of Daily Squared NYSE Returns. 145
10.6 True Exceedance Probabilities of Nominal 1% HS-V aR When Volatility
is Persistent. We simulate returns from a realistically-calibrated dynamic volatility
model, after which we compute 1-day 1% HS-V aR using a rolling window of 500 ob-
servations. We plot the daily series of true conditional exceedance probabilities, which
we infer from the model. For visual reference we include a horizontal line at the desired
1% probability level. 148
10.7 GARCH(1,1) Estimation, Daily NYSE Returns. 154
10.8 Correlogram of Squared Standardized GARCH(1,1) Residuals, Daily NYSE
Returns. 155
10.9 Estimated Conditional Standard Deviation, Daily NYSE Returns. 155
10.10Conditional Standard Deviation, History and Forecast, Daily NYSE Re-
turns. 155
10.11AR(1) Returns with Threshold t-GARCH(1,1)-in Mean. 156
10.12S&P500 Daily Returns and Volatilities (Percent). The top panel shows daily
S&P500 returns, and the bottom panel shows daily S&P500 realized volatility. We
compute realized volatility as the square root of AvgRV , where AvgRV is the average
of five daily RVs each computed from 5-minute squared returns on a 1-minute grid of
S&P500 futures prices. 157
xx LIST OF FIGURES

10.13S&P500: QQ Plots for Realized Volatility and Log Realized Volatility.


The top panel plots the quantiles of daily realized volatility against the corresponding
normal quantiles. The bottom panel plots the quantiles of the natural logarithm of daily
realized volatility against the corresponding normal quantiles. We compute realized
volatility as the square root of AvgRV , where AvgRV is the average of five daily RVs
each computed from 5-minute squared returns on a 1-minute grid of S&P500 futures
prices. 158
10.14S&P500: Sample Autocorrelations of Daily Realized Variance and Daily
Return. The top panel shows realized variance autocorrelations, and the bottom panel
shows return autocorrelations, for displacements from 1 through 250 days. Horizontal
lines denote 95% Bartlett bands. Realized variance is AvgRV , the average of five daily
RVs each computed from 5-minute squared returns on a 1-minute grid of S&P500
futures prices. 159
10.15Time-Varying International Equity Correlations. The figure shows the esti-
mated equicorrelations from a DECO model for the aggregate equity index returns for
16 different developed markets from 1973 through 2009. 163
10.16QQ Plot of S&P500 Returns. We show quantiles of daily S&P500 returns from
January 2, 1990 to December 31, 2010, against the corresponding quantiles from a
standard normal distribution. 165
10.17QQ Plot of S&P500 Returns Standardized by NGARCH Volatilities. We
show quantiles of daily S&P500 returns standardized by the dynamic volatility from a
NGARCH model against the corresponding quantiles of a standard normal distribution.
The sample period is January 2, 1990 through December 31, 2010. The units on each
axis are standard deviations. 166
10.18QQ Plot of S&P500 Returns Standardized by Realized Volatilities. We show
quantiles of daily S&P500 returns standardized by AvgRV against the corresponding
quantiles of a standard normal distribution. The sample period is January 2, 1990
through December 31, 2010. The units on each axis are standard deviations. 167
10.19Average Threshold Correlations for Sixteen Developed Equity Markets.
The solid line shows the average empirical threshold correlation for GARCH residuals
across sixteen developed equity markets. The dashed line shows the threshold correla-
tions implied by a multivariate standard normal distribution with constant correlation.
The line with square markers shows the threshold correlations from a DECO model
estimated on the GARCH residuals from the 16 equity markets. The figure is based on
weekly returns from 1973 to 2009. 170
10.20Simulated data, = 0.5 177
10.21Simulated data, = 0.9 177
10.22Simulated data 180

A.1 Bandwidth Choice from Silverman (1986) 186


List of Tables

10.1 Stock Return Volatility During Recessions. Aggregate stock-return volatility


is quarterly realized standard deviation based on daily return data. Firm-level stock-
return volatility is the cross-sectional inter-quartile range of quarterly returns. 171
10.2 Real Growth Volatility During Recessions. Aggregate real-growth volatility is
quarterly conditional standard deviation. Firm-level real-growth volatility is the cross-
sectional inter-quartile range of quarterly real sales growth. 171
Preface

Time Series Econometrics (TSE ) provides a modern and concise masters or Ph.D.-level
course in econometric time series. It can be covered realistically in one semester, and I
have used it successfully for many years with first-year Ph.D. students at the University of
Pennsylvania.
The elephant in the room is of course Hamiltons Time Series Analysis. TSE complements
Hamilton in three key ways.
First, TSE is concise rather than exhaustive. (Nevertheless it maintains good breadth
of coverage, treating everything from the classic early framework of Wold, Wiener, and
Kolmogorov, through to cutting-edge Bayesian MCMC analysis of non-linear non-Gaussian
state space models with the particle filter.) Hamiltons book can be used for more extensive
background reading for those topics that overlap.
Second and crucially, however, many of the topics in TSE and Hamilton do not overlap,
as TSE treats a variety of more recently-emphasized ideas. It stresses Markovian structure
throughout, from linear state space, to MCMC, to optimization, to non-linear state space
and particle filtering. Simulation and Bayes feature prominently, as do nonparametrics,
realized volatility, and more.
Finally, TSE is generally e-aware, with numerous hyperlinks to internal items, web sites,
code, research papers, books, databases, blogs, etc.)

Francis X. Diebold
Philadelphia

Monday 15th February, 2016


Time Series Econometrics
Chapter One

Introduction

1.1 ECONOMIC TIME SERIES AND THEIR ANALYSIS

Any series of observations ordered along a single dimension, such as time, may be thought
of as a time series. The emphasis in time series analysis is the study of dependence among
the observations at different points in time.1
Many economic and financial variables, such as prices, sales, stocks, GDP and its com-
ponents, stock returns, interest rates and foreign exchange rates, are observed over time;
in addition to being interested in the interrelationships among such variables, we are also
concerned with relationships among the current and past values of one or more of them,
that is, relationships over time.
At its broadest level, time series analysis provides the language for of stochastic dy-
namics. Hence its the language of even pure dynamic economic theory, quite apart from
empirical analysis. It is, however, a great workhorse of empirical analysis, in pre-theory
mode (non-structurally getting the facts straight before theorizing, always a good idea),
in post-theory mode (structural estimation and inference), and in forecasting (whether
non-structural of structural).
Empirically, the analysis of economic time series is central to a wide range of applica-
tions, including business cycle measurement, financial risk management, policy analysis,
and forecasting. Special features of interest in economic time series include trends and non-
stationarity, seasonality, cycles and persistence, predictability (or lack thereof), structural
change, and nonlinearities such as volatility fluctuations and regime switching.

1.2 A PRACTICAL TOOLKIT

1.2.1 Software (and a Tiny bit of Hardware)

Lets proceed from highest level to lowest level.


Eviews is a good high-level environment for economic time-seres analysis. Its a modern
object-oriented environment with extensive time series, modeling and forecasting capabili-
ties. It implements almost all of the methods described in this book, and many more.

1 Indeed what distinguishes time series analysis from general multivariate analysis is precisely the temporal

order imposed on the observations.


2 CHAPTER 1

Figure 1.1: The R Homepage

Eviews, however, can sometimes be something of a black box. Hence youll also want
to have available slightly lower-level (mid-level) environments in which you can quickly
program, evaluate and apply new tools and techniques. R is one very powerful and popular
such environment, with special strengths in modern statistical methods and graphical data
analysis.2 R is available for free as part of a massive and highly-successful open-source
project. RStudio provides a fine R working environment, and, like R, its free. A good R
tutorial, first given on Coursera and then moved to YouTube, is here. R-bloggers is a massive
blog with all sorts of information about all things R.
If you need real speed, such as for large simulations, you will likely need a low-level
environment like Fortran or C++. And in the limit (and on the hardware side), if you
need blazing-fast parallel computing for massive simulations etc., graphics cards (graphical
processing units, or GPUs) provide stunning gains, as documented for example in Aldrich
et al. (2011). Actually the real limit is quantum computing, but were not there yet.
For a compendium of econometric and statistical software, see the software links site,
maintained by Marius Ooms at the Econometrics Journal.

1.2.2 Data

Here we mention just a few key must-know sites. Resources for Economists, maintained
by the American Economic Association, is a fine portal to almost anything of interest to
economists. It contains hundreds of links to data sources, journals, professional organiza-
tions, and so on. FRED (Federal Reserve Economic Data) is a tremendously convenient
source for economic data. The National Bureau of Economic Research site has data on U.S.
business cycles, and the Real-Time Data Research Center at the Federal Reserve Bank of

2 Python and Julia are other interesting mid-level environments.


INTRODUCTION 3

Figure 1.2: Resources for Economists Web Page

Philadelphia has real-time vintage macroeconomic data. Quandl is an interesting newcomer


with striking breadth of coverage; it seems to have every time series in existence, and it has
a nice R interface.

1.2.3 Markup

Markup languages effectively provide typesetting or word processing. HTML is the most
well-known example. Research papers and books are typically written in LaTeX. MiCTeX
is a good and popular flavor of LaTeX, and TeXworks is a good editor designed for LaTeX.
knitr is an R package, but its worth mentioning separately, as it powerfully integrates R
and LaTeX./footnoteYou can access everything in RStudio.
Another markup language worth mentioning is Sphinx, which runs under Python. The
Stachurchski-Sargent e-book Quantitative Economics, which features Python prominently,
is written in Sphinx.

1.2.4 Version Control

Git and GitHub are useful for open/collaborative development and version control. For
my sorts of small-group projects I find that Dropbox or equivalent keeps me adequately
synchronized, but for serious large-scale development, use of git or equivalent appears crucial.

1.3 EXERCISES, PROBLEMS AND COMPLEMENTS

1. Approaches and issues in economic time series analysis.


4 CHAPTER 1

Consider the following point/counterpoint items. In each case, which do you think
would be more useful for analysis of economic time series? Why?

Continuous / discrete
linear / nonlinear
deterministic / stochastic
univariate / multivariate
time domain / frequency domain
conditional mean / conditional variance
trend / seasonal / cycle / noise
ordered in time / ordered in space
stock / flow
stationary / nonstationary
aggregate / disaggregate
Gaussian / non-Gaussian

2. Nobel prizes for work involving time series analysis.


Go to the economics Nobel Prize web site. Read about Economics Nobel Prize win-
ners Frisch, Tinbergen, Kuznets, Tobin, Klein, Modigliani, Friedman, Lucas, Engle,
Granger, Prescott, Sargent, Sims, Fama, Shiller, and Hansen. Each made extensive
contributions to, or extensive use of, time series analysis. Other econometricians and
empirical economists winning the Prize include Leontief, Heckman, McFadden, Koop-
mans, Stone, Modigliani, and Haavelmo.

1.4 NOTES

The study of time series of, for example, astronomical observations predates recorded
history. Early writers on economic subjects occasionally made explicit reference to
astronomy as the source of their ideas. For example, Cournot stressed that, as in as-
tronomy, it is necessary to recognize secular variation that is independent of periodic
variation. Similarly, Jevons made clear his approach to the study of short-term fluc-
tuations used the methods of astronomy and meteorology. During the 19th century
interest in, and analysis of, social and economic time series evolved into a new field of
study independent of developments in astronomy and meteorology. Time-series anal-
ysis then flourished. Nerlove et al. (1979) provides a brief history of the fields early
development.

For references old and new, see the library of useful books in Appendix B.
Chapter Two

The Wold Representation and its Approximation

2.1 THE ENVIRONMENT

Time series Yt (doubly infinite)

Realization yt (again doubly infinite)

Sample path yt , t = 1, ..., T

Strict Stationarity

Joint cdfs for sets of observations


depend only on displacement, not time.

Weak Stationarity

(Second-order stationarity, wide sense stationarity,


covariance stationarity, ...)

Eyt = , t

(t, ) = E(yt Eyt ) (yt+ Eyt+ ) = ( ), t

0 < (0) <

Autocovariance Function

(a) symmetric
( ) = ( ),

(b) nonnegative definite


a0 a 0, a
where Toeplitz matrix has ij -th element (i j)

(c) bounded by the variance


(0) |( )|,
6 CHAPTER 2

Autocovariance Generating Function


X
g(z) = ( ) z
=

Autocorrelation Function

( )
( ) =
(0)

2.2 WHITE NOISE

White noise: t W N (, 2 ) (serially uncorrelated)

Zero-mean white noise: t W N (0, 2 )

iid
Independent (strong) white noise: t (0, 2 )

iid
Gaussian white noise: t N (0, 2 )

Unconditional Moment Structure of Strong White Noise

E(t ) = 0

var(t ) = 2
Conditional Moment Structure of Strong White Noise

E(t |t1 ) = 0

var(t |t1 ) = E[(t E(t |t1 ))2 |t1 ] = 2

where

t1 = t1 , t2 , ...
THE WOLD REPRESENTATION 7

Autocorrelation Structure of Strong White Noise

(
2 , = 0
( ) =
0, 1

(
1, = 0
( ) =
0, 1

An Aside on Treatment of the Mean

In theoretical work we assume a zero mean, = 0.

This reduces notational clutter and is without loss of generality.

(Think of yt as having been centered around its mean, ,


and note that yt has zero mean by construction.)

(In empirical work we allow explicitly for a non-zero mean,


either by centering the data around the sample mean
or by including an intercept.)

2.3 THE WOLD DECOMPOSITION AND THE GENERAL LINEAR PRO-


CESS

Under regularity conditions,


every covariance-stationary process {yt } can be written as:

X
yt = bi ti
i=0

where:

b0 = 1


X
b2i <
i=0

t = [yt P (yt |yt1 , yt2 , ...)] W N (0, 2 )

The General Linear Process


8 CHAPTER 2


X
yt = B(L)t = bi ti
i=0

t W N (0, 2 )

b0 = 1


X
b2i <
i=0

Unconditional Moment Structure of the LRCSSP


!
X X X
E(yt ) = E bi ti = bi Eti = bi 0 = 0
i=0 i=0 i=0


!
X X X
var(yt ) = var bi ti = b2i var(ti ) = 2 b2i
i=0 i=0 i=0

Conditional Moment Structure

E(yt |t1 ) = E(t |t1 ) + b1 E(t1 |t1 ) + b2 E(t2 |t1 ) + ...

(t1 = t1 , t2 , ...)


X
= 0 + b1 t1 + b2 t2 + ... = bi ti
i=1

var(yt |t1 ) = E[(yt E(yt |t1 ))2 |t1 ]

= E(2t |t1 ) = E(2t ) = 2

(These calculations assume strong WN innovations. Why?)

Autocovariance Structure
THE WOLD REPRESENTATION 9


" ! !#
X X
( ) = E bi ti bh t h
i= h=


X
= 2 bi bi
i=

(where bi 0 if i < 0)

g(z) = 2 B(z) B(z 1 )

2.4 APPROXIMATING THE WOLD REPRESENTATION

2.4.1 The M A(q) Process

(Obvious truncation)
Unconditional moment structure, conditional moment structure, autocovariance func-
tions, stationarity and invertibility conditions

2.4.2 The AR(p) Process

(Stochastic difference equation)


Unconditional moment structure, conditional moment structure, autocovariance func-
tions, stationarity and invertibility conditions

2.4.3 The ARM A(p, q) Process

Rational B(L), later rational spectrum, and links to state space.


Unconditional moment structure, conditional moment structure, autocovariance func-
tions, stationarity and invertibility conditions

2.5 WIENER-KOLMOGOROV-WOLD EXTRACTION AND PREDICTION

2.5.1 Extraction

2.5.2 Prediction

yt = t + b1 t1 + ...

yT +h = T +h + b1 T +h1 + ... + bh T + bh+1 T 1 + ...

Project on T = {T , T 1 , ...} to get:


10 CHAPTER 2

yT +h,T = bh T + bh+1 T 1 + ...

Note that the projection is on the infinite past

Prediction Error
h1
X
eT +h,T = yT +h yT +h,T = bi T +hi
i=0

(An M A(h 1) process!)

E(eT +h,T ) = 0

h1
X
var(eT +h,T ) = 2 b2i
i=0

Wolds Chain Rule for Autoregressions

Consider an AR(1) process:


yt = yt1 + t

History:
{yt }Tt=1

Immediately,
yT +1,T = yT
yT +2,T = yT +1,T = 2 yT
..
.
yT +h,T = yT +h1,T = h yT

Extension to AR(p) and AR() is immediate.

2.6 MULTIVARIATE

2.6.1 The Environment

(y1t , y2t )0 is covariance stationary if:

E(y1t ) = 1 t
E(y2t ) = 2 t

!
y1t 1
y1 y2 (t, ) = E (y1,t 1 , y2,t 2 )
y2t 2
THE WOLD REPRESENTATION 11

!
11 ( ) 12 ( )
=
21 ( ) 22 ( )
= 0, 1, 2, ...

Cross Covariances and the Generating Function

12 ( ) 6= 12 ( )

12 ( ) = 21 ( )

y1 y2 ( ) = 0y1 y2 ( ), = 0, 1, 2, ...


X
Gy1 y2 (z) = y1 y2 ( ) z
=

Cross Correlations

Ry1 y2 ( ) = Dy1
1 y2
y1 y2 ( ) Dy1
1 y2
, = 0, 1, , 2, ...

!
1 0
D =
0 2

2.6.2 The Multivariate General Linear Process

The Multivariate General Linear Process

! ! !
y1t B11 (L) B12 (L) 1t
=
y2t B21 (L) B22 (L) 2t

yt = B(L)t = (I + B1 L + B2 L2 + ...)t
(
if t = s
E(t 0s ) =
0 otherwise


X
k Bi k2 <
i=0
12 CHAPTER 2

Autocovariance Structure


X
0
y1 y2 ( ) = Bi Bi
i=

(where Bi 0 if i < 0)

Gy (z) = B(z) B 0 (z 1 )

Wiener-Kolmogorov Prediction

yt = t + B1 t1 + B2 t2 + ...

yT +h = T +h + B1 T +h1 + B2 T +h2 + ...

Project on t = {T , T 1 , ...} to get:

yt+h,T = Bh T + Bh+1 T 1 + ...

Wiener-Kolmogorov Prediction Error

h1
X
T +h,T = yT +h yT +h,T = Bi T +hi
i=0

E[T +h,T ] = 0

h1
X
E[T +h,T 0T +h,T ] = Bi Bi0
i=0

2.6.3 Vector Autoregressions

N -variable VAR of order p:

(L)yt = t

t W N (0, )

where:

(L) = I 1 L ... p Lp
THE WOLD REPRESENTATION 13

Simple estimation and analysis (OLS)


Granger-Sims causality
Getting the facts straight before theorizing; assessing the restrictions implies by
economic theory

! ! ! !
y1t 11 12 y1t1 1t
= +
y2t 21 22 y2t1 2t

! ! !!
1t 0 12 12
WN ,
2t 0 12 22

Two sources of cross-variable interaction.


What are they?

Understanding VARs: Bivariate Granger-Sims Causality

Is the history of yj useful for predicting yi ,


over and above the history of yi ?

Granger non-causality tests: Simple exclusion restrictions

In the simple 2-Variable VAR(1) example,


! ! ! !
y1t 11 12 y1t1 1t
= + ,
y2t 21 22 y2t1 2t
y2 does not Granger cause y1 iff 12 = 0

Natural extensions for N > 2


(always testing exclusion restrictions)

Understanding VARs: MA Representation

(L)yt = t

yt = 1 (L)t = (L)t

where:

(L) = I + 1 L + 2 L2 + ...
14 CHAPTER 2

Long-Form MA Representation of 2-Variable VAR(1)

! !  ! !
1 0 11 12 y1t 1t
L =
0 1 21 22 y2t 2t

! ! ! !
1 1
y1t 1t 11 12 1t1
= + 1 1
+ ...
y2t 2t 21 22 2t1

Understanding VARs: Impulse Response Functions (IRFs)

(I 1 L ... p Lp )yt = t

t W N (0, )

The impulse-response question:


How is yit dynamically affected by a shock to yjt (alone)?

(N N matrix of IRF graphs (over steps ahead))

Problem:
generally not diagonal, so how to shock j alone?

Understanding VARs: Variance Decompositions (VDs)

(I 1 L ... p Lp )yt = t

t W N (0, )

The variance decomposition question:


How much of the h-step ahead (optimal) prediction-error variance of yi is due to shocks to
variable j?

(N N matrix of VD graphs (over h) could be done.


Or pick an h and examines the N N matrix of VD numbers.)

Problem:
generally not diagonal, which makes things tricky, as the variance of a sum of
innovations is therefore not the sum of the variances.
THE WOLD REPRESENTATION 15

Orthogonalizing VARs by Cholesky Factorization


(The Classic Identification Scheme)

Original:

(I 1 L ... p Lp )yt = t , t W N (0, )

Equivalently:

(I 1 L ... p Lp )yt = P vt , vt W N (0, I)

where = P P 0 , for lower-triangular P


(Cholesky factorization)

Now we can shock j alone (for IRFs)

Now we can proceed to calculate forecast-error variances


without worrying about covariance terms (for VDs)
But theres no free lunch. Why?

IRFs and VDs from the Orthogonalized VAR

IRF comes from the


orthogonalized moving-average representation:

yt = (I + 1 L + 2 L2 + ...) P vt

= (P + 1 P L + 2 P L2 + ...) vt

IRFij is {Pij , (1 P )ij , (2 P )ij , ...}

VDij comes similarly from the


orthogonalized moving-average representation.

Note how the the contemporaneous IRF and VD for h = 1 are driven by the Cholesky
choice of P .
Other choices are possible.

Two-Variable IRF Example (IRF12 )

yt = P vt + 1 P vt1 + 2 P vt2 + ...

vt W N (0, I)
16 CHAPTER 2

0
yt = C0 vt + C1 vt1 + C2 vt2 + ... (Q : What is C12 ?)

! ! ! ! !
y1t c011 c012 v1t c111 c112 v1t1
= + + ...
y2t c021 c022 v2t c121 c122 v2t1

IRF12 = C012 , C112 , C212 , ...

Two-Variable VD Example (VD12 (2))

t+2,t = C0 vt+2 + C1 vt+1

vt W N (0, I)

! ! ! ! !
1t+2,t c011 c012 v1t+2 c111 c112 v1t+1
= +
2t+2,t c021 c022 v2t+2 c121 c122 v2t+1

1t+2,t = c011 v1t+2 + c012 v2t+2 + c111 v1t+1 + c112 v2t+1

var(1t+2,t ) = (c011 )2 + (c012 )2 + (c111 )2 + (c112 )2

Part coming from v2 : (c012 )2 + (c112 )2

(c012 )2 + (c112 )2
V D12 (2) =
(c011 )2 + (c012 )2 + (c111 )2 + (c112 )2
Graphic: IRF Matrix for 4-Variable U.S. Macro VAR
840
700
820
800 650

780 600
760 550
1959 1965 1971 1977 1983 1989 1995 2001 1959 1965 1971 1977 1983 1989 1995 2001

THE WOLD REPRESENTATION 17

Response of Y Response of P Response of R Response of M


1.0 2.00 0.84 2.1
0.8 1.75 0.70 1.8
1.50 1.5
0.6 1.25 0.56
1.2
0.4 1.00 0.42
0.9
0.2 0.75 0.28
Y 0.0 0.50 0.14
0.6
0.25 0.3
-0.2 0.00 0.00 0.0
-0.4 -0.25 -0.14 -0.3
0 10 20 30 0 20 0 20 0 10 20 30

0.2 1.50 0.6 1.75


0.1 1.25 0.5 1.50
-0.0 1.00 0.4 1.25
0.3 1.00
-0.1 0.75
0.2 0.75
-0.2 0.50
P -0.3 0.25
0.1 0.50
0.0 0.25
Shock to

-0.4 0.00 -0.1 0.00


-0.5 -0.25 -0.2 -0.25
0 10 20 30 0 20 0 10 20 30 0 20

0.50 0.18 1.00 0.4


-0.00 0.75 0.2
0.25
-0.18 -0.0
0.50 -0.2
0.00 -0.36
0.25 -0.4
-0.54
R -0.25
-0.72 0.00 -0.6
-0.8
-0.50 -0.25
-0.90 -1.0
-0.75 -1.08 -0.50 -1.2
0 20 0 20 0 20 0 10 20 30

0.6 1.8 0.4 1.8


0.5 1.6 1.6
0.4 1.4 0.3
0.3 1.2 1.4
0.2 1.0 0.2 1.2
0.1 0.8 1.0
M -0.0 0.6
0.1
0.8
-0.1 0.4 0.0
-0.2 0.2 0.6
-0.3 0.0 -0.1 0.4
0 10 20 30 0 10 20 30 0 10 20 30 0 10 20 30

Response of Y Response of P Response of R Response of M

Orthogonalizing/Identifying VARs
Figure 1.1: VARMore Generally
evidence on US data
Structural VARs

Structure:
A0 yt = A1 yt1 + ... + Ap ytp + vt , vt (0, D)
where D is diagonal.

Reduced form:
yt = A1
0 A1 yt1 + ... + A1 1
0 Ap ytp + A0 vt
= 1 yt1 + ... + p ytp + et ,
where et = A1
0 vt .

The structure can be identified from the reduced form


N 2 N
if 2 restrictions are imposed on A0 .
Cholesky restricts A0 to be lower triangular (recursive structure).

IRF:
yt = (I + 1 L + 2 L2 + ...) et
= (I + 1 L + 2 L2 + ...) A1
0 vt
= (A1
0 + 1 A1 1 2
0 L + 2 A0 L + ...) vt
18 CHAPTER 2

2.7 A SMALL EMPIRICAL TOOLKIT

2.7.1 Nonparametric: Sample Autocovariances

T | |
1 X
( ) = xt xt+| | , = 0, 1, ..., (T 1)
T t=1

T | |
1 X
( ) = xt xt+| | , = 0, 1 , ..., (T 1)
T | | t=1

Perhaps surprisingly, ( ) is better

Asymptotic Distribution of the Sample Autocorrelations

= ((0), (1), ..., (r))0

d

) N (0, )
T (

Important special case (iid):


1
asyvar(
( )) = ,
T

asycov(
( ), ( + v)) = 0

Bartlett standard errors

2.7.2 Parametric: ARM A Model Selection, Fitting and Diagnostics

2.7.2.1 Fitting and Selection

Fitting: OLS, MLE, GMM.


Model Selection (Relative Model Performance)
What not to do...

PT 2
t=1 et
M SE =
T
THE WOLD REPRESENTATION 19

PT 2
2 t=1 et
R = 1 PT
t=1 (yt y)2

M SE
= 1 1
PT
T t=1 (yt y)2
Still bad:

PT 2
2 t=1 et
s =
T k
PT !
2
 
2 T t=1 et
s =
T k T

PT 2
2 = 1 P t=1 et / T k
R T
t=1 (yt yt )2 / T 1

s2
= 1 PT
t=1 (yt yt )2 / T 1
Good:

PT !
2
t=1 et
SIC = T ( T )
k

More generally,
2lnL KlnT
SIC = +
T T

Consistency (oracle property)

2.7.2.2 Diagnostics: Testing White Noise

H0 : (1) = (2) = ... = (m) = 0

m
X
QBP = T 2 ( ) 2 (m)
=1

m  
X 1
QLB = T (T + 2) 2 ( )
=1
T
20 CHAPTER 2

2.8 EXERCISES, PROBLEMS AND COMPLEMENTS

1. Ergodicity.
We shall say (loosely speaking) that a time series is ergodic if consistent inference
regarding its stochastic structure can be made on the basis of one realization. While
ergodicity is a deep mathematical property of the distribution function characteriz-
ing the time series in question, its meaning for a stationary time series is essentially
independence of observations far enough apart in time.
Ergodicity refers to consistent moment estimability based only on a single realization,
as opposed to stationarity, which is concerned with the timeconstancy of the prob-
ability structure of a stochastic process. It is therefore nonsensical to pose questions
regarding the ergodicity of nonstationary processes. We stress that ergodicity cannot
be checked, even with a (doubly) infinitely sample path. The intuition is simple:
regardless of whether or not a timeseries is ergodic, sample moments converge to a
random variable. If the series is ergodic, that random variable is in fact a (degenerate)
constant. It is immediately clear, then, that even with an infinitely large sample one
cannot tell whether or not sample moments converge to a constant (fixed in repeated
realizations) or just one particular realization of a random variable (which will change
from realization to realization). To check ergodicity, one must have available an entire
ensemble, which is never the case in practice.
Due to the impossibility of empirically checking ergodicity in observed time series,
attention has focused on the study of specific parameterizations for which ergodic-
ity can be theoretically established. For example, the important LRCSSP, discussed
below, is always ergodic. More generally, we seek sufficient conditions under which
laws of large numbers (LLN) can be shown to hold. For a time series of independent,
identically distributed random variables, Kolmogorovs LLN holds. For dependent,
identically (unconditionally) distributed time series, sufficient conditions for the LLN
are well known. Much recent research examines conditions sufficient for the LLN in
more general situations, such as dependent time series with heterogeneous innovations.
The resulting theories of mixing, martingale difference, and nearepoch dependent se-
quences are discussed in White (1984), Gallant and White (198*), and White (199*),
among many others.

2. The autocovariance function of the MA(1) process, revisited.


In the text we wrote


2 , = 1
( ) = E(yt yt ) = E((t + t1 )(t + t 1 )) =

0, otherwise.

THE WOLD REPRESENTATION 21

Fill in the missing steps by evaluating explicitly the expectation

E((t + t1 )(t + t 1 )).

3. Predicting AR processes.
Show the following.

(a) If yt is a covariance stationary AR(1) process, i.e., yt = yt1 + t with || < 1,


then yt+h,t = h yt .
(b) If yt is AR(2),

yt = (1 + 2 )yt1 1 2 yt2 + t ,

with | 1 |, | 2 | < 1, then

yt+1,t = (1 + 2 )yt 1 2 yt1 .

(c) In general, the result for an AR(p) process is

yt+k,t = 1 yt+k1,t + ... + p yt+kp,t ,

where ytj = ytj , for j = 0, 1, ..., at time t. Thus for pure autoregressions, the
MMSE prediction is a linear combination of only the p most recently observed
values.

4. Predicting M A process.
If yt is M A(1),

yt = t t1 ,

where | < 1, then



X
yt+1 = j xtj ,
j=0

and yt+k = 0 for all k > 1.


For moving-average processes more generally, predictions for a future period greater
than the order of the process are zero and those for a period less distant cannot be
expressed in terms of a finite number of past observed values.

5. Predicting the ARM A(1, 1) process.


If yt is ARM A(1, 1),

yt yt1 = t t1 ,
22 CHAPTER 2

with | |, | | < 1, then



X
yt+k,t = k1 ( ) j ytj .
j=0

6. Prediction-error dynamics.
Consider the general linear process with strong white noise innovations. Show that
both the conditional (with respect to the information set t = {t , t1 , ...}) and
unconditional moments of the Wiener-Kolmogorov h-step-ahead prediction error are
identical.

7. Truncating the Wiener-Kolmogorov predictor.


Consider the sample path, {yt }Tt=1 , where the data generating process is yt = B(L)t
and B(L) is of infinite order. How would you modify the Weiner-Kolmogorov linear
least squares prediction formula to generate an operational 3-step-ahead forecast?
(Hint: truncate.) Is your suggested predictor linear least squares? Least squares within
the class of linear predictors using only T past observations?

8. Empirical GDP dynamics.

(a) Obtain the usual quarterly expenditure-side U.S. GDPE from FRB St. Louis,
1960.1-present.
(b) Leaving out the 12 most recent quarters of data, perform a full correlogram
analysis for GDPE logarithmic growth.
(c) Again leaving out the 12 most recent quarters of data, specify, estimate and de-
fend appropriate AR(p) and ARM A(p, q) models for GDPE logarithmic growth.
(d) Using your preferred AR(p) and ARM A(p, q) models for GDPE logarithmic
growth, generate a 12-quarter-ahead linear least-squares path forecast for the
hold-out sample. How do your AR(p) and ARM A(p, q) forecasts compare to
the realized values? Which appears more accurate?
(e) Obtain ADNSS GDPplus logarithmic growth from FRB Philadelphia, read about
it, and repeat everything above.
(f) Contrast the results for GDPE logarithmic growth and GDPplus logarithmic
growth.

9. Time-domain analysis of housing starts and completions.

(a) Obtain monthly U.S. housing starts and completions data from FRED at FRB
St. Louis, seasonally-adjusted, 1960.1-present. Your two series should be of equal
length.
THE WOLD REPRESENTATION 23

(b) Using only observations {1, ..., T 4}, perform a full correlogram analysis of starts
and completions. Discuss in detail.
(c) Using only observations {1, ..., T 4}, specify and estimate appropriate univari-
ate ARM A(p, q) models for starts and completions, as well as an appropriate
V AR(p). Discuss in detail.
(d) Characterize the Granger-causal structure of your estimated V AR(p). Discuss in
detail.
(e) Characterize the impulse-response structure of your estimated V AR(p) using all
possible Cholesky orderings. Discuss in detail.
(f) Using your preferred ARM A(p, q) models and V AR(p) model, specified and es-
timated using only observations {1, ..., T 4}, generate linear least-squares path
forecasts for the four quarters of hold out data, {T 3, T 2, T 1, T }. How
do your forecasts compare to the realized values? Discuss in detail.

10. Factor structure.


Consider the bivariate linearly indeterministic process,
! ! !
y1t B11 (L) B12 (L) 1t
= ,
y2t B21 (L) B22 (L) 2t

under the usual assumptions. Suppose further that B11 (L) = B21 (L) = 0 and 1t = 2t = t
(with variance 2 ). Discuss the nature of this system. Why might it be useful in eco-
nomics?

2.9 NOTES

Characterization of time series by means of autoregressive, moving average, or ARMA mod-


els was suggested, more or less simultaneously, by the Russian statistician and economist E.
Slutsky and the British statistician G.U. Yule. The Slutsky-Yule framework was modern-
ized, extended, and made part of an innovative and operational modeling and forecasting
paradigm in a more recent classic, a 1970 book by Box and Jenkins. In fact, ARMA and
related models are often called Box-Jenkins models.
By 1930 Slutzky and Yule had shown that rich dynamics could be obtained by tak-
ing weighted averages of random shocks. Wolds celebrated 1937 decomposition established
the converse, decomposing covariance stationary series into weighted averages of random
shocks, and paved the way for subsequent path-breaking work by Wiener, Kolmogorov,
Kalman and others. The beautiful 1963 treatment by Wolds student Whittle (1963), up-
dated and reprinted as Whittle (1983) with a masterful introduction by Tom Sargent, re-
mains widely-read. Much of macroeconomics is built on the Slutzky-Yule-Wold-Wiener-
Kolmogorov foundation. For a fascinating overview of parts of the history in its relation
24 CHAPTER 2

to macroeconomics, see Davies and Mahon (2009), at http://www.minneapolisfed.org/


publications_papers/pub_display.cfm?id=4348.
Chapter Three

Spectral Analysis

3.1 THE MANY USES OF SPECTRAL ANALYSIS

Spectral Analysis

As with the acov function, getting the facts straight

Trend and persistence (power near zero)

Integration, co-integration and long memory

Cycles (power at cyclical frequencies)

Seasonality (power spikes at fundamental and harmonics)

Filter analysis and design

Maximum-likelihood estimation (including band spectral)

Assessing agreement between models and data

Robust (HAC) variance estimation

3.2 THE SPECTRUM AND ITS PROPERTIES

Recall the General Linear Process


X
yt = B(L)t = bi ti
i=0

Autocovariance generating function:



X
g(z) = ( ) z
=

= 2 B(z)B(z 1 )

( ) and g(z) are a z-transform pair


26 CHAPTER 3

Spectrum
Evaluate g(z) on the unit circle, z = ei :


X
g(ei ) = ( ) ei , < <
=

= 2 B(ei ) B(ei )

= 2 | B(ei ) |2

Spectrum
Trigonometric form:


X
g() = ( )ei
=


X
( ) ei + ei

= (0) +
=1


X
= (0) + 2 ( ) cos( )
=1

Spectral Density Function

1
f () = g()
2


1 X
f () = ( )ei ( < < )
2 =


1 1X
= (0) + ( ) cos( )
2 =1

2
B ei B ei
 
=
2

2
| B ei |2

=
2
SPECTRAL ANALYSIS 27

Properties of Spectrum and Spectral Density

1. symmetric around = 0

2. real-valued

3. 2-periodic

4. nonnegative

A Fourier Transform Pair


X
g() = ( )ei
=

Z
1
( ) = g()ei d
2

A Variance Decomposition by Frequency

Z
1
( ) = g()ei d
2

Z
= f ()ei d

Hence
Z
(0) = f ()d

Robust Variance Estimation


PT
= T1 t=1 xt
x
PT PT
x) = T12 s=1 t=1 (t s)
var(
(Add row sums)
 
PT 1 | |
= T1 =(T 1) 1 T ( )
(Add diagonal sums, using change of variable = t s)
Hence:


T 1

 
X | |
x ) 0,
T ( 1 ( )
T
=(T 1)

x ) N (0, gx (0))
T (
28 CHAPTER 3

3.3 RATIONAL SPECTRA

White Noise Spectral Density

yt = t

t W N (0, 2 )

2
B ei B ei
 
f () =
2

2
f () =
2
AR(1) Spectral Density

yt = yt1 + t

t W N (0, 2 )

2
f () = B(ei )B(ei )
2

2 1
=
2 (1 ei )(1 ei )

2 1
=
2 1 2 cos() + 2
How does shape depend on ? Where are the peaks?
ARMA(1, 1) Spectral Density

(1 L)yt = (1 L)t

2 1 2 cos() + 2
f () =
2 1 2 cos() + 2
Rational spectral density
Internal peaks? What will it take?
SPECTRAL ANALYSIS 29

Figure 3.1: Grangers Typical Spectral Shape of an Economic Variable

3.4 MULTIVARIATE

Multivariate Frequency Domain


Covariance-generating function;

X
Gyx (z) = yx ( )z
=

Spectral density function:


1
Fyx () = Gyx (ei )
2


1 X
= yx ( ) ei , < <
2 =

(Complex-valued)
Co-Spectrum and Quadrature Spectrum

Fyx () = Cyx () + iQyx ()


1 X
Cyx () = yx ( ) cos( )
2 =


1 X
Qyx () = yx ( ) sin( )
2 =

Cross Spectrum
fyx () = gayx ()exp(i phyx ()) (generic cross spectrum)
30 CHAPTER 3

1
2
gayx () = [Cyx () + Q2yx ()] 2 (gain)
 
Qyx ()
phyx () = arctan Cyx () (phase)
ph()
(Phase shift in time units is )

|fyx ()|2
cohyx () = (coherence)
fxx ()fyy ()
Squared correlation decomposed by frequency
Useful Spectral Results for Filter Design and Analysis

(Effects of a linear filter)


If yt = B(L)xt , then:
2
fyy () = |B(ei )| fxx ()
fyx () = B(ei )fxx ().

B(ei ) is the filters frequency response function.

(Effects of a series of linear filters (follows trivially))


If yt = A(L)B(L)xt , then
2 2
fyy () = |A(ei )| |B(ei )| fxx ()
fyx () = A(ei )B(ei )fxx ().

(Spectrum of an independent sum)


PN
If y = i=1 xi , and the xi are independent, then
N
X
fy () = fxi ().
i=1

Nuances... Note that

fyx ()
B(ei ) =
fxx ()

gayx ()ei phyx ()


= B(ei ) =
fxx ()
Phases of fyx () and B(ei ) are the same.
Gains are closely related.
Example

yt = .5xt1 + t
SPECTRAL ANALYSIS 31

t W N (0, 1)

xt = .9xt1 + t

t W N (0, 1)

Correlation Structure
Autocorrelation and cross-correlation functions are straightforward:

y ( ) = .9| |

x ( ) .9| |

yx ( ) .9| 1|

(What is the qualitative shape of yx ( )?)


Spectral Density of x

1
xt = t
1 .9L

1 1 1
= fxx () = i
2 1 .9e 1 .9ei

1 1
=
2 1 2(.9) cos() + (.9)2

1
=
11.37 11.30 cos()
Shape?
Spectral Density of y

yt = 0.5Lxt + t

1
= fyy () =| 0.5ei |2 fxx () +
2

1
= 0.25fxx () +
2
32 CHAPTER 3

0.25 1
= +
11.37 11.30 cos() 2
Shape?
Cross Spectrum
B(L) = .5L
B(ei ) = 0.5ei
fyx () = B(ei )fxx ()
= 0.5ei fxx ()
= (0.5fxx ()) ei
0.5
gyx () = 0.5fxx () = 11.3711.30 cos()
P hyx () =
(In time units, P hyx () = 1, so y leads x by -1)
Coherence
| fyx () |2 2
.25fxx () .25fxx ()
Cohyx () = = =
fxx ()fyy () fxx ()fyy () fyy ()

1 1
.25 2 12(.9) cos()+.92
= 1 1 1
.25 2 12(.9) cos()+.92 + 2

1
=
8.24 + 7.20 cos()
Shape?

3.5 FILTER ANALYSIS AND DESIGN

Filter Analysis: A Trivial (but Important) High-Pass Filter

yt = xt xt1

= B(ei ) = 1 ei

Hence the filter gain is:

B(ei ) = 1 ei = 2(1 cos())


How would the gain look for B(L) = 1 + L?


Filter Analysis: Kuznets Infamous Filters
Low-frequency fluctuations in aggregate real output growth.
Kuznets cycle 20-year period
SPECTRAL ANALYSIS 33

Figure 3.2: Gain of Differencing Filter 1 L

Filter 1 (moving average):


2
1 X
yt = xtj
5 j=2

2
i 1 X ij sin(5/2)
= B1 (e )= e =
5 j=2 5sin(/2)

Hence the filter gain is:



B1 (ei ) = sin(5/2)

5sin(/2)

Kuznets Filters, Continued


Kuznets Filters, Continued
Filter 2 (fancy difference):

zt = yt+5 yt5

= B2 (ei ) = ei5 ei5 = 2sin(5)

Hence the filter gain is:

B2 (ei ) = |2sin(5)|

Kuznets Filters, Continued


Kuznets Filters, Continued
Composite gain:
34 CHAPTER 3

Figure 3.3: Gain of Kuznets Filter 1

Figure 3.4: Gain of Kuznets Filter 2


SPECTRAL ANALYSIS 35

Figure 3.5: Composite Gain of Kuznets two Filters


B1 (ei )B2 (ei ) = sin(5/2) |2sin(5)|

5sin(/2)

Kuznets Filters, Continued


Filter Design: A Bandpass Filter
Canonical problem:
Find B(L) s.t.

(
fx () on [a, b] [b, a]
fy () =
0 otherwise,
where

X
yt = B(L)xt = bj tj
j=

Bandpass Filter, Continued


Recall
2
fy () = |B(ei )| fx ().
Hence we need:
(
i 1 on [a, b], [b, a], 0 < a < b <
B(e )=
0 otherwise

By Fourier series expansion (inverse Fourier transform):


Z
1
bj = B(ei )eij
2
 
1 sin(jb) sin(ja)
= , j Z
j
36 CHAPTER 3

Bandpass Filter, Continued


Many interesting issues:

What is the weighting pattern? Two-sided? Weights symmetric around 0?

How best to make this filter feasible in practice? What does that mean? Simple
truncation?

One sided version?

Phase shift?

3.6 ESTIMATING SPECTRA

3.6.1 Univariate

Estimation of the Spectral Density Function


Periodogram ordinate at frequency :

T 2 r T
! r T
!
2 X 2 X it 2 X it
I() = yt eit = yt e yt e

T T t=1 T t=1


t=1


2j
Usually examine frequencies j = T , j = 0, 1, 2, ..., T2
Sample Spectral Density

T 1
1 X
f() = ( )ei
2
=(T 1)

2
T
1 X
f() = yt e it

2T


t=1

T
! T
!
1 X it 1 X it
= yt e yt e
2T t=1 2T t=1

1
= I()
4
Properties of the Sample Spectral Density
2j
(Throughout we use j , j = T , j = 0, 1, ..., T2 )

Ordinates asymptotically unbiased


SPECTRAL ANALYSIS 37

Ordinates asymptotically uncorrelated

But variance does not converge to 0


(degrees of freedom dont accumulate)

Hence inconsistent

For Gaussian series we have:


d
2f(j )
22 ,
f (j )

where the 22 random variables are


independent across frequencies
Consistent (Lag Window) Spectral Estimation

T 1 T 1
1 X 1 2 X
f() = ( )ei = (0) + ( ) cos( )
2 2 2 =1
=(T 1)

T 1
1 X
f () = ( )ei
( )
2
=(T 1)

Common lag windows with truncation lag MT :


( ) = 1, | | MT and 0 otherwise (rectangular, or boxcar)
| |
( ) = 1 MT , MT and 0 otherwise
(triangular, or Bartlett, or Newey-West)
MT
Consistency: MT and T 0
Truncation lag must increase appropriately with T
Other (Closely-Related) Routes to
Consistent Spectral Estimation
Fit parametric approximating models (e.g., autoregressive)
(Model-based estimation)
Let order increase appropriately with sample size
Smooth the sample spectral density
(spectral window estimation)
Let window width decrease appropriately with sample size
38 CHAPTER 3

3.6.2 Multivariate

Spectral density matrix:



1 X
Fyx () = yx ( )ei , < <
2 =

Consistent (lag window) estimator:


(T 1)
1 X
yx ( ) ei ,
Fyx () = ( ) < <
2
=(T 1)

Different lag windows may be used for different elements of Fyx ()


Or do model-based...

3.7 EXERCISES, PROBLEMS AND COMPLEMENTS

1. Seasonality and Seasonal Adjustment

2. HAC Estimation

3. Applied spectrum estimation.


Pick an interesting and appropriate real time series. Compute and graph (when ap-
propriate) the sample mean, sample autocovariance, sample autocorrelation, sample
partial autocorrelation, and sample spectral density functions. Also compute and graph
the sample coherence and phase lead. Discuss in detail the methods you used. For the
sample spectra, try to discuss a variety of smoothing schemes. Try smoothing the
periodogram as well as smoothing the autocovariances, and also try autoregressive
spectral estimators.

4. Sample spectrum.
Generate samples of Gaussian white noise of sizes 32, 64, 128, 256, 512, 1024 and
2056, and for each compute and graph the sample spectral density function at the
usual frequencies. What do your graphs illustrate?

5. Lag windows and spectral windows.


Provide graphs of the rectangular, Bartlett, Tukey-Hamming and Parzen lag windows.
Derive and graph the corresponding spectral windows.

6. Bootstrapping sample autocorrelations.


Assuming normality, propose a parametric bootstrap method of assessing the finite-
sample distribution of the sample autocorrelations. How would you generalize this to
assess the sampling uncertainty associated with the entire autocorrelation function?
How might you dispense with the normality assumption?
SPECTRAL ANALYSIS 39

Solution: Assume normality, and then take draws from the process by using a noram
random number generator in conjunction with the Cholesky factorization of the data
covariance matrix. This procedure can be used to estimate the sampling distribution
of the autocorrelations, taken one at a time. One will surely want to downweight
the long-lag autocorrelations before doing the Cholesky factorization, and let this
downweighting adapt to sample size. Assessing sampling uncertainty for the entire
autocorrelation function (e.g., finding a 95% confidence tunnel) appears harder,
due to the correlation between sample autocorrelations, but can perhaps be done
numerically. It appears very difficult to dispense with the normality assumption.

7. Bootstrapping sample spectra.


Assuming normality, propose a parametric bootstrap method of assessing the finite-
sample distribution of a consistent estimator of the spectral density function at various
selected frequencies. How would you generalize this to assess the sampling uncertainty
associated with the entire spectral density function?
Solution: At each bootstrap replication of the autocovariance bootstrap discussed
above, Fourier transform to get the corresponding spectral density function.

8. Bootstrapping spectra without normality.


Drop the normality assumption, and propose a parametric bootstrap method of
assessing the finite-sample distribution of (1) a consistent estimator of the spectral
density function at various selected frequencies, and (2) the sample autocorrelations.
Solution: Make use of the asymptotic distribution of the periodogram ordinates.

9. Sample coherence.
If a sample coherence is completed directly from the sample spectral density matrix
(without smoothing), it will be 1, by definition. Thus, it is important that the sam-
ple spectrum and cross-spectrum be smoothed prior to construction of a coherence
estimator.
Solution:
2
|fyx ()|
coh() =
fx () fy ()
In unsmoothed sample spectral density analogs,
[yt eit xt e+it ][yt e+it xt eit ]
c
oh() = [xt eit xt e+it ][yt eit yt e+it ]
1.

10. De-meaning.
Consider two forms of a covariance stationary time series: raw and de-meaned.
Contrast their sample spectral density functions at ordinates 2j/T, j = 0, 1, ...,
40 CHAPTER 3

T/2. What do you conclude? Now contrast their sample spectral density functions at
ordinates that are not multiples of 2j/T. Discuss.
Solution: Within the set 2j/T, j = 0, 1, ..., T/2, only the sample spectral density at
frequency 0 is affected by de-meaning. However, de-meaning does affect the sample
spectral density function at all frequencies in [0, ] outside the set 2j/T, j = 0, 1,
..., T/2. See Priestley (1980, p. 417). This result is important for the properties of
time- versus frequency-domain estimators of fractionally-integrated models. Note in
particular that
1 X ij t 2
I(j ) | yt e |
T
so that
1 X 2
I(0) | yt | T y2 ,
T
which approaches infinity with sample size so long as the mean is nonzero. Thus it
makes little sense to use I(0) in estimation, regardless of whether the data have been
demeaned.

11. Schusters periodogram.


The periodogram ordinates can be written as
T T
2 X X
I(j ) = ([ yt cos j t]2 + [ yt sin j t]2 ).
T t=1 t=1

Interpret this result.

12. Applied estimation.


Pick an interesting and appropriate real time series. Compute and graph (when appro-
priate) the sample mean, sample autocovariance, sample autocorrelation, sample par-
tial autocorrelation, and sample spectral density functions. Also compute and graph
the sample coherence and phase lead. Discuss in detail the methods you used. For
the sample spectra, try and discuss a variety of smoothing schemes. If you can, try
smooting the periodogram as well as smoothing the autocovariances, and also try
autoregressive spectral estimators.

13. Periodogram and sample spectrum.


Prove that I() = 4 f().

14. Estimating the variance of the sample mean.


Recall the dependence of the variance of the sample mean of a serially correlated time
series (for which the serial correlation is of unknown form) on the spectral density
of the series evaluated at = 0. Building upon this result, propose an estimator of
SPECTRAL ANALYSIS 41

the variance of the sample mean of such a time series. If you are very ambitious, you
might want to explore in a Monte Carlo experiment the sampling properties of your
estimator of the standard error vs. the standard estimator of the standard error, for
various population models (e.g., AR(1) for various values of ) and sample sizes. If
you are not feeling so ambitious, at least conjecture upon the outcome of such an
experiment.

15. Coherence.
a. Write out the formula for the coherence between two time series x and y.
b. What is the coherence between the filtered series, (1 - b1 L) xt and (1 - b2 L) yt ?
(Assume that b1 6= b2 .)
c. What happens if b1 = b2 ? Discuss.

16. Multivariate spectra.


Show that for the multivariate LRCSSP,

Fy () = B(ei ) B (ei )

where * denotes conjugate transpose.

17. Filter gains.


Compute, plot and discuss the squared gain functions associated with each of the fol-
lowing filters.
(a) B(L) = (1 - L)
(b) B(L) = (1 + L)
(c) B(L) = (1 - .5 L12)-1
(d) B(L) = (1 - .5 L12).

Solution:
(a) G2 = 1 - e-i2 is monotonically increasing on [0, ]. This is an example of a high
pass filter.
(b) G2 = 1 + e-i2 is monotonically decreasing on [0, ]. This is an example of a low
pass filter.
(c) G2 = (1 - .5 e-12i)2 has peaks at the fundamental seasonal frequency and its
harmonics, as expected. Note that it corresponds to a seasonal autoregression.
(d) G2 = (1 - .5 e-12i)2 has troughs at the fundamental seasonal frequency and its
harmonics, as expected, because it is the inverse of the seasonal filter in (c) above.
42 CHAPTER 3

Thus, the seasonal process associated with the filter in (c) above would be appropri-
ately seasonally adjusted by the present filter, which is its inverse.

18. Filtering
(a) Consider the linear filter B(L) = 1 + L. Suppose that yt = B(L) xt,
where xt WN(0, 2). Compute fy().

(b) Given that the spectral density of white noise is 2/2, discuss how the filtering
theorem may be used to determine the spectrum of any LRCSSP by viewing it as a
linear filter of white noise.

Solution:
(a) fy() = 1 + e-i2 fx()
= 2/2 (1 + e-i)(1 + ei)
= 2/2 (1 + 2 + 2 cos ),
which is immediately recognized as the sdf of an MA(1) process.
(b) All of the LRCSSPs that we have studied are obtained by applying linear filters
to white noise. Thus, the filtering theorem gives their sdfs as
f() = 2/2 B(e-i)2
= 2/2 B(e-i) B(ei)
= 2/2 B(z) B(z-1),
evaluated on |z| = 1, which matches our earlier result.

19. Zero spectra.


Suppose that a time series has a spectrum that is zero on an interval of positive mea-
sure. What do you infer?

Solution: The series must be deterministic, because one could design a filter such that
the filtered series has zero spectrum everywhere.

20. Period.
Period is 2/ and is expressed in time/cycle. 1/P, cycles/time. In engineering, time
is often measured in seconds, and 1/P is Hz.

21. Seasonal autoregression.


Consider the seasonal autoregression (1 - L12) yt = t.
(a) Would such a structure be characteristic of monthly seasonal data or quarterly
seasonal data?
SPECTRAL ANALYSIS 43

(b) Compute and plot the spectral density f(), for various values of . Does it have
any internal peaks on (0, )? Discuss.
(c) The lowest-frequency internal peak occurs at the so-called fundamental seasonal
frequency. What is it? What is the corresponding period?
(d) The higher-frequency spectral peaks occur at the harmonics of the fundamental
seasonal frequency. What are they? What are the corresponding periods?
Solution:
(a) Monthly, because of the 12-period lag.
(b)
2
f () = (1 + 2 2 cos(12))
2
The sdf has peaks at = 0, /6, 2/6, ..., 5/6, and .
(c) The fundamental frequency is /6, which corresponds to a period of 12 months.
(d) The harmonic frequencies are 2/6, ..., 5/6, and , corresponding to periods of
6 months, 4 months, 3 months, 12/5 months and 2 months, respectively.

22. More seasonal autoregression.


Consider the seasonal autoregression
(1 - L4) yt = t.
(a) Would such a structure be characteristic of monthly seasonal data or quarterly
seasonal data?
(b) Compute and plot the spectral density f(), for various values of . Does it have
any internal peaks on (0, )? Discuss.
(c) The lowest-frequency internal peak occurs at the so-called fundamental seasonal
frequency. What is it? What is the corresponding period?
44 CHAPTER 3

(d) The higher-frequency spectral peaks occur at the harmonics of the fundamental
seasonal frequency. What are they? What are the corresponding periods?
Solution: (a) Quarterly, because of the 4-period lag.
(b)
2
f () = (1 + 2 2 cos(4))
2
The sdf has peaks at = 0, /2 and .
(c) The fundamental frequency is /2, which corresponds to a period of 4 quarters.
(d) The only harmonic is , corresponding to a period of 2 quarters.

23. The long run.


Discuss and contrast the economic concept of long run and the statistical concept
of low frequency. Give examples showing when, if ever, the two may be validly and
fruitfully equated. Also give examples showing when, if ever, it would be inappropriate
to equate the two concepts.
Solution:
A potential divergence of the concepts occurs when economists think of the long run
as in steady state, which implies the absence of dynamics.

24. Variance of the sample mean.


The variance of the sample mean of a serially correlated time series is proportional to
the spectral density function at frequency zero.
Solution:
SPECTRAL ANALYSIS 45

Let
T
1X
x
= xt .
T t=1

Then
1
PT PT
var(
x) = T2 s=1 t=1 (t s)
1
PT 1 | |
= T =(T 1) (1 T )( ),

where ( ) is the autocovariance function of x. So for large T, we have


2fx (0)
x)
var( .
T
25. ARCH process spectrum.
Consider the ARCH(1) process xt , where

xt | xt1 N (0, .2 + .8 x2t1 )

a. Compute and graph its spectral density function.


b. Compute and graph the spectral density function of x2T . Discuss.

Solution:
a. By the law of iterated expectations, we have

E(xt ) = E[E(xt |xt1 )] = E(0) = 0

(0) = E(x2t ) = E[E(x2t |xt1 )] = E[E(0.2 + 0.8x2t1 )] = 0.2 + 0.8(0)

0.2
(0) = = 1
1 0.8

( ) = E(xt xt ) = E[E(xt xt |xt1 , xt2 , )] = E[xt E(xt |xt1 , xt2 , )] = E(xt 0) = 0

for =1,2,. . ..
Therefore

1 X 1 1
f () = ( )ei = (0) =
2 = 2 2

Because it is white noise, the spectrum will be flat.


b. Because the kurtosis of normal random variables is 3, we have

E(x4t ) = E[E(x4t |xt1 , xt2 )] = E[3(0.2 + 0.8x2t1 )2 ] = 3[0.04 + 0.32E(x2t1 ) + 0.64E(x4t1 )].

x2 (0) = E(x4t ) (E(x2t ))2 = 3 1 = 2


46 CHAPTER 3

Because

x2t

follows an AR(1) process, it follows that

x2 ( ) = 0.8x2 ( 1)

for =1,2,.... We can write the s.d.f . as



1 X 1 X
f () = x2 (0) + 2 x2 ( ) cos( ) = (1 + 2 0.8 cos( ))
2 =1
2 =1

which will look like an AR(1) process s.d.f .

26. Computing spectra.


Compute, graph and discuss the spectral density functions of
a. yt = .8yt12 + t
b. yt = .8t12 + t .
Solution:
a.
2 2
f () = [(1 0.8e12i )(1 0.8e12i )]1 = (1 1.6cos12 + 0.64)1
2 2
b.

2 2
f () = [(1 + 0.8e12i )(1 + 0.8e12i )] = (1 + 1.6cos12 + 0.64)
2 2
SPECTRAL ANALYSIS 47

27. Regression in the frequency domain.


The asymptotic diagonalization theorem provides the key not only to approximate
(i.e., asymptotic) MLE of time-series models in the frequency domain, but also to
many other important techniques, such as Hannan efficient regression:

GLS = (X 0 1 X)1 X 0 1 Y

But asymptotically,

= P 0 DP

so

1 = P 0 D1 P

Thus asymptotically

GLS = (X 0 P 0 D1 P X)1 X 0 P 0 D1 P Y

which is just WLS on Fourier transformed data.

28. Band spectral regression

3.8 NOTES

Harmonic analysis is one of the earliest methods of analyzing time series thought to exhibit
some form of periodicity. In this type of analysis, the time series, or some simple trans-
formation of it, is assumed to be the result of the superposition of sine and cosine waves
of different frequencies. However, since summing a finite number of such strictly periodic
functions always results in a perfectly periodic series, which is seldom observed in practice,
one usually allows for an additive stochastic component, sometimes called noise. Thus, an
observer must confront the problem of searching for hidden periodicities in the data, that
is, the unknown frequencies and amplitudes of sinusoidal fluctuations hidden amidst noise.
An early method for this purpose is periodogram analysis, initially used to analyse sunspot
data, and later to analyse economic time series.
Spectral analysis is a modernized version of periodogram analysis modified to take account
of the stochastic nature of the entire time series, not just the noise component. If it is assumed
that economic time series are fully stochastic, it follows that the older periodogram technique
is inappropriate and that considerable difficulties in the interpretation of the periodograms
of economic series may be encountered.
These notes draw in part on Diebold, Kilian and Nerlove, New Palgrave, ***.
Chapter Four

Markovian Structure, Linear Gaussian State Space, and Optimal

(Kalman) Filtering

4.1 MARKOVIAN STRUCTURE

4.1.1 The Homogeneous Discrete-State Discrete-Time Markov Process

{Xt }, t = 0, 1, 2, . . .

Possible values (states) of Xt : 1, 2, 3, . . .

First-order homogeneous Markov process:

P rob(Xt+1 = j|Xt = i, Xt1 = it1 , . . . , X0 = i0 )

= P rob(Xt+1 = j|Xt = i) = pij


1-step transition probabilities:

[time (t + 1)]


p11 p12
[time t] p21 p22





P


P
pij 0, j=1 pij = 1

4.1.2 Multi-Step Transitions: Chapman-Kolmogorov

m-step transition probabilities:


(m)
pij = P rob(Xt+m = j | Xt = i)

 
(m)
Let P (m) pij .
STATE SPACE AND THE KALMAN FILTER 49

Chapman-Kolmogorov theorem:

P (m+n) = P (m) P (n)

Corollary: P (m) = P m

4.1.3 Lots of Definitions (and a Key Theorem)


(n)
State j is accessible from state i if pij > 0, for some n.

Two states i and j communicate (or are in the same class) if each is accessible from the
other. We write i j.

A Markov process is irreducible if there exists only one class (i.e., all states communicate).

(n)
State i has period d if pii = 0 n such that n/d 6 Z, and d is the greatest integer with
that property. (That is, a return to state i can only occur in multiples of d steps.) A state
with period 1 is called an aperiodic state.

A Markov process all of whose states are aperiodic is called an aperiodic Markov process.
Still more definitions....
The first-transition probability is the probability that, starting in i, the first transition to
j occurs after n transitions:
(n)
fij = P rob(Xn = j, Xk 6= j, k = 1, ..., (n 1)|X0 = i)
P (n)
Denote the eventual transition probability from i to j by fij (= n=1 fij ).

State j is recurrent if fjj = 1 and transient otherwise.

Denote the expected number of transitions needed to return to recurrent state j by


P (n)
jj (= n=1 nfjj ).

A recurrent state j is positive recurrent if jj < null recurrent if jj = .


One final definition...
The row vector is called the stationary distribution for P if:

P = .

The stationary distribution is also called the steady-state distribution.


Theorem: Consider an irreducible, aperiodic Markov process.

Then either:
50 CHAPTER 4

(1) All states are transient or all states are null recurrent

(n)
pij 0 as n i, j. No stationary distribution.

or

(2) All states are positive recurrent.

(n)
pij j as n i, j. {j , j = 1, 2, 3, ...} is the unique stationary distribution.
is any row of limn P n .

4.1.4 A Simple Two-State Example

Consider a Markov process with transition probability matrix:


!
0 1
P =
1 0
Call the states 1 and 2.

We will verify many of our claims, and we will calculate the steady-state distribution.

4.1.4.1 Valid Transition Probability Matrix

pij 0 i, j
2
X 2
X
p1j = 1, p2j = 1
j=1 j=1

4.1.4.2 Chapman-Kolmogorov Theorem (for P (2) )


! ! !
0 1 0 1 1 0
P (2) = P P = =
1 0 1 0 0 1

4.1.4.3 Communication and Reducibility

Clearly, 1 2, so P is irreducible.
STATE SPACE AND THE KALMAN FILTER 51

4.1.4.4 Periodicity

State 1: d(1) = 2
State 2: d(2) = 2

4.1.4.5 First and Eventual Transition Probabilities

(1) (n)
f12 = 1, f12 = 0 n > 1 f12 = 1
(1) (n)
f21 = 1, f21 = 0 n > 1 f21 = 1

4.1.4.6 Recurrence

Because f21 = f12 = 1, both states 1 and 2 are recurrent.

Moreover,

(n)
X
11 = nf11 = 2 < (and similarly 22 = 2 < )
n=1

Hence states 1 and 2 are positive recurrent.

4.1.4.7 Stationary Probabilities

We will guess and verify.

Let 1 = .5, 2 = .5 and check P = :

!
0 1
(.5, .5) = (.5, .5).
1 0

Hence the stationary probabilities are 0.5 and 0.5.

Note that in this example we can not get the stationary probabilities by taking limn P n .
Why?

4.1.5 Constructing Markov Processes with Useful Steady-State Distributions

In section 4.1.4 we considered an example of the form, for a given Markov process, character-
ize its properties. Interestingly, many important tools arise from the reverse consideration,
For a given set of properties, find a Markov process with those properties.
52 CHAPTER 4

4.1.5.1 Markov Chain Monte Carlo

(e.g., Gibbs sampling)


We want to sample from f (z) = f (z1 , z2 )
(0)
Initialize (j = 0) using z2
1 (0) (1) (1)
Gibbs iteration j = 1: Draw z(1) from f (z1 |z2 ), draw z2 from f (z2 |z1 )
Repeat j = 2, 3, ....

4.1.5.2 Global Optimization

(e.g., simulated annealing)


If c
/ N ((m) ) then P ((m+1) = c |(m) ) = 0
If c N ((m) ) then P ((m+1) = c | (m) ) = exp (min[0, /T (m)])

4.1.6 Variations and Extensions: Regime-Switching and More

4.1.6.1 Markovian Regime Switching


!
p11 1 p11
P =
1 p22 p22

st P

yt = cst + st yt1 + t

t iid N (0, s2t )

Markov switching, or hidden Markov, model

Popular model for macroeconomic fundamentals

4.1.6.2 Heterogeneous Markov Processes



p11,t p12,t

p21,t p22,t
Pt =

.


e.g., Regime switching with time-varying transition probabilities:

st Pt
STATE SPACE AND THE KALMAN FILTER 53

yt = cst + st yt1 + t

t iid N (0, s2t )

Business cycle duration dependence: pij,t = gij (t)


Credit migration over the cycle: pij,t = gij (cyclet )
General covariates: pij,t = gij (xt )

4.1.6.3 Semi-Markov Processes

We call semi-Markov a process with transitions governed by P , such that the state durations
(times between transitions) are themselves random variables. The process is not Markov,
because conditioning not only the current state but also time-to-date in state may be useful
for predicting the future, but there is an embedded Markov process.

Key result: The stationary distribution depends only on P and the expected state dura-
tions. Other aspects of the duration distribution are irrelevant.

Links to Diebold-Rudebush work on duration dependence: If welfare is affected only by


limiting probabilities, then the mean of the duration distribution is the only relevant aspect.
Other, aspects, such as spread, existence of duration dependence, etc. are irrelevant.

4.1.6.4 Time-Reversible Processes

Theorem: If {Xt } is a stationary Markov process with transition probabilities pij and sta-
tionary probabilities i , then the reversed process is also Markov with transition probabilities
j
pij = pji .
i

In general, pij 6= pij . In the special situation pij = pij (so that i pij = j pji ), we say that
the process is time-reversible.

4.1.7 Continuous-State Markov Processes

4.1.7.1 Linear Gaussian State Space Systems

t = T t1 + Rt

yt = Zt + t

t N, t N
54 CHAPTER 4

4.1.7.2 Non-Linear, Non-Gaussian State Space Systems

t = Q(t1 , t )

yt = G(t , t )

t D , t D

Still Markovian!

4.2 STATE SPACE REPRESENTATIONS

4.2.1 The Basic Framework

Transition Equation

t = T t1 + R t
mx1 mxm mx1 mxg gx1

t = 1, 2, ..., T

Measurement Equation

yt = Z t + wt + t
1x1 1xm mx1 1xL Lx1 1x1

(This is for univariate y. Well do multivariate shortly.)

t = 1, 2, ..., T

(Important) Details

!  
t
WN 0, diag( Q , |{z}
h )
t |{z}
gg 11

E(0 t 0 ) = 0mxg

E(0 t ) = 0mx1
STATE SPACE AND THE KALMAN FILTER 55

All Together Now

t = T t1 + R t
mx1 mxm mx1 mxg gx1

yt = Z t + wt + t
1x1 1xm mx1 1xL Lx1 1x1

!  
t
WN 0, diag( Q , |{z}
h )
t |{z}
gg 11

E(0 t ) = 0mx1 E(0 t 0 ) = 0mxg

State Space Representations Are Not Unique


Transform by the nonsingular matrix B.
The original system is:

t = T t1 + R t
mx1 mxm mx1 mxg gx1

yt = Z t + wt + t
1x1 1xm mx1 1xL Lx1 1x1

Rewrite the system in two steps


First, write it as:

t = T B 1 B t1 + R t
mx1 mxm mxm mxm mx1 mxg gx1

yt = Z B 1 B t + wt + t
1x1 1xm mxm mxm mx1 mxL Lx1 1x1

Second, premultiply the transition equation by B to yield:


56 CHAPTER 4

(B t ) = (B T B 1 ) (B t1 ) + (B R) t
mx1 mxm mx1 mxg gx1

yt = (Z B 1 ) (B t ) + wt + t
1x1 1xm mx1 mxL Lx1 1x1

(Equivalent State Space Representation)

4.2.2 ARMA Models

State Space Representation of an AR(1)

yt = yt1 + t

t W N (0, 2 )

Already in state space form!

t = t1 + t

yt = t

(T = , R = 1, Z = 1, = 0, Q = 2 , h = 0)
MA(1)

yt = (L)t

t W N (0, 2 )

where

(L) = 1 + 1 L

MA(1) in State Space Form

yt = t + t1

t W N (0, 2 )
STATE SPACE AND THE KALMAN FILTER 57

! ! ! !
1t 0 1 1,t1 1
= + t
2t 0 0 2,t1

yt = (1, 0) t = 1t

MA(1) in State Space Form


Why? Recursive substitution from the bottom up yields:

!
yt
t =
t

MA(q)

yt = (L)t

t W N (0, 2 )

where

(L) = 1 + 1 L + ... + q Lq

MA(q) in State Space Form

yt = t + 1 t1 + ... + q tq

t W N N (0, 2 )


1t 0 1,t1 1
2t 0 Iq 2,t1 1



..
=
..


.. + . t
.
. . . .
q+1,t 0 00 q+1,t1 q

yt = (1, 0, ..., 0) t = 1t

MA(q) in State Space Form


Recursive substitution from the bottom up yields:
58 CHAPTER 4


q tq + . . . + 1 t1 + t yt

..


..

t
.
=

.


q t1 + q1 t


q t1 + q1 t


q t q t
AR(p)

(L)yt = t

t W N (0, 2 )

where

(L) = (1 1 L 2 L2 ... p Lp )

AR(p) in State Space Form

yt = 1 yt1 + ... + p ytp + t

t W N (0, 2 )


1t 1 1,t1 1

2t 2 Ip1 2,t1 0
t = . = + . t

. ..
.. .. ..







.

pt p 00 p,t1 0

yt = (1, 0, ..., 0) t = 1t

AR(p) in State Space Form


Recursive substitution from the bottom up yields:

1t 1 1,t1 + . . . + p 1,tp + t

..


..

t =

.
=

.

p1 1,t1 + p 1,t2
p1,t
pt p 1,t1

yt

..

=

.


p1 yt1 + p yt2
p yt1
ARMA(p,q)
STATE SPACE AND THE KALMAN FILTER 59

(L)yt = (L)t
t W N (0, 2 )

where
(L) = (1 1 L 2 L2 ... p Lp )

(L) = 1 + 1 L + ... + q Lq

ARMA(p,q) in State Space Form

yt = 1 yt1 + ... + p ytp + t + 1 t1 + ... + q tq

t W N (0, 2 )

Let m = max(p, q + 1) and write as ARMA(m, m 1):

(1 , 2 , ..., m ) = (1 , ..., p , 0, ..., 0)

(1 , 2 , ..., m1 ) = (1 , ..., q , 0, ..., 0)

ARMA(p,q) in State Space Form



1 1

2 Im1 1
t = t1 + t

. ..
.. .

m 00 m1

yt = (1, 0, ..., 0) t

ARMA(p,q) in State Space Form Recursive substitution from the bottom up yields:

1t 1 1,t1 + p 1,tp + t + 1 t1 + . . . + q tq
. .
. .

.
=

.


m1,t m1 1,t1 + m,t1 + m2 t
mt m 1,t1 + m1 t

yt
.
.
=

.


m1 yt1 + m yt2 + m1 t1 + m2 t
m yt1 + m1 t

Multivariate State Space


(Same framework, N > 1 observables)

t = T t1 + R t
mx1 mxm mx1 mxg gx1
60 CHAPTER 4

yt = Z t + Wt + t
N x1 N xm mx1 N xL Lx1 N x1

!  
t
WN H )
0, diag( Q , |{z}
t |{z}
gg N N

E(0 t 0 ) = 0mxg E(0 t 0 ) = 0mxN

N -Variable V AR(p)

yt = 1 yt1 + ... + p ytp + t


N x1 N xN N x1

t W N (0, )

State Space Representation



1t 1 1,t1 IN
2t 2 IN (p1) 2,t1 0N xN


= + t

. . . .
. . . .
. . . .
pt p 00 p,t1 0N xN
N px1 N pxN p N px1 N P xN

yt = (IN , 0N , ..., 0N ) t
N x1 N xN p N px1

Multivariate ARMA(p,q)

yt = 1 yt1 + ... + p ytp


N x1 N xN N xN

+ t + 1 t1 + ... + q tq
N xN N xN

t W N (0, )
STATE SPACE AND THE KALMAN FILTER 61

Multivariate ARMA(p,q)

1 I
2 IN (m1) 1


t = .
.
t1 +
.. t

. .
N mx1
m 0N xN (m1) m1

yt = (I, 0, ..., 0) t = 1t

where m = max(p, q + 1)

4.2.3 Linear Regression with Time-Varying Parameters and More

Linear Regression Model, I


Transition: Irrelevant
Measurement:

yt = 0 xt + t

(Just a measurement equation with exogenous variables)


(T = 0, R = 0, Z = 0, = 0 , Wt = xt , H = 2 )
Linear Regression Model, II
Transition:

t = t1

Measurement:

yt = x0t t + t

(T = I, R = 0, Zt = x0t , = 0, H = 2 )
Note the time-varying system matrix.
Linear Regression with ARMA(p,q) Disturbances

yt = xt + ut

ut = 1 ut1 + ... + p utp + t + 1 t1 + ... + q tq


1 1
2 Im1 1


t = .
.
t1 +
.. t

. .
m 00 m1
62 CHAPTER 4

yt = (1, 0, ..., 0)t + xt

where m = max(p, q + 1)

Linear Regression with Time-Varying Coefficients


Transition:

t = t1 + t

Measurement:

yt = x0t t + t

(T = , R = I, Q = cov(t ), Zt = x0t , = 0, H = 2 )
Gradual evolution of tastes, technologies and institutions
Lucas critique
Stationary or non-stationary

4.2.3.1 Simultaneous Equations

N -Variable Dynamic SEM


+
Structure:

0 yt = 1 yt1 + ... + p ytp + P t

t W N (0, I)

Reduced form:

yt = 1 1 1
0 1 yt1 + ... + 0 p ytp + 0 P t

Assume that the system is identified.


SEM State Space Representation

1 1

1t 0 1 1,t1 0 P

1 1t
2t 0 2 I 2,t1 0

.
. = .. .. + .. .
.

.
. . . .


N t
pt 1
0 p 00 p,t1 0

yt = (IN , 0N , ..., 0N ) t
N x1 N xN p N px1
STATE SPACE AND THE KALMAN FILTER 63

4.2.4 Dynamic Factor Models and Cointegration

Dynamic Factor Model Single AR(1) factor


(White noise idiosyncratic factors uncorrelated with each other
and uncorrelated with the factor at all leads and lags...)



y1t 1 1 1t
. . . .
. = . + . Ft + .
. . . .


yN t N N N t

Ft = Ft1 + t

Already in state-space form!


Dynamic Factor Model Single ARMA(p,q) Factor

y1t 1 1 1t
. . . .
. = . + . Ft + .
. . . .


yN t N N N t

(L) Ft = (L) t

Dynamic Factor Model Single ARMA(p,q) Factor State vector for F is state vector for
system:


1 1
2 Im1 1


t = .
.
t1 +
.. t

. .
m 00 m1

Dynamic Factor Model Single ARMA(p,q) factor System measurement equation is then:


y1t 1 1 1t
.
. = .. + .. (1, 0, ..., 0) t + ..

. . . .


yN t N N N t


1 1 0 ... 0 1t
. .
t + ..

= . .
. + . .
N N 0 ... 0 N t

Cointegration (A Special Dynamic Factor Model)


64 CHAPTER 4

! ! !
y1t 1 1t
= t +
y2t 2 2t
t = t1 + t
Common trend t
y1t y2t 1t 2t
Note that 1 2 = 1 2
That is, I(1) I(1) = I(0)
CI(1,0)

4.2.5 Unobserved-Components Models

Separate components for separate features


Signal extraction
Trends and detrending
Seasonality and seasonal adjustment
Permanent-transitory decompositions
Cycle (Signal) + Noise Model

xt = xt1 + t

yt = xt + t

! ! !
t 2 0
WN 0,
t 0 2

(t = xt , T = , R = 1, Z = 1, = 0, Q = 2 , H = 2 )
Cycle + Seasonal + Noise

yt = ct + st + t

ct = ct1 + ct

st = st4 + st

Cycle + Seasonal + Noise


Transition equations for the cycle and seasonal:

ct = c,t1 + ct
STATE SPACE AND THE KALMAN FILTER 65


0 1

0 I3
s,t1 + 0 st

st =
0 0

00 0
Cycle + Seasonal + Noise Stacking transition equations gives the grand transition equa-
tion:


0 1 0 0 0 1 0
0 0 10 0 0 0
! ! !
st s,t1 st
= 0 0 0 1 0 +
0 0
ct c,t1 ct
0 0 0 0 0 0

0 0 0 0 0 1
Finally, the measurement equation is:
!
st
yt = (1, 0, 0, 0, 1) + t
ct

4.3 THE KALMAN FILTER AND SMOOTHER

State Space Representation

t = T t1 + R t
mx1 mxm mx1 mxg gx1

yt = Z t + Wt + t
N x1 N xm mx1 N xL Lx1 N x1

!  
t
WN 0, diag( Q , |{z}
H )
t |{z}
gg N N

E(0 t0 ) = 0mxg

E(0 0t ) = 0mxN
66 CHAPTER 4

4.3.1 Statement(s) of the Kalman Filter

I. Initial state estimate and MSE

a0 = E(0 )

P0 = E(0 a0 ) (0 a0 )0

Statement of the Kalman Filter


II. Prediction Recursions

at/t1 = T at1

Pt/t1 = T Pt1 T 0 + R Q R0

III. Updating Recursions

at = at/t1 + Pt/t1 Z 0 Ft1 (yt Zat/t1 Wt )

(where Ft = Z Pt/t1 Z 0 + H)

Pt = Pt/t1 Pt/t1 Z 0 Ft1 Z Pt/t1

t = 1, ..., T
State-Space in Density Form (Assuming Normality)

t |t1 N (T t1 , RQR0 )

yt |t N (Zt , H)

Kalman Filter in Density Form (Assuming Normality)


Initialize at a0 , P0
State prediction:
t |
yt1 N (at/t1 , Pt/t1 )
at/t1 = T at1
Pt/t1 = T Pt1 T 0 + RQR0
Data prediction:
yt |
yt1 N (Zat/t1 , Ft )
Update:
t |
yt N (at , Pt )
STATE SPACE AND THE KALMAN FILTER 67

at = at/t1 + Kt (yt Zat/t1 )


Pt = Pt/t1 Kt ZPt/t1
where yt = {y1 , ..., yt }

4.3.2 Derivation of the Kalman Filter

Useful Result 1: Conditional Expectation is MMSE Extraction Under Normality Suppose


that
!  
x
N ,
y
where x is unobserved and y is observed.
Then
Z Z
E(x|y) = argmin x(y) (y))2 f (x, y) dx dy
(x x

Useful Result 2: Properties of the Multivariate Normal

!   !
x xx xy
N , = (x , y )0 =
y yx yy


= x|y N x|y , x|y

x|y = x + xy 1
yy (y y )

x|y = xx xy 1
yy yx

Constructive Derivation of the Kalman Filter


Under Normality
Let Et () E( |t ), where t {y1 , ..., yt }.
Time 0 update:

a0 = E0 (0 ) = E (0 )

P0 = var0 ( 0 ) = E [(0 a0 ) (0 a0 )0 ]

Derivation of the Kalman Filter, Continued...


Time 0 prediction

1 = T 0 + R1
68 CHAPTER 4

= a1/0 = E0 (1 ) = T E0 (0 ) + RE0 (1 )

= T a0

Derivation of the Kalman Filter, Continued...


 
0
P1/0 = E0 (1 a1/0 ) (1 a1/0 )

 
(subst. a1/0 ) = E0 (1 T a0 ) (1 T a0 )0

 
(subst. 1 ) = E0 (T (0 a0 ) + R1 ) (T (0 a0 ) + R1 )0

= T P0 T 0 + RQR0

(using E(0 t0 ) = 0 t)

Derivation of the Kalman Filter, Continued...


Time 1 updating
We will derive the distribution of:
!
1
0
y1

and then convert to

1 |(0 y1 )

or

1 |1

Derivation of the Kalman Filter, Continued...


Means:

E0 (1 ) = a1/0

E0 (y1 ) = Za1/0 + W1
STATE SPACE AND THE KALMAN FILTER 69

Derivation of the Kalman Filter, Continued...


Variance-Covariance Matrix:

 
var0 (1 ) = E0 (1 a1/0 ) (1 a1/0 ) = P1/0

 
var0 (y1 ) = E0 (y1 Za1/0 W1 ) (y1 Za1/0 W1 )0

 
= E0 (Z(1 a1/0 ) + 1 ) (Z(1 a1/0 ) + 1 )0

= Z P1/0 Z 0 + H (using )

cov0 (1 , y1 ) = E0 (1 a1/0 ) (Z (1 a1/0 ) + 1 )0

= P1/0 Z 0 (using )

Derivation of the Kalman Filter, Continued...


Hence:

! ! !!
1
0 N a1/0 P1/0 P1/0 Z 0
,
y1 Za1/0 + W1 ZP1/0 ZP1/0 Z 0 + H

Now by Result 2, 1 | 0 y1 N (a1 , P1 )

a1 = a1/0 + P1/0 Z 0 F11 (y1 Za1/0 W1 )

P1 = P1/0 P1/0 Z 0 F11 Z P1/0

(F1 = Z P1/0 Z 0 + H)

Repeating yields the Kalman filter.


What Have We Done?
Under normality,
we proved that the Kalman filter delivers
MVU predictions and extractions.
Dropping normality,
one can also prove that the Kalman filter delivers
70 CHAPTER 4

BLU predictions and extractions.

4.3.3 Calculating P0

Treatment of Initial Covariance Matrix: P0 = (0) (Covariance stationary case: All eigen-
values of T inside |z| = 1)

t = T t1 + Rt

= (0) = E(T t1 + Rt )(T t1 + Rt )0 = T (0)T 0 + RQR0

= P0 = T P0 T 0 + RQR0

= vec(P0 ) = vec(T P0 T 0 ) + vec(RQR0 )

= (T T )vec(P0 ) + vec(RQR0 )

= vec(P0 ) = (I (T T ))1 vec(RQR0 )

4.3.4 Predicting yt

Point prediction:

yt/t1 = Zat/t1 + Wt

Prediction error:

vt = yt (Zat/t1 + Wt )

Density Prediction of yt

yt |t1 N (yt/t1 , Ft )

or equivalently

vt | t1 N (0, Ft )

Et1 vt = Et1 [yt (Zat/t1 + Wt )]

= Et1 [Z (t at/t1 ) + t ] = 0
STATE SPACE AND THE KALMAN FILTER 71

Et1 vt vt0 = Et1 [Z (t at/t1 ) + t ] [Z (t at/t1 ) + t ]0

= ZPt/t1 Z 0 + H Ft

Normality follows from linearity of all transformations.

4.3.4.1 Combining State Vector Prediction and Updating

(For notational convenience we now drop Wt )


(1) Prediction: at+1/t = T at
(2) Update: at = at/t1 + Pt/t1 Z 0 Ft1 (yt Zat/t1 )
= at/t1 + Kt vt
where

Kt = Pt/t1 Z 0 Ft1

Substituting (2) into (1):

at+1/t = T at/t1 + T Kt vt

4.3.5 Steady State and the Innovations Representation

Recall the Two-Shock State Space Representation

t = T t1 + Rt

yt = Zt + t

E(t t0 ) = Q

E(t 0t ) = H

(Nothing new)

4.3.5.1 Combining Covariance Matrix Prediction and Updating

(1) Prediction: Pt+1/t = T Pt T 0 + RQR0


(2) Update: Pt = Pt/t1 Kt Z Pt/t1
72 CHAPTER 4

Substitute (2) into (1):

Pt+1/t = T Pt/t1 T 0 T Kt Z Pt/t1 T 0 + RQR0

(Matrix Ricatti equation)


Why Care About Combining Prediction and Updating?
It leads us to the notion of steady state of the Kalman filter...
...which is the bridge from the Wold representation
to the state space representation

4.3.5.2 One-Shock (Prediction Error) Representation

We have seen that

at+1|t = T at|t1 + T Kt vt (transition)

Moreover, it is tautologically true that

yt = Z at|t1 + (yt Zat|t1 )

= Z at|t1 + vt (measurement)
Note that one-shock state space representation
has time-varying system matrices:

R matrix in transition equation is T Kt

Covariance matrix of vt is Ft

4.3.5.3 Innovations (Steady-State) Representation

t
at+1|t = T at|t1 + T Kv

yt = Z at|t1 + vt

where
= P Z 0 F 1
K

E(vt vt0 ) = F = Z P Z 0 + H

P solves the matrix Ricatti equation


Effectively Wold-Wiener-Kolmogorov prediction and extraction
STATE SPACE AND THE KALMAN FILTER 73

Prediction yt+1/t is now the projection of yt+1 on infinite past, and one-step prediction
errors vt are now the Wold-Wiener-Kolmogorov innovations
Remarks on the Steady State

1. Steady state will be approached if:

underlying two-shock system is time invariant

all eigenvalues of T are less than one

P1|0 is positive semidefinite

2. Because the recursions for Pt|t1 and Kt dont depend on the data, but only on P0 ,
we can calculate arbitrarily close approximations to P and K
by letting the filter run

4.3.6 Kalman Smoothing

1. (Kalman) filter forward through the sample, t = 1, ..., T


2. Smooth backward, t = T, (T 1), (T 2), ..., 1

Initialize: aT,T = aT , PT,T = PT

Then:

at,T = at + Jt (at+1,T at+1,t )

Pt,T = Pt + Jt (Pt+1,T Pt+1,t )Jt0

where
1
Jt = Pt T 0 Pt+1,t

4.4 EXERCISES, PROBLEMS AND COMPLEMENTS

1. Markov process theory.


Prove the following for Markov processes.

(a) Communication is an equivalence relation; i.e., i i (reflexive), i j j i


(symmetric), and i j, j k = i k (transitive).
(b) Any two classes are either disjoint or identical.
(c) Periodicity is a class property.
(d) Let fij denote the probability of an eventual transition from i to j. Then fij =
P n
n=1 fij .
74 CHAPTER 4

(e) The expected number of returns to a recurrent state is infinite, and the expected
number of returns to a transient state is finite. That is,


X
n
State j is recurrent Pjj = ,
n=1
X
n
State j is transient Pjj < .
n=1

(f) Recurrence is a class property. That is, if i is recurrent and i j, then j is


recurrent.
(g) The expected number of transitions into a transient state is finite. That is,

X
j transient = Pijn < , i.
n=1

(h) Positive and null recurrence are class properties.


(i) If the probability distribution of X0 (call it j = P (X0 = j), j 1) is a stationary
distribution, then P (Xt = j) = j , t. Moreover, the process is stationary.
(j) A stationary Markov process is time-reversible iff each path from i to i has the
same probability as the reversed path, i.

2. A Simple Markov Process.


Consider the Markov process:
!
.9 .1
P =
.3 .7

Verify and/or calculate:

(a) Validity of the transition probability matrix


(b) Chapman-Kolmogorov theorem
(c) Accessibility/communication
(d) Periodicity
(e) Transition times
(f) Recurrence/transience
(g) Stationarity
(h) Time reversibility

Solution:
STATE SPACE AND THE KALMAN FILTER 75

(a) See Ross*** or any other good text.


(b) Valid transition probability matrix:

Pij 0 i, j
2
X 2
X
P1j = 1, P2j = 1
j=1 j=1

(c) Illustrating the Chapman-Kolmogorov Theorem:

! ! ! !
3 .9 .1 .9 .1 .9 .1 .804 .196
P = =
.3 .7 .3 .7 .3 .7 .588 .412

(d) Communication and reducibility:


1 2, so the Markov process represented by P is irreducible.
(e) Periodicity:

State 1: d(1) = 1
State 2: d(2) = 1

Hence both states are aperiodic.


(f) First and eventual transition probabilities:
First:

(1)
f12 = .1
(2)
f12 = .9 .1 = .09
(3)
f12 = .92 .1 = .081
(4)
f12 = .93 .1 = .0729

(1)
f12 = .3
(2)
f21 = .7 .3 = .21
(3)
f21 = .72 .3 = .147
(4)
f21 = .73 .3 = .1029

Eventual:

X (n) .1
f12 = f12 = =1
n=1
1 .9
76 CHAPTER 4


X (n) .3
f21 = f21 = =1
n=1
1 .7

(g) Recurrence:
Because f12 = f21 = 1, both states 1 and 2 are recurrent. In addition,
P (n)
11 = n f11 <
Pn=1
(n)
22 = n=1 n f22 <

States 1 and 2 are therefore positive recurrent and (given their aperiodicity es-
tablished earlier) ergodic.
(h) Stationary distribution
We can iterate on the P matrix to see that:
!
.75 .25
lim P n =
n .75 .25
Hence 1 = 0.75 and 2 = 0.25.
Alternatively, in the two-state case, we can solve analytically for the stationary
probabilities as follows.

!
  P11 P12  
1 2 = 1 2
P21 P22

1 P11 + 2 P21 = 1 (1)


=
1 P12 + 2 P22 = 2 (2)

Using 2 = 1 1 , we get from (1) that

1 P11 + (1 1 )P21 = 1

P21
1 =
1 P11 + P21
1 P11
2 =
1 P11 + P21
Thus,
!
n 1 P21 1 P11
lim P =
n (1 P11 + P21 ) P21 1 P11

(i) Time reversibility:


2
P12 = 1 P21 = .1
2
P21 = 1 P12 = .3
We have a time-reversible process.
STATE SPACE AND THE KALMAN FILTER 77

3. AR(p) in state-space form.


Find a state-space representation different from the one used in the text, in which the
state vector is (y1 , ..., yp )0 . This is precisely what one expects given the intuitive idea
of state: in an AR(p) all history relevant for future evolution is (y1 , ..., yp )0 .

4. ARMA(1,1) in state space form.

yt = yt1 + t + t1

t W N (0, 2 )

! ! ! !
1t 1 1,t1 1
= + t
2t 0 0 2,t1

yt = (1, 0) t = 1t

Recursive substitution from the bottom up yields:

! !
yt1 + t1 + t yt
t = =
t t

5. Rational spectra and state space forms.


Can all linear discrete-time systems be written in state-space form? In particular, what
is the relationship, if any, between rational spectra and existence of a state-space form?

6. Impulse-responses and variance decompositions.


If given a model in state space form, how would you calculate the impulse-responses
and variance decompositions?

7. Identification in UCMs.
Discuss the identifying assumption that UC innovations are orthogonal at all leads and
lags. What convenient mathematical properties does it entail for the observed sum of
the unobserved components? In what ways is it restrictive?
Solution: Orthogonality of component innovations implies that the spectrum of the
observed time series is simply the sum of the component spectra. Moreover, the or-
thogonality facilitates identification. The assumption is rather restrictive, however, in
that it entails no interaction between cyclical and secular economic fluctuations.
78 CHAPTER 4

8. ARMA(1,1) Reduced Form of the Signal Plus Noise Model.


Consider the structural model:

xt = yt + ut

yt = yt1 + vt .

Show that the reduced form is ARM A(1, 1):

yt = yt1 + t + t1

and provide expressions for 2 and in terms of the underlying parameters , v2 and
u2 .
Solution:
Box and Jenkins (1976) and Nerlove et al. (1979) show the ARMA result and give the
formula for . That leaves 2 . We will compute var(x) first from the UCM and then
from the ARMA(1,1) reduced form, and equate them.
From the UCM:

v2
var(x) = + u2
1 2
From the reduced form:

(1 + 2 2)
var(x) = 2
1 2
Equating yields
v2 + u2 (1 2 )
2 =
1 + 2 2

9. Properties of optimal extractions.


In the case where the seasonal is modeled as independent of the nonseasonal and
the observed data is just the sum of the two, the following assertions are (perhaps
surprisingly) both true:
i) optimal extraction of the nonseasonal is identically equal to the observed data minus
optimal extraction of the seasonal (i.e., y ys + yn yn ), so it doesnt matter whether
you estimate the nonseasonal by optimally extracting it directly or instead optimally
STATE SPACE AND THE KALMAN FILTER 79

extract the seasonal and substractboth methods yield the same answer;
ii) y
s , the estimated seasonal, is less variable than ys , the true seasonal, and yn , the
estimated nonseasonal, is less variable than yn , the true nonseasonal. It is paradoxical
that, by (ii), both estimates are less variable than their true counterparts, yet, by (i),
they still add up to the same observed series as their true counterparts. The paradox is
explained by the fact that, unlike their true counterparts, the estimates ys and yn are
correlated (so the variance of their sum can be more than the sum of their variances).

4.5 NOTES
Chapter Five

Frequentist Time-Series Likelihood Evaluation, Optimization,

and Inference

5.1 LIKELIHOOD EVALUATION: PREDICTION-ERROR DECOMPOSITION


AND THE KALMAN FILTER

Brute-Force Direct Evaluation:

yt N (, ())

Example: AR(1)

(yt ) = (yt1 ) + t

2
ij () = |ij|
1 2

 
T /2 1/2 1 0 1
L(y; ) = (2) |()| exp (y ) ()(y )
2

1 1
lnL(y; ) = const ln|()| (y )0 1 () (y )
2 2
T xT matrix () can be very hard to calculate (we need analytic formulas for the auto-
covariances) and invert (numerical instabilities and inaccuracies; slow even if possible)
Prediction-error decomposition and the Kalman filter:
Schweppes prediction-error likelihood decomposition is:

T
Y
L(y1 , . . . , yT ; ) = Lt (yt |yt1 , . . . , y1 ; )
t=1
or:
T
X
ln L(y1 , . . . , yT ; ) = ln Lt (yt |yt1 , . . . , y1 ; )
t=1
MAXIMUM LIKELIHOOD 81

Prediction-error decomposition
In the univariate Gaussian case, the Schweppe decomposition is

T T
T 1X 1 X (yt t )2
ln L = ln 2 ln t2
2 2 t=1 2 t=1 t2

T T
T 1X 1 X vt2
= ln 2 ln Ft
2 2 t=1 2 t=1 Ft

Kalman filter delivers vt and Ft !


No autocovariance calculation or matrix inversion!
In the N -variate Gaussian case, the Schweppe decomposition is
T T
NT 1X 1X
ln L = ln 2 ln |t | (yt t )0 1
t (yt t )
2 2 t=1 2 t=1

T T
NT 1X 1 X 0 1
= ln 2 ln |Ft | v F vt
2 2 t=1 2 t=1 t t

Kalman filter again delivers vt and Ft .


Only the small matrix Ft (N N ) need be inverted.

5.2 GRADIENT-BASED LIKELIHOOD MAXIMIZATION: NEWTON AND


QUASI-NEWTON METHODS

The key is to be able to evaluate lnL for a given parameter configuration


Then we can climb uphill to maximize lnL to get the MLE
Crude Search
Function lnL() to be optimized w.r.t. ,
, a compact subset of Rk

Deterministic search: Search k dimensions at r locations in each dimension.

Randomized Search: Repeatedly sample from , repeatedly evaluating lnL()

Absurdly slow (curse of dimensionality)

5.2.1 The Generic Gradient-Based Algorithm

So use the gradient for guidance.


Gradient-Based Iterative Algorithms (Line-Search)
Parameter vector at iteration m: (m) .
82 CHAPTER 5

(m+1) = (m) + C (m) , where C (m) is the step.


Gradient algorithms: C (m) = t(m) D(m) s(m)
t(m) is the step length, or step size (a positive number)
D(m) is a positive definite direction matrix
s(m) is the score (gradient) vector evaluated at (m)
General Algorithm

1. Specify (0)

2. Compute D(m) and s(m)

3. Determine step length t(m)


(Often, at each step, choose t(m) to optimize the objective function (variable step
length))

4. Compute (m+1)

5. If convergence criterion not met, go to 2.

Convergence
Convergence Criteria
k s(m) k small
k (m) (m1) k small
Convergence Rates

k (m+1) k
p such that limm p
k (m) k
= O(1)
Method of Steepest Decent
Use D(m) = I, t(m) = 1, m.
Properties:

1. May converge to a critical point other than a minimum


(of course)

2. Requires only first derivative of the objective function

3. Very slow to converge (p = 1)

5.2.2 Newton Algorithm

Take D(m) as the inverse Hessian of lnL() at (m)

1
2 lnL 2 lnL
|
12 (m)
. . . 1 k | (m)


.

D(m) = H 1(m) = .




.

2 lnL 2 lnL
k 1 | (m) . . . k 2 | (m)
MAXIMUM LIKELIHOOD 83

Also take t(m) = 1


Then (m+1) = (m) H 1(m) s(m)
Derivation From Second-Order Taylor Expansion
Initial guess: (0)
lnL() lnL((0) ) + s(0) ( (0) ) + 12 ( (0) )0 H (0) ( (0) )
F.O.C.:
s(0) + H (0) ( (0) ) = 0
or
= (0) H 1(0) s(0)
Properties of Newton
lnL() quadratic full convergence in a single iteration
More generally, iterate to convergence:
(m+1) = (m) H 1(m) s(m)
Faster than steepest descent (p = 2 vs. p = 1)
But there is a price:
Requires first and second derivatives of the objective function
Requires inverse Hessian at each iteration

5.2.3 Quasi-Newton Algirithms

e.g., Davidon-Fletcher-Powell (DFP):


D(0) = I
 
D(m) = D(m1) + f D(m1) , (m) , (m) , m = 1, 2, 3, ...

(m) = (m) (m1)


(m) = s(m) s(m1)

Second derivatives arent needed, but first derivatives are

Approximation to Hessian is built up during iteration

If lnL() is quadratic, then D(k) = H, where k = dim()

Intermediate convergence speed (p 1.6)

5.2.4 Line-Search vs. Trust Region Methods: Levenberg-Marquardt

An interesting duality...
Line search: First determine direction, then step
Trust region: First determine step, then direction
Approximate the function locally in a trust region
containing all admissible steps, and then determine direction
Classic example: Levenberg-Marquardt
84 CHAPTER 5

Related R packages:
trust (trust region optimization)
minpack.lm (R interface to Levenberg-Marquardt in MINPACK)

5.3 GRADIENT-FREE LIKELIHOOD MAXIMIZATION: EM

Recall Kalman smoothing


1. Kalman filter the state forward through the sample, t = 1, ..., T
2. Kalman smooth the state backward, t = T, (T 1), (T 2), ..., 1
Initialize:

aT,T = aT

PT,T = PT

Smooth:

at,T = at + Jt (at+1,T at+1,t )

Pt,T = Pt + Jt (Pt+1,T Pt+1,t )Jt0

1
where Jt = Pt T 0 Pt+1,t

Another Related Smoothing Piece, Needed for EM


3. Get smoothed predictive covariance matrices as well:

P(t,t1),T = E[(t at,T )(t1 at1,T )0 ]

Initialize:

P(T,T 1),T = (I KT Z)T PT 1

Then:
0 0
P(t1,t2),T = Pt1 Jt2 + Jt1 (P(t,t1),T T Pt1 )Jt2

where Kt is the Kalman gain.


The EM Data-Augmentation Algorithm Think of {t }Tt=1 as data that are unfortunately
missing in

t = T t1 + t

yt = Zt + t
MAXIMUM LIKELIHOOD 85

Incomplete Data Likelihood:

lnL(y; )

Complete Data Likelihood: (If only we had complete data!)

lnL y, {t }Tt=0 ;


Expected Complete Data Likelihood:

lnL(m) (y; ) E lnL y, {t }Tt=0 ;


 

EM iteratively constructs and maximizes the expected complete-data likelihood, which


(amazingly) has same
maximizer as the (relevant) incomplete-data likelihood.
The EM (Expectation/Maximization) Algorithm
1. E Step:

 
Construct lnL(m) (y; ) E lnL y, {t }Tt=0 ;
2. M Step:

 
(m+1) = argmax lnL(m) (y; }

3. If convergence criterion not met, go to 1


But how to do the E and M steps?

5.3.1 Not-Quite-Right EM
(But it Captures and Conveys the Intuition)

1. E Step:
Approximate a complete data situation by replacing
{t }Tt=0 with at,T from the Kalman smoother
2. M Step:
Estimate parameters by running regressions:
at,T at1,T
yt at,T
3. If convergence criterion not met, go to 1

5.3.2 Precisely Right EM

5.3.2.1 Complete Data Likelihood



The complete data are 0 , {t , yt }Tt=1 .
86 CHAPTER 5

Complete-Data Likelihood:
T
Y T
Y
f (y, 0 , {t }Tt=1 ) = fa0 ,P0 (0 ) fT,Q (t |t1 ) fZ,H (yt |t )
t=1 t=1

Gaussian Complete-Data Log-Likelihood:


1 1
ln L(y, {t }T
t=1 ; ) = const ln |P0 | (0 a0 )0 P01 (0 a0 )
2 2
T
T 1X
ln |Q| (t T t1 )0 Q1 (t T t1 )
2 2 t=1
T
T 1X
ln |H| (yt Zt )0 H 1 (yt Zt )
2 2 t=1

5.3.2.2 E Step
 
Construct: lnL(m) (y; ) E lnL y, {t }Tt=0 ;

h i 1 1 h i
E ln L(y, {t }T
t=0 ; ) = const ln |P0 | E (0 a0 )0 P01 (0 a0 )
2 2
T
T 1X
E (t T t1 )0 Q1 (t T t1 )
 
ln |Q|
2 2 t=1
T
T 1X
E (yt Zt )0 H 1 (yt Zt )
 
ln |H|
2 2 t=1

Function of {at,T ((m) ), Pt,T ((m) ), and P(t,t1),T ((m) )}Tt=1


So the E step is really just running the three smoothers

5.3.2.3 M Step Formulas



Find: (m+1) = argmax lnL(m) (y; )

T
! T !1
X X
T0 = 0 0
   
E t t1 E t1 t1
t=1 t=1

t = (t Tt1 )

T
= 1
X
Q t t0 ]
E [
T t=1

T
! T
!1
0
X X
Z 0 = yt E [t ] E [t t0 ]
t=1 t=1

t)
t = (yt Z
MAXIMUM LIKELIHOOD 87

T
= 1
X
H t 0t ]
E [
T t=1

where:

E [t ] = at|T

E [t t0 ] = at|T a0t|T + Pt|T

0
= at|T a0t1|T + P(t,t1)|T
 
E t t1

Simply replacing t with at,T wont work because E [t t0 |T ] 6= at,T a0t,T


Instead we have E [t t0 |T ] = E [t | T ] E [t |T ]0 + V ar(t |T ) = at,T a0t,T + Pt,T

5.4 LIKELIHOOD INFERENCE

5.4.1 Under Correct Specification

T
X
ln L() = ln Lt ()
t=1

Always true in iid environments

Also holds in time series, via prediction-error decomposition of ln L

Expected Fisher Information


Score at true parameter 0 :
T T
ln L() X ln Lt () X
s(0 ) = = = st (0 )
0 t=1

0 t=1

Expected Fisher Information at true parameter 0 :

2 ln L()
 
IEX,H (0 ) = E
0
0

T  T
2 ln Lt ()
X  X
= EH(0 ) = E = EHt (0 )
0


t=1 0 t=1

More on Expected Information Matrices


PT
(1) We had already: IEX,H (0 ) = t=1 E Ht (0 )
Expected information based on the Hessian
PT 0
(2) Can also form: IEX,s (0 ) = t=1 E st (0 ) st (0 )
Expected information based on the score
(In a moment well see why this is of interest)
Distribution of the MLE Under Correct Specification
88 CHAPTER 5

Under correct specification and regularity conditions,

d


T (M L 0 ) N (0, VEX (0 )) (5.1)

where
 1
IEX,H (0 )
VEX (0 ) = VEX,H (0 ) = plimT
T

 1
IEX,s (0 )
= VEX,s (0 ) = plimT
T

M L consistent, asymptotically normal, asymptotically efficient (Cramer-Rao lower bound


met)
Observed Information Matrices
PT
(1) IOB,H (0 ) = t=1 Ht (0 )
(Observed information based on the Hessian)
PT 0
(2) IOB,s (0 ) = t=1 st (0 ) st (0 )
(Observed information based on the score)
In a moment well see why these are of interest.
Consistent Estimators of VEX (0 )

!1 !1
IEX,H (M L ) IEX,s (M L )
VEX,H (0 ) = VEX,s (0 ) =
T T

!1 !1
IOB,H (M L ) IOB,s (M L )
VOB,H (0 ) = VOB,s (0 ) =
T T

Under correct specification, plimT VEX,H (0 ) = plimT VEX,s (0 ) = VEX (0 )


plimT VOB,H (0 ) = plimT VOB,s (0 ) = VEX (0 )

5.4.2 Under Possible Mispecification

5.4.2.1 Distributional Misspecification

Under possible distributional misspecification (but still assuming correct conditional mean
and variance function specifications),

d

T (M L 0 ) N (0, VEX
m
(0 )) (5.2)
MAXIMUM LIKELIHOOD 89

where:
m
VEX (0 ) = VEX,H (0 )1 VEX,s (0 )VEX,H (0 )1

Quasi MLE or Pseudo-MLE


Under correct specification: (5.2) collapses to standard result (5.1)
Under distributional misspecification:
M L consistent, asymptotically normal, asymptotically inefficient (CRLB not met), but we
can nevertheless do credible
(if not fully efficient) inference
m
Consistent estimators of VEX (0 ):

!1 ! !1
IEX,H (M L ) IEX,s (M L ) IEX,H (M L )
VEX
m
(0 ) =
T T T

!1 ! !1
IOB,H (M L ) IOB,s (M L ) IOB,H (M L )
VOB
m
(0 ) =
T T T

Sandwich Estimator

5.4.2.2 General Misspecification

Under possible general mispecification,

d

m
T (M L ) N (0, VEX ( )) (5.3)

where:
m
VEX ( ) = VEX,H ( )1 VEX,s ( )VEX,H ( )1

Under correct specification: Collapses to standard result (5.1)


Under purely distributional specification: Collapses to result (5.2)
Under general misspecification:

M L consistent for KLIC-optimal pseudo-true value ,


asymptotically normal, and we can do credible inference
m
Consistent estimators of VEX ( ):

!1 ! !1
IEX,H (M L ) IEX,s (M L ) IEX,H (M L )
VEX
m
( ) =
T T T
90 CHAPTER 5

!1 ! !1
IOB,H (M L ) IOB,s (M L ) IOB,H (M L )
VOB
m
( ) =
T T T

5.5 EXERCISES, PROBLEMS AND COMPLEMENTS

1. Approximate (asymptotic) frequency domain Gaussian likelihood


Recall that for Gaussian series we have as T :
d
2f(j )
xj = 22
f (j ; )

where f (j ; ) is the spectral density and the 22 random variables are independent
across frequencies
2j T
j = , j = 0, 1, ...,
T 2
MGF of any one of the xj s is
1
Mx (t) =
1 2t

Let
f (j ; ) xj
yj = f(j ) =
2

 
f (j ; ) 1
My (t) = Mx t =
2 1 f (j ; ) t

This is the MGF of exponential rv with parameter 1/f (j ; ).


f (j )
1
g(f(j ); ) = e f (j ;)
f (j ; )

Univariate asymptotic Gaussian log likelihood:

T /2 T /2
X X f(j )
ln L(f; ) = ln f (j ; )
j=0 j=0
f (j ; )

Multivariate asymptotic Gaussian log likelihood:


MAXIMUM LIKELIHOOD 91


T /2 T /2
X X
ln L(f; ) = ln |F (j ; )| trace F 1 (j ; ) F (j )
j=0 j=0

2. State space model fitting by exact Gaussian pseudo-MLE using a prediction-error


decomposition and the Kalman filter.
Read Aruoba et al. (2013), and fit the block-diagonal dynamic-factor model (3)-(4) by
exact Gaussian pseudo-MLE using a predecition-error decomposition and the Kalman
filter. Obtain both filtered and smoothed estimates of the series of states. Compare
them to each other, to the raw GDPE and GDPI series, and to the current vintage
of GDPplus from FRB Philadelphia.

3. Method of scoring
Slight variation on Newton:
Use E(H (m) )1 rather than H 1(m)


(Expected rather than observed Hessian.)

4. Constrained optimization.

(a) Substitute the constraint directly and use Slutskys theorem.


To keep a symmetric matrix nonnegative definite, write it as P P 0
To keep a parameter in [0, 1], write it as p2 /(1 + p2 ).
(b) Barrier and penalty functions

5.6 NOTES
Chapter Six

Simulation for Economic Theory, Econometric Theory,

Estimation, Inference, and Optimization

6.1 GENERATING U(0,1) DEVIATES

Criteria for (Pseudo-) Random Number Generation

1. Statistically independent

2. Reproducible

3. Non-repeating

4. Quickly-generated

5. Minimal in memory requirements

The Canonical Problem: Uniform (0,1) Deviates


Congruential methods
a = b(mod m)
a is congruent to b modulo m
(a b) is an integer multiple of m
Examples:
255 = 5(mod50)
255 = 5(mod10)
123 = 23(mod10)

Key recursion: xt = axt1 (mod m)


To get xt , just divide axt1 by m and keep the remainder
Multiplicative Congruential Method

xt = axt1 (mod m), xt , a, m Z+

Example:
SIMULATION 93

Figure 6.1: Ripleys Horror Plots of pairs of (Ui+1 , Ui ) for Various Congruential Gener-
ators Modulo 2048 (from Ripley, 1987)

xt = 3xt1 (mod 16), x0 = 1

x0 = 1, x1 = 3, x2 = 9, x3 = 11, x4 = 1, x5 = 3, ...

Perfectly periodic, with a period of 4.


Generalize:

xt (axt1 + c)(mod m) (xt , a, c, m Z+ )

Remarks

xt
1. xt [0, m 1], t. So take xt = m, t

2. Pseudo-random numbers are perfectly periodic.

3. The maximum period, m, can be attained using the mixed congruential generator if:

c and m have no common divisor


a = 1(mod p) prime factors p of m
a = 1(mod 4) if m is a multiple of 4

4. m is usually determined by machine wordlength; e.g., 264

5. Given U (0, 1) , U (, ) is immediate


94 CHAPTER 6

Figure 6.2: Transforming from U(0,1) to f (from Davidson and MacKinnon, 1993)

6.2 THE BASICS: C.D.F. INVERSION, BOX-MUELLER, SIMPLE ACCEPT-


REJECT

6.2.1 Inverse c.d.f.

Inverse cdf Method (Inversion Methods)


Desired density: f (x)

1. Find the analytical c.d.f., F (x), corresponding to f (x)

2. Generate T U (0, 1) deviates {r1 ,...rT }

3. Calculate {F1 (r1 ),..., F1 (rT )}

Graphical Representation of Inverse cdf Method


Example: Inverse cdf Method for exp() Deviates
f (x) = ex where > 0, x 0
Rx
F (x) = 0 et dt
x
t
= e = ex + 1 = 1 ex
o
ln(1 F (x))
Hence ex = 1 F (x) so x =
Then insert a U (0, 1) deviate for F (x)
Complications Analytic inverse cdf not always available (e.g., N (0, 1) distribution).

Approach 1: Evaluate the cdf numerically

Approach 2: Use a different method


e.g., CLT approximation:
P 
12
Take i=1 Ui (0, 1) 6 for N (0, 1)
SIMULATION 95

6.2.2 Box-Muller

An Efficient Gaussian Approach: Box-Muller


Let x1 and x2 be i.i.d. U (0, 1), and consider

y1 = 2 ln x1 cos(2x2 )

y2 = 2 ln x1 sin(2x2 )
Find the distribution of y1 and y2 . We know that


x1 x1
y1 y2
f (y1 , y2 ) = f (x1 , x2 )

x2 x2

y1 y2

1 2 2
 
y2
Box-Muller (Continued) Here we have x1 = e 2 (y1 +y2 ) and x2 = 1
2 arctan y1


x1 x1   

y1 y2
1 y12 /2 1 y22 /2
Hence = e e

x2 x2
y1 y2
2 2

Bivariate density is the product of two N (0, 1) densities, so we have generated two inde-
pendent N (0, 1) deviates.
Generating Deviates Derived from N(0,1)

21 = [N (0, 1)]2
Pd
2d = i=1 [Ni (0, 1)]2 , where the Ni (0, 1) are independent
N (, 2 ) = + N (0, 1)
p
td = N (0, 1)/ x2d /d, where N (0, 1) and 2d are independent
Fd1 ,d2 = 2d1 /d1 /2d2 /d2 where 2d1 and 2d2 are independent
Multivariate Normal
N (0, I) (N -dimensional) Just stack N N (0, 1)s
N (, ) (N -dimensional)
Let P P 0 = (P is the Cholesky factor of )
Let X N (0, I). Then P X N (0, )
To sample from N (, ), take + P X

6.2.3 Simple Accept-Reject

Accept-Reject
(Naive but Revealing Example)
We want to sample x f (x)
Draw:

1 U (, )
96 CHAPTER 6

Figure 6.3: Naive Accept-Reject Method

2 U (0, h)

If 1 , 2 lies under the density f (x), then take x = 1


Otherwise reject and repeat
Graphical Representation of Naive Accept-Reject
Accept-Reject
General (Non-Naive) Case
We want to sample x f (x) but we only know how to sample x g(x).
f (x)
Let M satisfy g(x) M < , x. Then:

1. Draw x0 g(x)

f (x0 )
2. Take x = x0 w.p. g(x0 )M ; else go to 1.

(Allows for blanket functions g() more efficient than the uniform)
Note that accept-reject requires that we be able to evaluate f (x) and g(x) for any x.
Mixtures
On any draw i,

x fi (x), w.p. pi

where

0 pi 1, i

N
X
pi = 1
i=1
SIMULATION 97

For example, all of the fi could be uniform, but with different location and scale.

6.3 SIMULATING EXACT AND APPROXIMATE REALIZATIONS OF TIME


SERIES PROCESSES

Simulating Time Series Processes


VAR(1) simulation is key (state transition dynamics).

1. Nonparametric: Exact realization via Cholesky factorization of desired covariance ma-


trix. One need only specify the autocovariances.

2. Parametric I: Exact realization via Cholesky factorization of covariance matrix corre-


sponding to desired parametric model

3. Parametric II: Approximate realization via arbitrary startup value with early realiza-
tion discarded

4. Parametric III: Exact realization via drawing startup values from unconditional den-
sity

6.4 MORE

Slice Sampling
Copulas and Sampling From a General Joint Density

6.5 ECONOMIC THEORY BY SIMULATION: CALIBRATION

6.6 ECONOMETRIC THEORY BY SIMULATION: MONTE CARLO AND


VARIANCE REDUCTION

Monte Carlo
Key: Solve deterministic problems by simulating stochastic analogs, with the analytical
unknowns reformulated as parameters to be estimated.
Many important discoveries made by Monte Carlo.
Also, numerous mistakes avoided by Monte Carlo!
The pieces:
(I) Experimental Design
(II) Simulation (including variance reduction techniques)
(III) Analysis: Response surfaces (which also reduce variance)
98 CHAPTER 6

6.6.1 Experimental Design

(I) Experimental Design

Data-Generating Process (DGP), M ()

Objective
e.g., MSE of an estimator:

2 ] = g(, T )
E[( )

e.g., Power function of a test:

= g(, T )

Experimental Design, Continued

Selection of (, T ) Configurations to Explore


a. Do we need a full design? In general many values of and T need be explored.
But if, e.g., g(, T ) = g1 () + g2 (T ), then only explore values for a single T , and T
values for a single (i.e., there are no interactions).
b. Is there parameter invariance (g(, T ) unchanging in )? e.g., If y = X + ,
2
M LE
M
N (0, 2 ()), then the exact finite-sample distributions of and LE
2
are invariant to true , 2 . So vary only , leaving and alone (e.g., set to 0 and
1). Be careful not to implicitly assume invariance regarding unexplored aspects of the
design (e.g., structure of X variables above.)

Experimental Design, Continued

Number of Monte Carlo Repetitions (N )


e.g., MC computation of test size
#rej N
i=1 I(reji )
nominal size 0 , true size , estimator
= N = N

a  
(1 )
N ,
N ormal approximation :
N

" r #!
(1 )
P 1.96
= .95
N

Suppose we want the 95% CI for to be .01 in length.


SIMULATION 99

Experimental Design, Continued


Strategy 1 (Use = 0 ; not conservative enough if > 0 ):

r
0 (1 0 )
2 1.96 = .01
N
If 0 = .05, N = 7299
1
Strategy 2 (Use = 2 = argmax [(1 )]; conservative):

s
1 1

2 2
2 1.96 = .01 N = 38416
N
Strategy 3 (Use =
; the obvious strategy)

6.6.2 Simulation

(II) Simulation
Running example: Monte Carlo integration
R1
Definite integral: = 0 m(x)dx
Key insight:
R1
= 0 m(x)dx = E(m(x))
x U (0, 1)
Notation:
= E[m(x)]
2 = var(m(x))
Direct Simulation:
Arbitrary Function, Uniform Density
Generate N U (0, 1) deviates xi , i = 1, ..., N
Form the N deviates mi = m(xi ), i = 1, ..., N

N
1 X
= mi
N i=1

d

N ( ) N (0, 2 )

Direct Simulation General Case:


Arbitrary Function, Arbitrary Density

Z
= E(m(x)) = m(x)f (x)dx
100 CHAPTER 6

Indefinite integral, arbitrary function m(), arbitrary density f (x)


Draw xi f (), and then form mi (xi ),
N
1 X
= mi
N i=1

d

N ( ) N (0, 2 )

Direct Simulation Leading Case


Mean Function, Arbitrary Density
(e.g., Posterior Mean)

Z
= E(x) = xf (x)dx

Indefinite integral, x has arbitrary density f (x)


Draw xi f ()
N
1 X
= xi
N i=1

d


N ( ) N (0, 2 )

6.6.3 Variance Reduction: Importance Sampling, Antithetics, Control Variates


and Common Random Numbers

Importance Sampling to Facilitate Sampling


Sampling from f () may be difficult. So change to:
Z
f (x)
= x g(x)dx
g(x)
where the importance sampling density g() is easy to sample
f (xi )
Draw xi g(), and then form mi = g(xi ) xi , i = 1, ..., N
N N N
1 X 1 X f (xi ) X
= mi = xi = wi xi
N i=1 N i=1 g(xi ) i=1

d


N ( ) N (0, 2 )
SIMULATION 101

Avg of f (x) draws replaced by weighted avg of g(x) draws


Weight wi reflects relative heights of f (xi ) and g(xi )
Importance Sampling
Consider the classic problem of calculating the mean E(y) of r.v. y with marginal density:

Z
f (y) = f (y/x)f (x)dx.

The standard solution is to form:

N
1 X
E(y)
b = f (y|xi )
N i=1

where the xi are iid draws from f (x).


But f (x) might be hard to sample from! What to do?
Importance Sampling
Write
Z
f (x)
f (y) = f (y|x) g(x)dx,
I(x)
where the importance sampler, g(x), is easy to sample from.
Take
N f (xi ) N
I(xi )
X X
E(y)
b = PN f (xj ) f (y|xi ) = wi f (y|xi ).
i=1 j=1 g(xj ) i=1

So importance sampling replaces a simple average of f (y|xi ) based on initial draws from
f (x) with a weighted average of f (y|xi ) based on initial draws from g(x), where the weights
wi reflect the relative heights of f (xi ) and g(xi ).
Indirect Simulation
Variance-Reduction Techniques
(Swindles)
Importance Sampling to Achieve Variance Reduction
Again we use:
Z
f (x)
= x g(x)dx,
g(x)
and again we arrive at

d


N ( ) N (0, 2 )

If g(x) is chosen judiciously, 2  2


102 CHAPTER 6

xf (x)
Key: Pick g(x) s.t. g(x) has small variance
Importance Sampling Example
Let x N (0, 1), and estimate the mean of I(x > 1.96):
Z
= E(I(x > 1.96)) = P (x > 1.96) = I(x > 1.96) (x) dx
| {z } |{z}
m(x) f (x)

N
X I(xi > 1.96)
= (with variance 2 )
i=1
N

Use importance sampler:

g(x) = N (1.96, 1)
Z
I(x > 1.96) (x)
P (x > 1.96) = g(x) dx
g(x)

PN I(xi >1.96) (xi )


i=1 g(xi )
= (with variance 2 )
N

2
0.06
2
Antithetic Variates
We average negatively correlated unbiased estimators of (Unbiasedness maintained,
variance reduced)
The key: If x symmetric(, v), then xi are equally likely
e.g., if x U (0, 1), so too is (1 x)
e.g., if x N (0, v), so too is x
Consider for example the case of zero-mean symmetric f (x)
Z
= m(x)f (x)dx

N
1 X
Direct : = mi , ( is based on xi , i = 1, ..., N )
N i=1

1 1
Antithetic : = (x) + (x)
2 2
((x) is based on xi , i = 1, ..., N/2 , and
(x) is based on xi , i = 1, ..., N/2)
Antithetic Variates, Contd
SIMULATION 103

More concisely,
N/2
2 X
= ki (xi )
N i=1

where:
1 1
ki = m(xi ) + m(xi )
2 2

d


N ( ) N (0, 2 )

1 1 1
2 = var (m(x)) + var (m(x)) + cov (m(x), m(x))
4 4 2 | {z }
<0 f or m monotone incr.

Often 2  2

Z Z Z
= m(x)f (x)dx = g(x)f (x)dx + [m(x) g(x)]f (x)dx

Control function g(x) simple enough to integrate analytically and flexible enough to absorb
most of the variation in m(x).

We just find the mean of m(x)g(x), where g(x) has known mean and is highly correlated
with m(x).
Control Variates

Z N
1 X
= g(x)dx + [m(xi ) g(xi )]
N i=1

d

N ( ) N (0, 2 )

If g(x) is chosen judiciously, 2  2 .

Related method (conditioning): Find the mean of E(z|w) rather than the mean of z. The
two are of course the same (the mean conditional mean is the unconditional mean), but
var(E[z|w]) var(z).
Control Variate Example

Z 1
f (x) = ex dx
0
104 CHAPTER 6

Control variate: g(x) = 1 + 1.7x


Z 1 
1.7 2 1

g(x)dx = x+ x = 1.85

0 2
0

N
1 X xi
direct = e
N i=1

N
1 X xi
cv = 1.85 + [e (1 + 1.7xi )]
N i=1

var(direct )
78
var(CV )
Common Random Numbers
We have discussed estimation of a single integral:
Z 1
f1 (x)dx
0

But interest often centers on difference (or ratio) of the two integrals:

Z 1 Z 1
f1 (x)dx f2 (x)dx
0 0

The key: Evaluate each integral using the same random numbers.
Common Random Numbers in Estimator Comparisons
; true parameter 0
Two estimators ,
Compare MSEs: E( 0 )2 , E( 0 )2 
Expected difference: E ( 0 )2 ( 0 )2
Estimate:
N
1 X  2

(i 0 )2 (i 0 )
N i=1

Variance of estimate:
1   1   2  
var ( 0 )2 + var ( 0 )2 cov ( 0 )2 , ( 0 )2
N N N

Extensions...

Sequential importance sampling: Builds up improved proposal densities across draws


SIMULATION 105

6.6.4 Response Surfaces

(III) Response surfaces

1. Direct Response Surfaces

2. Indirect Responses Surfaces:

Clear and informative graphical presentation


Variance reduction
Imposition of known asymptotic results
(e.g., power 1 as T )
Imposition of known features of functional form
(e.g. power [0,1])

Example: Assessing Finite-Sample Test Size

= P (s > s |T, H0 true) = g(T )

( is empirical size, s is test statistic, s is asymptotic c.v.)


rej

=
N
 
(1 )
N
,
N
or


= + = g(T ) +

 
g(T )(1 g(T ))
N 0,
N
Note the heteroskedasticity: variance of changes with T .
Example: Assessing Finite-Sample Test Size
Enforce analytically known structure on
.
Common approach:

p
!
i
12
X

= 0 + T c0 + ci T 2 +
i=1

0 is nominal size, which obtains as T . Second term is the vanishing size distortion.
Response surface regression:
106 CHAPTER 6

1 3
0 ) T 2 , T 1 , T 2 , ...
(

Disturbance will be approximately normal but heteroskedastic.


So use GLS or robust standard errors.

6.7 ESTIMATION BY SIMULATION: GMM, SMM AND INDIRECT INFER-


ENCE

6.7.1 GMM

k-dimensional economic model parameter

GM M = argmin d()0 d()

where

m1 () m
1
m2 () m
2

d() =
..

.
mr () m
r

The mi () are model moments and the m


i are data moments.
MM: k = r and the mi () calculated analytically
GMM: k < r and the mi () calculated analytically

Inefficient relative to MLE, but useful when likelihood is not available

6.7.2 Simulated Method of Moments (SMM)

(k r and the mi () calculated by simulation )

Model moments for GMM may also be unavailable (i.e., analytically intractable)

SMM: if you can simulate, you can consistently estimate

Simulation ability is a good test of model understanding


If you cant figure out how to simulate pseudo-data from a given probabilistic
model, then you dont understand the model (or the model is ill-posed)
Assembling everything: If you understand a model you can simulate it, and if you
can simulate it you can estimate it consistently. Eureka!
No need to work out what might be very complex likelihoods even if they are in
principle available.
SIMULATION 107

MLE efficiency lost may be a small price for SMM tractability gained.

SMM Under Misspecification


All econometric models are misspecified.
GMM/SMM has special appeal from that perspective.

Under correct specification any consistent estimator (e.g., MLE or GMM/SMM) takes
you to the right place asymptotically, and MLE has the extra benefit of efficiency.

Under misspecification, consistency becomes an issue, quite apart from the secondary
issue of efficiency. Best DGP approximation for one purpose may be very different
from best for another.

GMM/SMM is appealing in such situations, because it forces thought regarding which


moments M = {m1 (), ..., mr ()} to match, and then by construction it is consistent
for the M -optimal approximation.

SMM Under Misspecification, Continued

In contrast, pseudo-MLE ties your hands. Gaussian pseudo-MLE, for example, is con-
sistent for the KLIC-optimal approximation (1-step-ahead mean-squared prediction
error).

The bottom line: under misspecification MLE may not be consistent for what you
want, whereas by construction GMM is consistent for what you want (once you decide
what you want).

6.7.3 Indirect Inference

k-dimensional economic model parameter


> k-dimensional auxiliary model parameter

IE = argmin d()0 d()

where
1 () 1


2 () 2

d() =
..

.

d () d

i () are est. params. of aux. model fit to simulated model data


108 CHAPTER 6

i are est. params. of aux. model fit to real data

Consistent for true if economic model correctly specified


Consistent for pseudo-true otherwise
We introduced Wald form; also LR and LM forms
Ruge-Murcia (2010)

6.8 INFERENCE BY SIMULATION: BOOTSTRAP

6.8.1 i.i.d. Environments

Simplest (iid) Case


iid
T
{xt }t=1 (, 2 )

100 percent confidence interval for :


(x) (x)
xT u(1+)/2 ,
I = [ T u(1)/2 ]
x
T T

T
1X
x
T = xt , 2 (x) = E(x )2
T t=1

!
xT )
(
u solves P u =

T

Exact interval, regardless of the underlying distribution.


Operational Version

(x) (x)
(1+)/2 , x
xT u
I = [ (1)/2 ]
T u
T T

T
1 X
2 (x) =
T )2
(xt x
T 1 t=1


xT )
(
u
solves P
(x)
u
=

T

Classic (Gaussian) example:


(x)
T t(1)/2
I=x
T
SIMULATION 109

Bootstrap approach: No need to assume Gaussian data.


Percentile Bootstrap
xT )
(
Root : S =

T

!
xT )
(
Root c.d.f. : H(z) = P z

T

(j) T
1. Draw {xt }t=1 with replacement from {xt }Tt=1
(j)
T
x xT
2. Compute
(x)

T

(j)
T
x xT
3. Repeat many times and build up the sampling distribution of
(x)

which is an
T
T
x
approximation to the distribution of
T

Russian doll principle


Percentile Bootstrap, Continued
Bootstrap estimator of H(z):


(j)
xT x
( T )
H(z) = P
(x)
z

T

Translates into bootstrap 100 percent CI:

(x) (x)
I = [ (1+)/2 , x
xT u (1)/2 ]
T u
T T
!
(j)
xT x
( T ) u ) =
where P
(x)
u
= H(

T

Percentile-t Bootstrap
xT )
(
S=
(x)

T


xT )
(
H(z) = P
(x)
z

T


(j)
xT x
( T )
H(z) =P (x(j) )

z

T
110 CHAPTER 6


(x) (x)
I = [ (1+)/2 , x
xT u (1)/2 ]
T u
T T

(j)
(
x T x
T)
P (j)
u
=

(x )

T

Percentile-t Bootstrap, Continued


Key Insight:
(j)
Percentile: x
T changes across bootstrap replications
(j)
Percentile-t: both x (x(j) ) change across bootstrap replications
T and
Effectively, the percentile method bootstraps the parameter, whereas the percentile-t boot-
straps the t statistic
Key Bootstrap Property: Consistent Inference
Real-world root:
d
S D (as T )

Bootstrap-world root:

d

S D (as T, N )

Bootstrap consistent (valid, first-order valid) if D = D .


Holds under regularity conditions.
But Arent There Simpler ways to do Consistent Inference?
Of Course. BUT:

1. Bootstrap idea extends mechanically to much more complicated models

2. Bootstrap can deliver higher-order refinements


(e.g., percentile-t)

3. Monte Carlo indicates that bootstrap often does very well in finite samples (not un-
related to 2, but does not require 2)

4. Many variations and extensions of the basic bootstraps

6.8.2 Time-Series Environments

Stationary Time Series Case Before:


xT )
(
1. Use S =
(x)

T

(j) T
2. Draw {xt }t=1 with replacement from {xt }Tt=1
SIMULATION 111

Issues:

(x) with 2fx (0),


1. Inappropriate standardization of S for dynamic data. So replace
where fx (0) is a consistent estimator of the spectral density of x at frequency 0.
(j) T
2. Inappropriate to draw {xt }t=1 with replacement for dynamic data. What to do?

Non-Parametric Time Series Bootstrap


(Overlapping Block Sampling)
Overlapping blocks of size b in the sample path:

t = (xt , ..., xt+b1 ), t = 1, ..., T b + 1


b+1
Draw k blocks (where T = kb) from {t }Tt=1 :
(j) (j)
1 , ..., k
(j) (j) (j) (j)
Concatenate: (x1 , ..., xT ) = (1 ...k )
Consistent if b as T with b/T 0
AR(1) Parametric Time Series Bootstrap

xt = c + xt1 + t , t iid

and save residuals, {et }T


1. Regress xt (c, xt1 ) to get c and , t=1

(j)
2. Draw {t }Tt=1 with replacement from {et }Tt=1
(j)
3. Draw x0 from {xt }Tt=1
(j) (j) + (j) , t = 1, ..., T
4. Generate xt = c + x t1 t

(j) (j)
5. Regress xt (c, xt1 ) to get c(j) and (j) , associated t-statistics, etc.

6. Repeat j = 1, ..., R, and build up the distributions of interest

General State-Space Parametric Time Series Bootstrap


Recall the prediction-error state space representation:

at+1/t = T at/t1 + T Kt vt

yt = Zat/t1 + vt
1. Estimate system parameters . (We will soon see how to do this.)
2. At the estimated parameter values , run the Kalman filter to get the corresponding 1-step-ahead
prediction errors vt (0, Ft ) and standardize them to u 1/2 vt (0, I), where
t = t
0 = Ft .
t t
112 CHAPTER 6

(j) (j) T (j) T


3. Draw {ut }T ut }T
t=1 with replacement from { t=1 and convert to {vt }t=1 = {t ut }t=1 .
(j) (j)
4. Using the prediction-error draw {vt }T T
t=1 , simulate the model, obtaining {yt }t=1 .

5. Estimate the model, obtaining (j) and related objects of interest.

6. Repeat j = 1, ..., R, simulating the distributions of interest.

Many Variations and Extensions...


Stationary block bootstrap: Blocks of random (exponential) length
Wild bootstrap: multiply bootstrap draws of shocks randomly by 1 to enforce symmetry
Subsampling

6.9 OPTIMIZATION BY SIMULATION

Markov chains yet again.

6.9.1 Local
Using MCMC for MLE (and Other Extremum Estimators)
Chernozukov and Hong show how to compute extremum estimators as mean of pseudo-posterior distri-

butions, which can be simulated by MCMC and estimated at the parametric rate 1/ N , in contrast to the
much slower nonparametric rates achievable (by any method) by the standard posterior mode extremum
estimator.

6.9.2 Global
Summary of Local Optimization:

1. initial guess (0)


2. while stopping criteria not met do
3. select (c) N ((m) ) (Classically: use gradient)
4. if lnL((c) ) lnL((m) ) > 0 then (m+1) = (c)
5. end while

Simulated Annealing
(Illustrated Here for a Discrete Parameter Space)
Framework:

1. A set , and a real-valued function lnL (satisfying regularity conditions) defined on . Let
be the set of global maxima of lnL
2. (m) , a set N ((m) ) (m) , the set of neighbors of (m)
3. A nonincreasing function, T (m) : N (0, ) (the cooling schedule), where T (m) is the temper-
ature at iteration m
4. An initial guess, (0)

Simulated Annealing Algorithm

1. initial guess (0)


2. while stopping criteria not met do
3. select (c) N ((m) )
SIMULATION 113

4. if > 0 or exp (/T (m)) > U (0, 1) then (m+1) = (c)


5. end while
Note the extremes:

T = 0 implies no randomization (like classical gradient-based)

T = implies complete randomization (like random search)

A (Heterogeneous) Markov Chain


If (c)
/ N ((m) ) then
P ((m+1) = (c) |(m) ) = 0
If (c) N ((m) ) then
P ((m+1) = (c) | (m) ) = exp (min[0, /T (m)])
Convergence of a Global Optimizer
Definition. We say that the simulated annealing algorithm converges if
limm P [(m) ] = 1.
Definition: We say that (m) communicates with at depth d if there exists a path in (with each
element of the path being a neighbor of the preceding element) that starts at (m) and ends at some element
of , such that the smallest value of lnL along the path is lnL((m) ) d.
Convergence of Simulated Annealing
Theorem: Let d be the smallest number such that every (m) communicates with at depth d .
Then the simulated annealing algorithm converges if and only if, as m ,
T (m) 0
and
exp(d /T (m)) .
P

Problems: How to choose T , and moreover we dont know d


Popular choice of cooling function: T (m) = ln 1m
Regarding speed of convergence, little is known

6.9.3 Is a Local Optimum Global?


1. Try many startup values (sounds trivial but very important)
2. At the end of it all, use extreme value theory to assess the likelihood that the local optimum is global
(Vealls Method)

Rk
lnL() is continuous
lnL( ) is the unique finite global max of lnL(),
H( ) exists and is nonsingular
is a local max
lnL()
Develop statistical inference for
Draw {i }Ni=1 uniformly from and form {lnL(i )}i=1
N

lnL1 first order statistic, lnL2 second order statistic


P [lnL( ) (lnL1 , lnL )] = (1 ), as N
where
lnL = lnL1 + lnL1 lnL 2
2
.
(1) k 1
114 CHAPTER 6

6.10 INTERVAL AND DENSITY FORECASTING BY SIMULATION

6.11 EXERCISES, PROBLEMS AND COMPLEMENTS

1. Convex relaxation.
Our approaches to global optimization involved attacking a nasty objective function with methods
involving clever randomization. Alternatively, one can approximate the nasty objective with a friendly
(convex) objective, which hopefully has the same global optimum. This is called convex relaxation,
and when the two optima coincide we say that the relaxation is tight.

6.12 NOTES
Chapter Seven

Bayesian Time Series Posterior Analysis by Markov Chain Monte

Carlo

7.1 BAYESIAN BASICS

7.2 COMPARATIVE ASPECTS OF BAYESIAN AND FREQUENTIST PARADIGMS

Overarching Paradigm (T )

T ( ) N (0, )
Shared by classical and Bayesian, but interpretations differ.
Classical: random, fixed
Bayesian: fixed, random
Classical: Characterize the distribution of the random data () conditional on fixed true . Focus on

the likelihood max (M L ) and likelihood curvature in an -neighborhood of the max.
Bayesian: Characterize the distribution of the random conditional on fixed true data (). Examine
the entire likelihood.
Bayesian Computational Mechanics
Data y {y1 , . . . , yT }
Bayes Theorem:
f (y/)f ()
f (/y) =
f (y)
or
f (/y) = c f (y/)f ()
where c1 = f (y/)f ()
R

f (/y) f (y/)f ()
p(/y) L(/y)g()
posterior likelihood prior
Classical Paradigm (T )
1 !


d IEX,H ()
T (M L ) N 0,
T

or more crudely


T (M L ) N (0, )

(Enough said.)
Bayesian Paradigm (T )
116 CHAPTER 7

(Note that as T , p(/y) L(/y),


so the likelihood below can be viewed as the posterior.)

Expand lnL(/y) around fixed M L :


lnL(/y) lnL(M L /y) + S(M L /y)0 ( M L )
1/2( M L )0 IOB,H (M L /y)( M L )

But S(M L /y) 0, so:


lnL(/y) lnL(M L /y) 1/2( M L )0 IOB,H (M L /y)( M L )

Exponentiating and neglecting the expansion remainder,


we then have:

L(/y) exp(1/2( M L )0 IOB,H (M L /y)( M L ))


or
L(/y) N (M L , I 1 (M L /y))
OB,H


Or, a posteriori, T ( M L ) N (0, )
Bayesian estimation and model comparison
Estimation:

Full posterior density


Highest posterior density intervals
Posterior mean, median, mode (depending on loss function)

Model comparison:
p(Mi |y) p(y|Mi ) p(Mi )
=
p(Mj |y) p(y|Mj ) p(Mj )
| {z } | {z } | {z }
posterior odds Bayes f actor prior odds

The Bayes factor is a ratio of marginal likelihoods, or marginal data densities.


For comparison, simply report the posterior odds
For selection, invoke 0-1 loss which implies selection of the model with highest posterior probability.
Hence select the model with highest marginal likelihood if prior odds are 1:1.
Understanding the Marginal Likelihood
As a penalized log likelihood:
As T , the marginal likelihood is approximately the maximized log likelihood minus KlnT /2. Its
the SIC!
As a predictive likelihood:

T
Y
P (y) = P (y1 , ..., yT ) = P (yt |y1:t1 )
t=1
T
X
= lnP (y) = lnP (yt |y1:t1 )
t=1
T
X Z
= ln P (yt |, y1:t1 )P (|y1:t1 ) d
t=1
Bayesian model averaging:
Weight by posterior model probabilities:

P (yt+1 |y1:t ) = it P (yt+1 |y1:t , Mi ) + jt P (yt+1 |y1:t , Mj )


BAYES 117

As T , the distinction between model averaging and selection vanishes, as one goes to 0 and the
other goes to 1.
If one of the models is true, then both model selection and model averaging are consistent for the true
model. Otherwise theyre consistent for the X-optimal approximation to the truth. Does X = KLIC?

7.3 MARKOV CHAIN MONTE CARLO

Metropolis-Hastings
We want to draw S values of from p(). Initialize chain at (0) and burn it in.
1. Draw from proposal density q(; (s1) )
2. Calculate the acceptance probability ((s1) , )
3. Set


w.p. ((s1) , ) accept
s
=

(s1) w.p. 1 ((s1) , ) reject

4. Repeat 1-3, s = 1, ..., S


The question, of course, is what to use for step 2.

7.3.1 Metropolis-Hastings Independence Chain


Fixed proposal density:

q(; (s1) ) = q ()
Acceptance probability:
" #
p( = ) q = (s1)

((s1) , ) = min , 1
p( = (s1) ) q ( = )

7.3.2 Metropolis-Hastings Random Walk Chain


Random walk proposals:

= (s1) +
Acceptance probability reduces to:

p( = )
 
((s1) , ) = min ,1
p( = (s1) )

7.3.3 More
Burn-in, Sampling, and Dependence
total simulation = burn-in + sampling
Questions:
How to assess convergence to steady state?
In the Markov chain case, why not do something like the following. Whenever time t is a multiple of m,
use a distribution-free non-parametric (randomization) test for equality of distributions to test whether the
unknown distribution f1 of xt , ..., xt(m/2) equals the unknown distribution f2 of xt(m/2)+1 , ..., xtm . If,
for example, we pick m = 20, 000, then whenever time t is a multiple of 20,000 we would test equality of the
distributions of xt , ..., xt10000 and xt10001 , ..., xt20000 . We declare arrival at the steady state when the
null is not rejected. Or something like that.
118 CHAPTER 7

Of course the Markov chain is serially correlated, but who cares, as were only trying to assess equality of
unconditional distributions. That is, randomizations of xt , ..., xt(m/2) and of xt(m/2)+1 , ..., xtm destroy
the serial correlation, but so what?
How to handle dependence in the sampled chain?
Better to run one long chain or many shorter parallel chains?
A Useful Property of Accept-Reject Algorithms
(e.g., Metropolis)
Metropolis requires knowing the density of interest only up to a constant, because the acceptance prob-
ability is governed by the RATIO p( = )/p( = (s1) ). This will turn out to be important for Bayesian
analysis.
Metropolis-Hastings (Discrete)
For desired , we want to find P such that P = . It is sufficient to find P such that i Pij = j Pji .
Suppose weve arrived at zi . Use symmetric, irreducible transition matrix Q = [Qij ] to generate proposals.
That is, draw proposal zj using probabilities in ith row of Q.
Move to zj w.p. ij , where:
j
1, if i 1


ij =
j otherwise


i

Equivalently, move to zj w.p. ij , where:


 
j
ij = min , 1
i
Metropolis-Hastings, Continued...
This defines a Markov chain P with:


ij Qij , for i 6= j
Pij =
P
1 Pij , for i = j

j6=i

Iterate this chain to convergence and start sampling from .


Blocking strategies: Yu and Meng (2010)
Note that I have set this up to list bibliography at end. It gives a compiling error, but you can skip
through it, and everything looks fine at the end.
Blocking MH algorithms: Ed Herbst Siddhartha Chib and Srikanth Ramamurthy. Tailored randomized
block mcmc methods with application to dsge models. Journal of Econometrics, 155(1):1938, 2010. Vasco
Curdia and Ricardo Reis. Correlated disturbances and u.s. business cycles. 2009. Nikolay Iskrev. Evaluating
the information matrix in linearized dsge models. Economics Letters, 99:607610, 2008. Robert Kohn, Paolo
Giordani, and Ingvar Strid. Adaptive hybrid metropolis-hastings samplers for dsge models. Working Paper,
2010. G. O. Roberts and S.K. Sahu. Updating schemes, correlation structure, blocking and parameterization
for the gibbs sampler. Journal of the Royal Statistical Society. Series B (Methodological), 59(2):291317, 1997.

7.3.4 Gibbs and Metropolis-Within-Gibbs


Bivariate Gibbs Sampling
We want to sample from f (z) = f (z1 , z2 )
Initialize (j = 0) using z20
Gibbs iteration j = 1:
a. Draw z11 from f (z1 |z20 )
b. Draw z21 from f (z2 |z11 )
Repeat j = 2, 3, ....
Theorem (Clifford-Hammersley): limj f (z j ) = f (z)
BAYES 119

Useful if/when conditionals are known and easy to sample from, but joint and marginals are not. (This
happens a lot in Bayesian analysis.)
General Gibbs Sampling
We want to sample from f (z) = f (z1 , z2 , ..., zk )
Initialize (j = 0) using z20 , z30 , ..., zk0
Gibbs iteration j = 1:
a. Draw z11 from f (z1 |z20 , ..., zk0 )
b. Draw z21 from f (z2 |z11 , z30 , ..., zk0 )
c. Draw z31 from f (z3 |z11 , z21 , z40 , ..., zk0 )
...
k. Draw zk1 from f (zk |z11 , ..., zk1
1 )
Repeat j = 2, 3, ....
Again, limj f (z j ) = f (z)
Metropolis Within Gibbs
Gibbs breaks a big draw into lots of little (conditional) steps. If youre lucky, those little steps are simple.
If/when a Gibbs step is difficult, i.e., its not clear how to sample from the relevant conditional, it can be
done by Metropolis.
(Metropolis within Gibbs)
Metropolis is more general but also more tedious, so only use it when you must.
Composition
We may want (x1 , y1 ), ..., (xN , yN ) iid from f (x, y)
Or we may want y1 , ..., yN iid from f (y)
They may be hard to sample from directly.
But sometimes its easy to:
Draw x f (x)
Draw y f (y|x )
Then:
(x1 , y1 ), ..., (xN , yN ) iid f (x, y)
(y1 , ..., yN ) iid f (y)

7.4 CONJUGATE BAYESIAN ANALYSIS OF LINEAR REGRESSION

Bayes for Gaussian Regression with Conjugate Priors


y = X +
iid N (0, 2 I)
Standard results:
M L = (X 0 X)1 X 0 y
2 e0 e

M L =
T
M L N , 2 (X 0 X)1


T
M2
L
2T K
2
Bayesian Inference for /
Prior:
/ 2 N (0 , 0 )
g(/ 2 ) exp(1/2( 0 )0 1
0 ( 0 ))
Likelihood:
1 0
L(/ 2 , y) exp( 2 2 (y X) (y X))

Posterior:
120 CHAPTER 7

p(/ 2 , y) exp(1/2( 0 )0 1 1 0
0 ( 0 ) 2 2 (y X) (y X))
This is the kernel of a normal distribution (*Problem*):
/ 2 , y N (1 , 1 )
where 1
1 = 1 0 +
2 (X 0 X) (1
0 0 +
2 (X 0 X)M L )
1 = (1
0 +
2 (X 0 X))1

Gamma and Inverse Gamma Refresher


  v  
iid 1 X v
zt N 0, , x= zt2 x x; ,
t=1
2 2

(Note = 1 x 2v , so 2 is a special case of )


   
v v x
x; , x 2 1 exp
2 2 2
v
E(x) =

2v
var(x) = 2

x 1 ( v2 , 2 ) (inverse gamma) 1
x
( v2 , 2 )
Bayesian Inference for 2 /
Prior:  
1
2
/ v20 , 20
    v0 1  
2 0
g 12 / 12 exp 2 2

(Independent
 2 / for completeness.) 
 of , but write 
1 T /2
L 2 /, y 2 exp 21 2 (y X)0 (y X)
(*Problem*: In contrast to L(/ 2 , y) earlier, we dont absorb the ( 2 )T /2 term into the constant of
proportionality. Why?)
Hence (*Problem*):
    v1 1  
exp
2
p 12 /, y 12 1
2 2
 
or 12 /, y v21 , 21
v1 = v0 + T
1 = 0 + (y X)0 (y X)
Bayesian Pros Thus Far

1. Feels sensible to focus on p(/y). Classical relative frequency in repeated samples replaced with
subjective degree of belief conditional on the single sample actually obtained
2. Exact finite-sample full-density inference

Bayesian Cons Thus Far

1. From where does the prior come? How to elicit prior distributions?
2. How to do an objective analysis?
(e.g. what is an uninformative prior? Uniform?)
(Note, however, that priors can be desirable and helpful. See, for example, the cartoon at http:
//fxdiebold.blogspot.com/2014/04/more-from-xkcdcom.html)
3. We still dont have the marginal posteriors that we really want: p(, 2 /y), p(/y).
Problematic in any event!
BAYES 121

7.5 GIBBS FOR SAMPLING MARGINAL POSTERIORS

Markov Chain Monte Carlo Solves the Problem! 0. Initialize: 2 = ( 2 )(0)


Gibbs sampler at generic iteration j:
j1. Draw (j) from p( (j) /( 2 )(j1) , 
y) (N(1 , 1))
j2. Draw ( 2 )(j) from p( 2 / (j) , y) 1 v21 , 21
Iterate to convergence to steady state, and then estimate posterior moments of interest

7.6 GENERAL STATE SPACE: CARTER-KOHN MULTI-MOVE GIBBS

Bayesian Analysis of State-Space Models

t = T t1 + Rt
yt = Zt + t

! !
t iid Q 0
N
t 0 H
T = (01 , . . . , 0T )0 , = (T 0 , R0 , Z 0 , Q0 , H 0 )0
Let
The key: Treat T as a parameter, along with system matrices
Recall the State-Space Model in Density Form

t |t1 N (T t1 , RQR0 )

yt |t N (Zt , H)
Recall the Kalman Filter in Density Form
Initialize at a0 , P0
State prediction:
t |
yt1 N (at/t1 , Pt/t1 )
at/t1 = T at1
Pt/t1 = T Pt1 T 0 + RQR0
State update:
t |
yt N (at , Pt )
at = at/t1 + Kt (yt Zat/t1 )
Pt = Pt/t1 Kt ZPt/t1
Data prediction:
yt |
yt1 N (Zat/t1 , Ft )
where yt = (y10 , ..., yt0 )0
Carter-Kohn Multi-move Gibbs Sampler
Let yT = (y10 , . . . , yT
0 )0

0. Initialize (0)

Gibbs sampler at generic iteration j:


(j)
j1. Draw from posterior T /(j1) , yT (hard)
(j) (j)
j2. Draw from posterior / T , yT (easy)
Iterate to convergence, and then estimate posterior moments of interest
Just two Gibbs draws: (1) T parameter, (2) parameter
(j)
Multimove Gibbs Sampler, Step 2 ((j) | T , yT ) (easy)
(j) (j)
Conditional upon draws T , sampling becomes a multivariate regression problem.
122 CHAPTER 7

We have already seen how to do univariate regression. We can easily extend to multivariate regression.
The Gibbs sampler continues to work.
*********************fxd
Multivariate Regression

yit = x0t i + it
iid
(1,t , ...N,t )0 N (0, )
i = 1, ..., N
t = 1, ...T

or

Y = X B + E
|{z} |{z} |{z} |{z}
T N T K KN T N

OLS is still (X 0 X)1 X 0 Y


Bayesian Multivariate Regression
(Precisely Parallels Bayesian Univariate Regression)
B| conjugate prior is multivariate normal:

vec(B)| N (B0 , 0 )

|B conjugate prior is inverse Wishart:

np1 1
p(1 |vec(B)) |1 | 2 exp( tr(1 V1 ))
2

Inverse Wishart refresher (multivariate inverse gamma):

X W 1 (n, V) X 1 W (n, V)
where  
np1 1
W (X; n, V) |X| 2 exp tr(XV1 )
2
Bayesian Inference for B|
Prior:
 
1  0 1
p(vec(B)|) exp tr vec(B B0 ) V0 vec(B B0 )
2
Likelihood:
T
!
1X 0 0 1 0
p(Y, X|B, ) exp (Yt B Xt ) (Yt B Xt )
2 t=1
 
1  1 0
exp tr (Y XB) (Y XB)
2
 
1  
0 1 X 0 X vec(B B)

exp vec(B B)
2

Posterior:

p(vec(B)|, Y )
 
1   
0 1 X 0 X vec(B B)
+ vec(B B0 )0 V 1 vec(B B0 )
exp vec(B B) 0
2
BAYES 123

This is the kernel of a Multivariate Normal distribution:

vec(B)|, Y N (B1 , V1 )
h i h i1
+ V 1 vec (B0 ) , V1 = 1 X 0 X + V 1
vec(B1 ) = V1 (1 X 0 X)vec(B) 0 0

and B = (X 0 X)1 (X 0 Y )
Bayesian Inference for |B
Prior:
np1 1
p(1 |vec(B)) |1 | 2 exp( tr(1 V1 ))
2
Likelihood:  
T 1
p(Y, X|B, ) || 2 exp tr 1 (Y XB)0 (Y XB)

2
Posterior:
 
T +np1 1
p(1 |vec(B), Y ) |1 | exp tr 1 (Y XB)0 (Y XB) + V1

2
2
This is the kernel of a Wishart distribution:

1 |vec(B), Y W (T + n, ((Y XB)0 (Y XB) + V1 )1 )

So is distributed according to Inverse Wishart (W 1 (T + n, ((Y XB)0 (Y XB) + V1 ))1 ).


(j)
Multimove Gibbs Sampler, Step 1 ( T /(j1) , yT ) (hard)
For notational simplicity we write p( T /
yT ), suppressing the dependence on .
p(
T /
yT ) = p(T /yT )p(
T 1 /T , yT )
= p(T /yT )p(T 1 /T , yT )p( T 2 /T 1 , T , yT )
= ...
(T 1)
= p(T /yT )t=1 p(t /t+1 , yt )
(*Problem*: Fill in the missing steps subsumed under . . . )
So, to draw from p(
T / yT ) and p(t /t+1 , yt ), t = 1, . . . , (T
yT ), we need to be able to draw from p(T /
1)
Multimove Gibbs sampler, Continued
The key is to work backward:
Draw from p(T / yT ),
then from p(T 1 /T , yT 1 ),
then from p(T 2 /T 1 , yT 2 ),
etc.
Time T draw is easy:
p(T /
yT ) is N (aT,T , PT,T )
(where the Kalman filter delivers aT,T and PT,T )
Earlier-time draws are harder:
How to get p(t /t+1 , yt ), t = (T 1), ..., 1?
Multimove Gibbs sampler, Continued
It can be shown that (*Problem*):
p(t /t+1 , yt ), t = (T 1), ..., 1, is N (at/t,t+1 , Pt/t,t+1 )
where
at/t,t+1 = E(t / yt , t+1 ) = E(t |at , t+1 )
= at + Pt T 0 (T Pt T 0 + Q)1 (t+1 T at )
Pt/t,t+1 = cov(t / yt , t+1 ) = cov(t |at , t+1 )
= Pt Pt T 0 (T Pt T 0 + Q)1 T Pt
*** Expanding S(M L ) around yields:
S(M L ) S() + S 0 ()(M L ) = S() + H())(M L ).
Noting that S(M L ) 0 and taking expectations yields:
124 CHAPTER 7

0 S() IEX,H ()(M L )


or
1
(M L ) IEX,H ().
a
Using S() N (0, IEX,H ()) then implies:
a
(M L ) N (0, I 1 ())
EX,H
or
Case 3 and 2
Joint prior g(, 12 ) = g(/ 12 )g( 12 )
where / 12 N (0 , 0 ) and 12 G( v20 , 0
2
)
HW Show that the joint posterior,
p(, 12 /y) = g(, 12 )L(, 12 /y)
can be factored as p(/ 12 , y)p( 21/y )
where / 12 , y N (1 , 1 )
and 12 /y G( v21 , 21 ),
and derive expressions for 1 , 1 , v1 , 1
in terms of 0 , 0 , 0 , x, and y.
Moreover, the key marginal posterior
P (/y) = 0 p(, 12 /y)d 2 is multivariate t.
R

Implement the Bayesian methods via Gibbs sampling.

7.7 EXERCISES, PROBLEMS AND COMPLEMENTS

7.8 NOTES
Chapter Eight

Non-Stationarity: Integration, Cointegration and Long Memory

8.1 RANDOM WALKS AS THE I(1) BUILDING BLOCK: THE BEVERIDGE-


NELSON DECOMPOSITION

Random Walks
Random walk:
yt = yt1 + t
t W N (0, 2 )
Random walk with drift:
yt = + yt1 + t
t W N (0, 2 )
Properties of the Random Walk

t
X
yt = y0 + i
i=1
(shocks perfectly persistent)

E(yt ) = y0
var(yt ) = t 2
lim var(yt ) =
t
Properties of the Random Walk with Drift

t
X
yt = t + y0 + i
i=1
(shocks again perfectly persistent)

E(yt ) = y0 + t
var(yt ) = t 2
lim var(yt ) =
t
The Random Walk as a Building Block
Generalization of random walk: ARIM A(p, 1, q)
Beveridge-Nelson decomposition:
yt ARIM A(p, 1, q) yt = xt + zt
xt = random walk
zt = covariance stationary
So shocks to ARIM A(p, 1, q) are persistent, but not perfectly so.
126 CHAPTER 8

This was univariate BN. We will later derive multivariate BN.


Forecasting a Random Walk with Drift

xt = b + xt1 + t
t W N (0, 2 )
Optimal forecast:
xT +h,T = bh + xT
Forecast does not revert to trend
Forecasting a Linear Trend + Stationary AR(1)
xt = a + bt + yt

yt = yt1 + t
t W N (0, 2 )
Optimal forecast:
xT +h,T = a + b(T + h) + h yT
Forecast reverts to trend

8.2 STOCHASTIC VS. DETERMINISTIC TREND

Some Language...
Random walk with drift vs. stat. AR(1) around linear trend
unit root vs. stationary root
Difference stationary vs. trend stationary
Stochastic trend vs. deterministic trend
I(1) vs. I(0)
Stochastic Trend vs. Deterministic Trend
BAYES 127

8.3 UNIT ROOT DISTRIBUTIONS

Unit Root Distribution in the AR(1) Process

yt = yt1 + t

d
T (LS 1) DF

Superconsistent
Biased in finite samples (E < (0, 1])
Hurwicz bias Dickey-Fuller bias
Nelson-Kang spurious periodicity
Bigger as T 0 , as 1 , and as intercept, trend included
Non-Gaussian (skewed left)
DF tabulated by Monte Carlo
Studentized Version

1
= r
s PT 1 2
t=2 yt1

Not t in finite samples


Not N (0, 1) asymptotically
Again, tabulate by Monte Carlo
Nonzero Mean Under the Alternative

(yt ) = (yt1 ) + t
yt = + yt1 + t
where = (1 )
Random walk null vs. mean-reverting alternative
Studentized statistic
Deterministic Trend Under the Alternative

(yt a b t) = (yt1 a b (t 1)) + t


yt = + t + yt1 + t
where = a(1 ) + b and = b(1 )
H0 : = 1 (unit root)
H1 : < 1 (stationary root)
Random walk with drift vs. stat. AR(1) around linear trend
Difference stationary vs. trend stationary
Stochastic trend vs. deterministic trend
I(1) vs. I(0)
Studentized statistic
Tabulating the Dickey-Fuller Distributions
1. Set T

2. Draw T N (0, 1) variates

3. Construct yt

4. Run three DF regressions (using common random numbers)


128 CHAPTER 8

: yt = yt1 + et
: yt = c + yt1 + et
: yt = c + t + yt1 + et

i , i , i }N
5. Repeat N times, yielding { i=1

6. Sort and compute fractiles

7. Fit response surfaces


AR(p)

p
X
yt + j ytj = t
j=1
p
X
yt = 1 yt1 + j (ytj+1 ytj ) + t
j=2

where p 2, 1 = pj=1 j , and i = pj=i j , i = 2, ..., p


P P

Studentized statistic
Allowing for Nonzero Mean Under the Alternative

p
X
(yt ) + j (ytj ) = t
j=1
p
X
yt = + 1 yt1 + j (ytj+1 ytj ) + t
j=2

where = (1 + pj=1 j )
P

Studentized statistic
Allowing for Trend Under the Alternative

p
X
(yt a bt) + j (ytj a b(t j)) = t
j=1
p
X
yt = k1 + k2 t + 1 yt1 + j (ytj+1 ytj ) + t
j=2
p
X p
X
k1 = a(1 + i ) b ii
i=1 i=1
p
X
k2 = b (1 + i )
i=1
Pp
Under the null hypothesis, k1 = b i=1 ii and k2 = 0
Studentized statistic

8.4 UNIVARIATE AND MULTIVARIATE AUGMENTED DICKEY-FULLER


REPRESENTATIONS

General ARM A Representations


(Augmented Dickey-Fuller (ADF))
Use one of the representations:
BAYES 129

k1
X
yt = 1 yt1 + j (ytj+1 ytj ) + t
j=2

k1
X
yt = + 1 yt1 + j (ytj+1 ytj ) + t
j=2

k1
X
yt = k1 + k2 t + 1 yt1 + j (ytj+1 ytj ) + t
j=2

Let k with k/T 0


Trick Form of ADF

k1
X
(yt yt1 ) = (1 1)yt1 + j (ytj+1 ytj ) + t
j=2

Unit root corresponds to (1 1) = 0


Use standard automatically-computed t-stat
(which of course does not have the t-distribution)

8.5 SPURIOUS REGRESSION

Multivariate Problem: Spurious Time-Series Regressions


Regress a persistent variable on an unrelated persistent variable:

yt = x t + t

(Canonical case: y, x independent driftless random walks)


d
R2 RV (not zero)

d
t RV (t diverges)
T

d

RV ( diverges)
T

When are I(1) Levels Regressions Not Spurious?


Answer: When the variables are cointegrated.

8.6 COINTEGRATION, ERROR-CORRECTION AND GRANGERS REP-


RESENTATION THEOREM

Cointegration
Consider an N -dimensional variable x:
x CI (d, b) if

1. xi I(d), i = 1, . . . , N

2. 1 or more linear combinations zt = 0 xt s.t. zt I(d b), b > 0

Leading Case
130 CHAPTER 8

x CI(1, 1) if
(1) xi I(1), i = 1, . . . , N
(2) 1 or more linear combinations
zt = 0 xt s.t. zt I(0)
Example

xt = xt1 + vt , vt W N
yt = xt1 + t , t W N, t vt , t,
(yt xt ) = t vt = I(0)
Cointegration and Attractor Sets
xt is N -dimensional but does not wander randomly in RN
0 xt is attracted to an (N R)-dimensional subspace of RN
N : space dimension
R: number of cointegrating relationships
Attractor dimension = N R
(number of underlying unit roots)
(number of common trends)
Example
3-dimensional V AR(p), all variables I(1)
R = 0 no cointegration x wanders throughout R3
R = 1 1 cointegrating vector x attracted to a 2-Dim hyperplane in R3 given by 0 x = 0
R = 2 2 cointegrating vectors x attracted to a 1-Dim hyperplane (line) in R3 given by intersection
of two 2-Dim hyperplanes, 01 x = 0 and 02 x = 0
R = 3 3 cointegrating vectors x attracted to a 0-Dim hyperplane (point) in R3 given by the
intersection of three 2-Dim hyperplanes, 01 x = 0 , 02 x = 0 and 03 x = 0
(Covariance stationary around E(x))
Cointegration Motivation: Dynamic Factor Structure
Factor structure with I(1) factors
(N R) I(1) factors driving N variables
e.g., single-factor model:

y1t 1 1t
. . .
. = . ft + .
. . .
yN t 1 N t
ft = ft1 + t
R = (N 1) cointegrating combs: (y2t y1t ), ..., (yN t y1t )
(N R) = N (N 1) = 1 common trend
Cointegration Motivation: Optimal Forecasting
I(1) variables always co-integrated with their optimal forecasts
Example:
xt = xt1 + t
xt+h|t = xt
xt+h xt+h|t = h
P
i=1 t+i

(finite MA, always covariance stationary)


Cointegration Motivation:
Long-Run Relation Augmented with Short-Run Dynamics
BAYES 131

Simple AR Case (ECM):

yt = yt1 + xt1 (yt1 xt1 ) + ut


= yt1 + xt1 zt1 + ut

General AR Case (VECM):


A(L) xt = zt1 + ut
where:
A(L) = I A1 L ... Ap Lp
z t = 0 xt
Multivariate ADF
Any V AR can be written as:

p1
X
xt = xt1 + Bi xti + ut
i=1
Integration/Cointegration Status

Rank() = 0
0 cointegrating vectors, N underlying unit roots
(all variables appropriately specified in differences)
Rank() = N
N cointegrating vectors, 0 unit roots
(all variables appropriately specified in levels)
Rank() = R (0 < R < N )
R cointegrating vectors, N R unit roots
New and important intermediate case
(not possible in univariate)

Granger Representation Theorem

xt V ECM xt CI(1, 1)
V ECM Cointegration
We can always write
Pp1
xt = i=1 Bi xti xt1 + ut
But under cointegration, rank() = R < N , so
0
=
N N N R RN
xt = p1 0
P
i=1 Bi xti xt1 + ut
Pp1
= i=1 Bi xti zt1 + ut
V ECM Cointegration

p1
X
xt = Bi xti 0 xt1 + ut
i=1
Premultiply by 0 :

p1
X
0 xt = 0 Bi xti 0 0 xt1 + 0 ut
|{z}
i=1
full rank
So equation balance requires that 0 x t1 be stationary.
132 CHAPTER 8

Stationary-Nonstationary Decomposition

0

(R N ) CI combs

M0

x
= x =

(N N ) (N 1)
com. trends


(N R) N

(Rows of to columns of )
Intuition Transforming the system by yields
p1
X
xt = Bi xti 0 0 xt1 + t
|{z}
i=1
0 by orthogonality

So isolates that part of the VECM


that is appropriately specified as a VAR in differences.
Note that if we start with M0 x, then the observed series is
(M0 )1 M0 x, so nonstationarity is spread throughout the system.
Example

x1t = x1t1 + u1t

x2t = x1t1 + u2t


Levels form:
! ! ! ! !
1 0 1 0 x1t u1t
L =
0 1 1 0 x2t u2t
Dickey-Fuller form:
! ! ! !
x1t 0 0 x1t1 u1t
= +
x2t 1 1 x2t1 u2t
Example, Continued

!
0  
= 1 1 = 0
1

! !
0 1 1 0
M = =
1 0

! ! !
0 x1t u2t u1t x2t x1t
M = =
x2t x1t x1t
BAYES 133

8.7 FRACTIONAL INTEGRATION AND LONG MEMORY

Long Memory and Fractional Integration


Integer-integrated ARIM A(p, d, q) I(d):

(1 L)d (L)yt = (L)t , d = 0, 1, ...

Covariance stationary: ARIM A(p, 0, q)


Random walk: ARIM A(0, 1, 0) pure unit root process
Fractionally-integrated ARF IM A(p, d, q) I(d):
1 1
(1 L)d (L)yt = (L)t , <d<
2 2
Covariance stationary: 12 < d < 1
2 (focus on 0 < d < 21 )
ARF IM A(0, d, 0): pure fractionally-integrated process

d(d 1) 2 d(d 1)(d 2) 3


(1 L)d = 1 dL + L L + ...
2! 3!
Long Memory and Fractional Integration, Continued Time domain,

I(1) : ( ) const

I(0) : ( ) r (0 < r < 1)

I(d) : ( ) 2d1 (0 < d < 1/2)

8.7.1 Characterizing Integration Status

Frequency domain, 0

I(1) : f () 2

I(0) : f () const

I(d) : f () 2d (0 < d < 1/2)

Frequency-domain I(d) behavior implies that for low frequencies,

ln f () = 0 + 1 ln + t
|{z}
2d


GPH estimator of d: Regress ln f () const, ln
So take d = 1 1 . GPH estimator
2

8.8 EXERCISES, PROBLEMS AND COMPLEMENTS

1. Applied modeling.
134 CHAPTER 8

Obtain a series of U.S. industrial production, monthly, 1947.01-present, not seasonally


adjusted. Discard the last 20 observations. Now graph the series. Examine its trend
and seasonal patterns in detail. Does a linear trend (fit to logs) seem appropriate? Do
monthly seasonal dummies seem appropriate? To the log of the series, fit an ARMA
model with linear trend and monthly seasonal dummies. Be sure to try a variety of
the techniques we have covered (sample autocorrelation and partial autocorrelation
functions, Bartlett standard errors, Box-Pierce test, standard error of the regression,
adjusted R2 , etc.) in your attempt at selecting an adequate model. Once a model has
been selected and estimated, use it to forecast the last 20 observations, and compare
your forecast to the actual realized values. Contrast the results of the approach with
those of the Box-Jenkins seasonal ARIMA approach, which involves taking first and
seasonal differences as necessary to induce covariance stationarity, and then fitting a
multiplicative seasonal ARMA model.

2. Aggregation.
Granger (1980) shows that aggregation of a very large number of stationary ARMA
time series results, under regularity conditions (generalized in Robinson, 1991), in a
fractionally-integrated process. Thus, aggregation of short-memory processes results
in a long-memory process. Discuss this result in light of theorems on aggregation of
ARMA processes. In particular, recall that aggration of ARMA processes results in
new ARMA processes, generally of higher order than the components.

3. Over-differencing and UCMs.


The stochastic trend:
Tt = Tt1 + t1 + t
t = t1 + t ,
has two unit roots. Discuss as regards overdifferencing in economic time series.

8.9 NOTES
Chapter Nine

Non-Linear Non-Gaussian State Space and Optimal Filtering

9.1 VARIETIES OF NON-LINEAR NON-GAUSSIAN MODELS

9.2 MARKOV CHAINS TO THE RESCUE (AGAIN): THE PARTICLE FIL-


TER

9.3 PARTICLE FILTERING FOR ESTIMATION: DOUCETS THEOREM

9.4 KEY APPLICATION I: STOCHASTIC VOLATILITY (REVISITED)

9.5 KEY APPLICATION II: CREDIT-RISK AND THE DEFAULT OPTION

9.6 KEY APPLICATION III: DYNAMIC STOCHASTIC GENERAL EQUI-


LIBRIUM (DSGE) MACROECONOMIC MODELS

9.7 A PARTIAL SOLUTION: THE EXTENDED KALMAN FILTER

Familiar Linear / Gaussian State Space

t = T t1 + Rt

yt = Zt + t

t N (0, Q), t N (0, H)

Linear / Non-Gaussian

t = T t1 + Rt

yt = Zt + t
136 CHAPTER 9

t D , t D

Non-Linear / Gaussian

t = Q(t1 , t )

yt = G(t , t )

t N (0, Q), t N (0, H)

Non-Linear / Gaussian II
(Linear / Gaussian with time-varying system matrices)

t = Tt t1 + Rt t

yt = Zt t + t

t N , t N

Conditionally Gaussian
Whites theorem
Non-Linear / Non-Gaussian

t = Q(t1 , t )

yt = G(t , t )

t D , t D

(DSGE macroeconomic models are of this form)


Non-Linear / Non-Gaussian, Specialized

t = Q(t1 ) + t

yt = G(t ) + t
NON-LINEAR NON-GAUSSIAN 137

t D , t D

Non-Linear / Non-Gaussian, Generalized

t = Qt (t1 , t )

yt = Gt (t , t )

t Dt , t Dt

Asset value of the firm Vt :

Vt = Vt1 t0 , t0 lognormal

Firm issues liability D: Zero-coupon bond, matures at T , pays D


Equity value of the firm St :

St = max(Vt D, 0)

From the call option structure of St , Black-Scholes gives:


St = BS(Vt )0t
0t lognormal
(0t captures BS misspecification, etc.)
Credit Risk Model (Nonlinear / Gaussian Form)
Taking logs makes it Gaussian, but its intrinsically non-linear:
ln Vt = ln + Vt1 + t
ln St = ln BS(Vt ) + t
t N, t N
Regime Switching Model (Nonlinear / Gaussian)
! ! ! !
1t 0 1,t1 1t
= +
2t 0 2,t1 2t

!
1t
yt = 0 + I(2t > 0) + (1, 0)
2t

1t N 1 2t N 2 1t 2t

Extensions to:
Richer 1 dynamics (governing the observed y)
138 CHAPTER 9

Richer 2 dynamics (governing the latent regime)


Richer t distribution (e.g., 2t asymmetric)
More than two states
Switching also on dynamic parameters, volatilities, etc.
Multivariate
Stochastic Volatility Model (Nonlinear/Gaussian Form)

ht = + ht1 + t (transition)


rt = eht t (measurement)

t N (0, 2 ), t N (0, 1)
Stochastic Volatility Model (Linear/Non-Gaussian Form)

ht = + ht1 + t (transition)

2ln|rt | = ht + 2ln|t | (measurement)

or

ht = + ht1 + t

yt = ht + ut

t N (0, 2 ), ut Du
A signal plus (non-Gaussian) noise
components model for volatility
Realized and Integrated Volatility

IVt = IVt1 + t

RVt = IVt + t

represents the fact that RV is based on less than an infinite sampling frequency.
Microstructure Noise Model
**Hasbrouck
(Non-linear / non-Gaussian)
A Distributional Statement of the Kalman Filter ****
Multivariate Stochastic Volatility with Factor Structure
NON-LINEAR NON-GAUSSIAN 139

***
Approaches to the General Filtering Problem Kitagawa (1987), numerical integration
(linear / non-Gaussian) More recently, Monte Carlo integration
Extended Kalman Filter (Non-Linear / Gaussian)

t = Q(t1 , t )

yt = G(t , t )

t N, t N

Take first-order Taylor expansions of:


Q around at1
G around at,t1
Use Kalman filter on the approximated system
Unscented Kalman Filter (Non-Linear / Gaussian)
Bayes Analysis of SSMs: Carlin-Polson-Stoffer 1992 JASA
single-move Gibbs sampler
(Many parts of the Gibbs iteration: the parameter vector, and then each observation of
the state vector, period-by-period)
Multi-move Gibbs sampler can handle non-Gaussian (via mixtures of normals), but not
nonlinear.
Single-move can handle nonlinear and non-Gaussian.
Expanding S(M L ) around yields:
S(M L ) S() + S 0 ()(M L ) = S() + H())(M L ).
Noting that S(M L ) 0 and taking expectations yields:
0 S() IEX,H ()(M L )
or
(M L ) I 1
EX,H ().
a
Using S() N (0, IEX,H ()) then implies:
a
(M L ) N (0, I 1 ())
EX,H
or
***
Case 3 and 2
Joint prior g(, 12 ) = g(/ 12 )g( 12 )
where / 12 N (0 , 0 ) and 12 G( v20 , 20 )
HW Show that the joint posterior,
p(, 12 /y) = g(, 12 )L(, 12 /y)
can be factored as p(/ 12 , y)p( 21/y )
140 CHAPTER 9

where / 12 , y N (1 , 1 )
and 1
2 /y G( v21 , 21 ),
and derive expressions for 1 , 1 , v1 , 1
in terms of 0 , 0 , 0 , x, and y.
Moreover, the key marginal posterior
R
P (/y) = 0 p(, 12 /y)d 2 is multivariate t.
Implement the Bayesian methods via Gibbs sampling.
Linear Quadratic Business Cycle Model
Hansen and Sargent
Linear Gaussian state space system
Parameter-Driven vs. Observation-Driven Models
Parameter-driven: Time-varying parameters measurable w.r.t. latent variables
Observation-driven: Time-varying parameters measurable w.r.t. observable variables
Parameter-driven models are mathematically appealing but hard to estimate. Observation-
driven models are less mathematically appealing but easy to estimate. State-space models,
in general, are parameter-driven. Stochastic volatility models are parameter-driven, while
ARCH models are observation-driven.

Regime Switching
We have emphasized dynamic linear models, which are tremendously important in prac-
tice. Theyre called linear because yt is a simple linear function of past ys or past s.
In some forecasting situations, however, good statistical characterization of dynamics may
require some notion of regime switching, as between good and bad states, which is a
type of nonlinear model.
Models incorporating regime switching have a long tradition in business-cycle analysis,
in which expansion is the good state, and contraction (recession) is the bad state. This
idea is also manifest in the great interest in the popular press, for example, in identifying
and forecasting turning points in economic activity. It is only within a regime-switching
framework that the concept of a turning point has intrinsic meaning; turning points are
naturally and immediately defined as the times separating expansions and contractions.

Observable Regime Indicators
Threshold models are squarely in line with the regime-switching tradition. The follow-
ing threshold model, for example, has three regimes, two thresholds, and a d-period delay
regulating the switches:
(u)


c(u) + (u) yt1 + t , (u) < ytd

(m)
yt = c(m) + (m) yt1 + t , (l) < ytd < (u) .
(l)

(l) (l) (l)
c + yt1 + t , > ytd .

The superscripts indicate upper, middle, and lower regimes, and the regime operative
NON-LINEAR NON-GAUSSIAN 141

at any time t depends on the observable past history of y in particular, on the value of
ytd .

Latent Markovian Regimes
Although observable threshold models are of interest, models with latent states as opposed
to observed states may be more appropriate in many business, economic and financial con-
texts. In such a setup, time-series dynamics are governed by a finite-dimensional parameter
vector that switches (potentially each period) depending upon which of two unobservable
states is realized, with state transitions governed by a first-order Markov process. To make
matters concrete, lets take a simple example. Let {st }Tt=1 be the (latent) sample path of
two-state first-order autoregressive process, taking just the two values 0 or 1, with transition
probability matrix given by
!
p00 1 p00
M = .
1 p11 p11

The ij-th element of M gives the probability of moving from state i (at time t 1) to state
j (at time t). Note that there are only two free parameters, the staying probabilities, p00
and p11 . Let {yt }Tt=1 be the sample path of an observed time series that depends on {st }Tt=1
such that the density of yt conditional upon {st } is
!
2
1 (yt st )
f (yt |st ; ) = exp .
2 2 2

Thus, yt is Gaussian white noise with a potentially switching mean. The two means around
which yt moves are of particular interest and may, for example, correspond to episodes of
differing growth rates (booms and recessions, bull and bear markets, etc.).
Chapter Ten

Volatility Dynamics

10.1 VOLATILITY AND FINANCIAL ECONOMETRICS

10.2 GARCH

10.3 STOCHASTIC VOLATILITY

10.4 OBSERVATION-DRIVEN VS. PARAMETER-DRIVEN PROCESSES

Prologue: Reading
Much of what follows draws heavily upon:

Andersen, T.G., Bollerslev, T., Christoffersen, P.F. and Diebold, F.X. (2012), Finan-
cial Risk Measurement for Financial Risk Management, in G. Constantinedes, M.
Harris and Rene Stulz (eds.), Handbook of the Economics of Finance, Elsevier.

Andersen, T.G., Bollerslev, T. and Diebold, F.X. (2010), Parametric and Nonpara-
metric Volatility Measurement, in L.P. Hansen and Y. Ait-Sahalia (eds.), Handbook
of Financial Econometrics. Amsterdam: North-Holland, 67-138.

Andersen, T.G., Bollerslev, T., Christoffersen, P.F., and Diebold, F.X. (2006), Volatil-
ity and Correlation Forecasting, in G. Elliott, C.W.J. Granger, and A. Timmermann
(eds.), Handbook of Economic Forecasting. Amsterdam: North-Holland, 778-878.

Prologue

Throughout: Desirability of conditional risk measurement

Aggregation level
Portfolio-level (aggregated, univariate) Risk measurement
Asset-level (disaggregated, multivariate): Risk management

Frequency of data observations


Low-frequency vs. high-frequency data
Parametric vs. nonparametric volatility measurement
VOLATILITY DYNAMICS 143

Figure 10.1: Time Series of Daily NYSE Returns

Object measured and modeled


From conditional variances to conditional densities

Dimensionality reduction in big data multivariate environments


From ad hoc statistical restrictions to factor structure

Whats in the Data?


Returns
Key Fact 1: Returns are Approximately Serially Uncorrelated
Key Fact 2: Returns are not Gaussian
Key Fact 3: Returns are Conditionally Heteroskedastic I
Key Fact 3: Returns are Conditionally Heteroskedastic II

Why Care About Volatility Dynamics?


Everything Changes when Volatility is Dynamic

Risk management

Portfolio allocation

Asset pricing

Hedging

Trading

Risk Management
144 CHAPTER 10

Figure 10.2: Correlogram of Daily NYSE Returns.

Figure 10.3: Histogram and Statistics for Daily NYSE Returns.


VOLATILITY DYNAMICS 145

Figure 10.4: Time Series of Daily Squared NYSE Returns.

Figure 10.5: Correlogram of Daily Squared NYSE Returns.


146 CHAPTER 10

Individual asset returns:

r (, )

Portfolio returns:

rp = 0 r (0 , 0 )

If varies, we need to track time-varying portfolio risk, 0 t


Portfolio Allocation
Optimal portfolio shares w solve:

minw w0 w

s.t. w0 = p

Importantly, w = f ()
If varies, we have wt = f (t )
Asset Pricing I: Sharpe Ratios
Standard Sharpe:
E(rit rf t )

Conditional Sharpe:
E(rit rf t )
t
Asset Pricing II: CAPM Standard CAPM:

(rit rf t ) = + (rmt rf t )

cov((rit rf t ), (rmt rf t ))
=
var(rmt rf t )
Conditional CAPM:
covt ((rit rf t ), (rmt rf t ))
t =
vart (rmt rf t )
Asset Pricing III: Derivatives
Black-Scholes:

C = N (d1 )S N (d2 )Ker


ln(S/K) + (r + 2 /2)
d1 =

ln(S/K) + (r 2 /2)
d2 =

VOLATILITY DYNAMICS 147

PC = BS(, ...)

(Standard Black-Scholes options pricing)


Completely different when varies!
Hedging

Standard delta hedging

Ht = St + ut

cov(Ht , St )
=
var(St )

Dynamic hedging

Ht = t St + ut

covt (Ht , St )
t =
vart (St )

Trading

Standard case: no way to trade on fixed volatility

Time-varying volatility I: Options straddles, strangles, etc. Take position according to


whether PC >< f (t+h,t , . . .)
(indirect)

Time-varying volatility II: Volatility swaps


Effectively futures contracts written on underlying
realized volatility
(direct)

Some Warm-Up
Unconditional Volatility Measures
Variance: 2 = E(rt )2 (or standard deviation: )
Mean Absolute Deviation: M AD = E|rt |
Interquartile Range: IQR = 75% 25%
148 CHAPTER 10

12

10

8
True Probability, %

0
0 100 200 300 400 500 600 700 800 900 1000
Day Number

Figure 10.6: True Exceedance Probabilities of Nominal 1% HS-V aR When Volatility is


Persistent. We simulate returns from a realistically-calibrated dynamic volatility model, after which we
compute 1-day 1% HS-V aR using a rolling window of 500 observations. We plot the daily series of true
conditional exceedance probabilities, which we infer from the model. For visual reference we include a
horizontal line at the desired 1% probability level.

p% Value at Risk (V aRp )): x s.t. P (rt < x) = p


Outlier probability: P |rt | > 5 (for example)
Tail index: s.t. P (rt > r) = k r
Kurtosis: K = E(r )4 / 4
Dangers of a Largely Unconditional Perspective (HS-V aR)
Dangers of an Unconditional Perspective, Take II
The unconditional HS-V aR perspective encourages incorrect rules of thumb, like scaling

by h to convert 1-day vol into h-day vol.
Conditional VaR
Conditional VaR (V aRTp +1|T ) solves:

p
Z V aRT +1|T
p = PT (rT +1 V aRTp +1|T ) = fT (rT +1 )drT +1

( fT (rT +1 ) is density of rT +1 conditional on time-T information)


But VaR of any Flavor has Issues

V aR is silent regarding expected loss when V aR is exceeded


(fails to assess the entire distributional tail)

V aR fails to capture beneficial effects of portfolio diversification

Conditionally expected shortfall:

Z p
ESTp+1|T = p 1
V aRT+1|T d
0

ES assesses the entire distributional tail

ES captures the beneficial effects of portfolio diversification


VOLATILITY DYNAMICS 149

Exponential Smoothing and RiskMetrics

t2 = t1
2 2
+ (1 ) rt1


X
t2 = 2
j rt1j
j=0

j = (1 ) j

(Many initializations possible: r12 , sample variance, etc.)

RM-VaRpT +1|T = T +1 1
p

Random walk for variance

Random walk plus noise model for squared returns

Volatility forecast at any horizon is current smoothed value

But flat volatility term structure is not realistic

Rigorous Modeling I
Conditional Univariate Volatility Dynamics from Daily
Data
Conditional Return Distributions
f (rt ) vs. f (rt |t1 )
Key 1: E(rt |t1 )
Are returns conditional mean independent? Arguably yes.
Returns are (arguably) approximately serially uncorrelated, and (arguably) approximately
free of additional non-linear conditional mean dependence.
Conditional Return Distributions, Continued Key 2: var(rt |t1 ) = E((rt )2 |t1 )
Are returns conditional variance independent? No way!
Squared returns serially correlated, often with very slow decay.
The Standard Model
(Linearly Indeterministic Process with iid Innovations)


X
yt = bi ti
i=0
150 CHAPTER 10


X
iid (0, 2 ) b2i < b0 = 1
i=0

Uncond. mean: E(yt ) = 0 (constant)


P 2
Uncond. variance: E(yt E(yt ))2 = 2 i=0 bi (constant)
P
Cond. mean: E(yt | t1 ) = i=1 i ti (varies)
b
2
Cond. variance: E([yt E(yt | t1 )] | t1 ) = 2 (constant)
The Standard Model, Continued
k-Step-Ahead Least Squares Forecasting


X
E(yt+k | t ) = bk+i ti
i=0

Associated prediction error:


k1
X
yt+k E(yt+k | t ) = bi t+ki
i=0

Conditional prediction error variance:


k1
X
2
E([yt+k E(yt+k | t )] | t ) = 2 b2i
i=0

Key: Depends only on k, not on t


ARCH(1) Process

rt |t1 N (0, ht )

2
ht = + rt1

E(rt ) = 0

2
E(rt E(rt )) =
(1 )

E(rt |t1 ) = 0

2 2
E([rt E(rt |t1 )] |t1 ) = + rt1

GARCH(1,1) Process
Generalized ARCH

rt | t1 N (0, ht )
VOLATILITY DYNAMICS 151

2
ht = + rt1 + ht1

E(rt ) = 0

2
E(rt E(rt )) =
(1 )

E(rt |t1 ) = 0

2 2
E([rt E(rt | t1 )] | t1 ) = + rt1 + ht1

Conditionally-Gaussian GARCH-Based 1-Day VaR

GARCH-VaRTp +1|T T +1|T 1


p

Consistent with fat tails of unconditional return distribution


Can be extended to allow for fat-tailed conditional distribution
Unified Theoretical Framework

Volatility dynamics (of course, by construction)

Conditional symmetry translates into unconditional symmetry

Volatility clustering produces unconditional leptokurtosis

Tractable Empirical Framework

L (; r1 , . . . , rT ) f (rT |T 1 ; ) f (rT 1 |T 2 ; ) . . . f (rp+1 |p ; )

If the conditional densities are Gaussian,


1 rt2
 
1
f (rt |t1 ; ) = ht ()1/2 exp
2 2 ht ()

T T
T p 1 X 1 X rt2
ln L (; rp+1 , . . . , rT ) ln(2) ln ht ()
2 2 t=p+1 2 t=p+1 ht ()

The Squared Return as a Noisy Volatility Proxy


Note that we can write:
rt2 = ht + t
Thus rt2 is a noisy indicator of ht
Various approaches handle the noise in various ways.
152 CHAPTER 10

GARCH(1,1) and Exponential Smoothing


Exponential smoothing recursion:

rt2 = rt2 + (1 ) rt1


2

Back substitution yields:


X
rt2 = 2
wj rtj

where wj = (1 )j
But in GARCH(1,1) we have:
2
ht = + rt1 + ht1

X
ht = + j1 rtj
2
1
Variance Targeting
Sample unconditional variance:
T
1X 2
2 =
r
T t=1 t

Implied unconditional GARCH(1,1) variance:



2 =
1
We can constrain 2 =
2 by constraining:

2
= (1 )

Saves a degree of freedom and ensures reasonableness


ARMA Representation in Squares
rt2 has the ARMA(1,1) representation:

rt2 = + ( + )rt1
2
t1 + t ,

where t = rt2 ht .
Variations on the GARCH Theme
Regression with GARCH Disturbances

yt = x0t + t

t |t1 N (0, ht )
VOLATILITY DYNAMICS 153

Regression with GARCH Disturbances


Incorporating Exogenous Variables
Asymmetric Response and the Leverage Effect:
Fat-Tailed Conditional Densities

Time-Varying Risk Premia

Incorporating Exogenous Variables

2
ht = + rt1 + ht1 + 0 zt

is a parameter vector
z is a set of positive exogenous variables.
Asymmetric Response and the Leverage Effect I: TARCH
2
Standard GARCH: ht = + rt1 + ht1
2 2
TARCH:( ht = + rt1 + rt1 Dt1 + ht1
1 if rt < 0
Dt =
0 otherwise
positive return (good news): effect on volatility

negative return (bad news): + effect on volatility

6= 0: Asymetric news response


> 0: Leverage effect
Asymmetric Response II: E-GARCH


r rt1
t1
ln(ht ) = + 1/2 + 1/2 + ln(ht1 )
h ht1
t1

Log specification ensures that the conditional variance is positive.

Volatility driven by both size and sign of shocks

Leverage effect when < 0

Fat-Tailed Conditional Densities: t-GARCH


If r is conditionally Gaussian, then rt N (0, 1)
ht
But often with high-frequency data, rht f at tailed
t
So take:
1/2
rt = ht zt
154 CHAPTER 10

Figure 10.7: GARCH(1,1) Estimation, Daily NYSE Returns.

iid
td
zt
std(td )

Time-Varying Risk Premia: GARCH-M


Standard GARCH regression model:

yt = x0t + t

t |t1 N (0, ht )

GARCH-M model is a special case:

yt = x0t + ht + t

t |t1 N (0, ht )

A GARCH(1,1) Example
A GARCH(1,1) Example
A GARCH(1,1) Example
A GARCH(1,1) Example
After Exploring Lots of Possible Extensions...

Rigorous Modeling II
Conditional Univariate Volatility Dynamics from High-
Frequency Data
VOLATILITY DYNAMICS 155

Figure 10.8: Correlogram of Squared Standardized GARCH(1,1) Residuals, Daily NYSE


Returns.

Figure 10.9: Estimated Conditional Standard Deviation, Daily NYSE Returns.

Figure 10.10: Conditional Standard Deviation, History and Forecast, Daily NYSE Returns.
156 CHAPTER 10

Dependent Variable: R
Method: ML - ARCH (Marquardt) - Student's t distribution
Date: 04/10/12 Time: 13:48
Sample (adjusted): 2 3461
Included observations: 3460 after adjustments
Convergence achieved after 19 iterations
Presample variance: backcast (parameter = 0.7)
GARCH = C(4) + C(5)*RESID(-1)^2 + C(6)*RESID(-1)^2*(RESID(-1)<0)
+ C(7)*GARCH(-1)

Variable Coefficient Std. Error z-Statistic Prob.

@SQRT(GARCH) 0.083360 0.053138 1.568753 0.1167


C 1.28E-05 0.000372 0.034443 0.9725
R(-1) 0.073763 0.017611 4.188535 0.0000

Variance Equation

C 1.03E-06 2.23E-07 4.628790 0.0000


RESID(-1)^2 0.014945 0.009765 1.530473 0.1259
RESID(-1)^2*(RESID(-
1)<0) 0.094014 0.014945 6.290700 0.0000
GARCH(-1) 0.922745 0.009129 101.0741 0.0000

T-DIST. DOF 5.531579 0.478432 11.56188 0.0000

Figure 10.11: AR(1) Returns with Threshold t-GARCH(1,1)-in Mean.


VOLATILITY DYNAMICS 157

Daily Annualized Realized Volatility (%)


150

100

50

0
1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010

Daily closetoclose Returns (%)


15

10

10

15
1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010

Figure 10.12: S&P500 Daily Returns and Volatilities (Percent). The top panel shows daily S&P500
returns, and the bottom panel shows daily S&P500 realized volatility. We compute realized volatility as the
square root of AvgRV , where AvgRV is the average of five daily RVs each computed from 5-minute squared
returns on a 1-minute grid of S&P500 futures prices.

Intraday Data and Realized Volatility

dp(t) = (t)dt + (t)dW (t)

N ()
X 2
RVt () pt1+j pt1+(j1)
j=1

Z t
RVt () IVt = 2 ( ) d
t1

Microstructure Noise
State space signal extraction
AvgRV
Realized kernel
Many others
RV is Persistent
RV is Reasonably Approximated as Log-Normal
RV is Long-Memory
Exact and Approximate Long Memory
Exact long memory:

(1 L)d RVt = 0 + t
158 CHAPTER 10

Quantiles of Input Sample QQ plot of Daily RVAVR


100

100
5 4 3 2 1 0 1 2 3 4 5
Standard Normal Quantiles
QQ plot of Daily Realized Volatility
Quantiles of Input Sample

10

10
5 4 3 2 1 0 1 2 3 4 5
Standard Normal Quantiles
QQ plot of Daily log RVAVR
Quantiles of Input Sample

5
5 4 3 2 1 0 1 2 3 4 5
Standard Normal Quantiles

Figure 10.13: S&P500: QQ Plots for Realized Volatility and Log Realized Volatility. The top
panel plots the quantiles of daily realized volatility against the corresponding normal quantiles. The bottom
panel plots the quantiles of the natural logarithm of daily realized volatility against the corresponding normal
quantiles. We compute realized volatility as the square root of AvgRV , where AvgRV is the average of five
daily RVs each computed from 5-minute squared returns on a 1-minute grid of S&P500 futures prices.

Corsi model (HAR):

RVt = 0 + 1 RVt1 + 2 RVt5:t1 + 3 RVt21:t1 + t

Even better:

log RVt = 0 + 1 log RVt1 + 2 log RVt5:t1 + 3 log RVt21:t1 + t

Ensures positivity and promotes normality


RV-VaR

RV V aRTp+1|T = RV
d T +1|T 1
p ,

GARCH-RV

t2 = + t1
2
+ RVt1

Fine for 1-step

Multi-step requires closing the system with an RV equation

Realized GARCH
HEAVY

Separating Jumps

QVt = IVt + JVt


VOLATILITY DYNAMICS 159

ACF of Daily RVAVR


0.8

0.6
Autocorrelation

0.4

0.2

50 100 150 200 250


Lag Order

ACF of Daily Return


0.8

0.6
Autocorrelation

0.4

0.2

50 100 150 200 250


Lag Order

Figure 10.14: S&P500: Sample Autocorrelations of Daily Realized Variance and Daily Re-
turn. The top panel shows realized variance autocorrelations, and the bottom panel shows return autocor-
relations, for displacements from 1 through 250 days. Horizontal lines denote 95% Bartlett bands. Realized
variance is AvgRV , the average of five daily RVs each computed from 5-minute squared returns on a 1-minute
grid of S&P500 futures prices.

where
Jt
X
2
JVt = Jt,j
j=1

e.g., we might want to explore:

RVt = 0 + 1 IVt1 + 2 IVt5:t1 + 3 IVt21:t1


+ 1 JVt1 + 2 JVt5:t1 + 3 JVt21:t1 + t
But How to Separate Jumps?

Truncation:
N ()
X
T Vt () = p2t1+j I ( pt1+j < T )
j=1

Bi-Power Variation:
N ()1
N () X
BP Vt () = |pt1+j | |pt1+(j+1) |
2 N () 1 j=1

Minimum:
  N ()1
N () X  2
M inRVt () = min |pt1+j |, |pt1+(j+1) |
2 N () 1 j=1

Rigorous Modeling III


Conditional Asset-Level (Multivariate) Volatility Dynam-
160 CHAPTER 10

ics from Daily Data


Multivariate
Univariate volatility models useful for portfolio-level risk measurement (VaR, ES, etc.)
But what about risk management questions:

Portfolio risk change under a certain scenario involving price movements of set of
assets or asset classes?

Portfolio risk change if certain correlations increase suddenly

Portfolio risk change if I double my holdings of Intel?

How do optimal portfolio shares change if the covariance matrix moves in a certain
way?

Similarly, what about almost any other question in asset pricing, hedging, trading? Almost
all involve correlation.
Basic Framework and Issues I
N 1 return vector Rt
N N covariance matrix t
N (N +1)
2 distinct elements

Structure needed for pd or even psd

Huge number of parameters even for moderate N

And N may be not be moderate!

Basic Framework and Issues II


Univariate:

rt = t zt

zt i.i.d.(0, 1)

Multivariate:
1/2
Rt = t Zt

Zt i.i.d.(0, I)
1/2
where t is a square-root (e.g., Cholesky factor) of t
Ad Hoc Exponential Smoothing (RM)

0
t = t1 + (1 ) Rt1 Rt1
VOLATILITY DYNAMICS 161

Assumes that the dynamics of all the variances and covariances are driven by a single
scalar parameter (identical smoothness)

Guarantees that the smoothed covariance matrices are pd so long as 0 is pd


PT
Common strategy is to set 0 equal to the sample covariance matrix 1
T t=1 Rt Rt0
(which is pd if T > N )

But covariance matrix forecasts inherit the implausible scaling properties of the uni-
variate RM forecasts and will in general be suboptimal

Multivariate GARCH(1,1)

0
vech (t ) = vech (C) + B vech (t1 ) + A vech (Rt1 Rt1 )

vech operator converts the upper triangle of a symmetric matrix into a 12 N (N + 1) 1


column vector

A and B matrices are both of dimension 21 N (N + 1) 12 N (N + 1)

Even in this parsimonious GARCH(1,1) there are O(N 4 ) parameters


More than 50 million parameters for N = 100!

Encouraging Parsimony: Diagonal GARCH(1,1)


Diagonal GARCH constrains A and B matrices to be diagonal.

0
vech (t ) = vech (C) + (I) vech (t1 ) + (I) vech (Rt1 Rt1 )

Still O(N 2 ) parameters.


Encouraging Parsimony: Scalar GARCH(1,1)
Scalar GARCH constrains A and B matrices to be scalar:
0
vech (t ) = vech (C) + (I) vech (t1 ) + (I) vech (Rt1 Rt1 )

Mirrors RM, but with the important difference that the t forecasts now revert to
= (1 )1 C
Fewer parameters than diagonal, but still O(N )2
(because of C)
Encouraging Parsimony: Covariance Targeting
Recall variance targeting:
T
1X 2
2 =
r , 2 = 2
= take = (1 )
T t=1 t 1
162 CHAPTER 10

Covariance targeting is the obvious multivariate generalization:


T
1 X
vech(C) = (I A B) vech ( Rt Rt0 )
T t=1

Encourages both parsimony and reasonableness


Constant Conditional Correlation (CCC) Model
[Key is to recognize that correlation matrix
is the covariance matrix of standardized returns]
Two-step estimation:

Estimate N appropriate univariate GARCH models

t1
Calculate standardized return vector, et = Rt D
PT
Estimate correlation matrix (assumed constant) as 1
T t e0t
t=1 e

Quite flexible as the N models can differ across returns


Dynamic Conditional Correlation (DCC) Model
Two-step estimation:

Estimate N appropriate univariate GARCH models

t1
Calculate standardized return vector, et = Rt D

Estimate correlation matrix t (assumed to have scalar GARCH(1,1)-style dynamics)


as following

vech(t ) = vech(C) + (I)vech(t1 ) + (I)vech(et1 e0t1 )

Correlation targeting is helpful

DECO

Time-varying correlations assumed identical across all pairs of assets, which implies:

t = (1 t ) I + t J ,

where J is an N N matrix of ones

Analytical inverse facilitates estimation:


 
1 1 t
t = I J
(1 t ) 1 + (N 1)t

Assume GARCH(1,1)-style conditional correlation structure:

t = + ut + t1
VOLATILITY DYNAMICS 163

DECO Correlation, 19732009

0.8

0.6

0.4

0.2

0
75 80 85 90 95 00 05 10

Figure 10.15: Time-Varying International Equity Correlations. The figure shows the estimated
equicorrelations from a DECO model for the aggregate equity index returns for 16 different developed
markets from 1973 through 2009.

Updating rule is naturally given by the average conditional correlation of the stan-
dardized returns,
PN PN
2 i=1 j>i ei,t ej,t
ut = PN
N i=1 e2i,t

Three parameters, , and , to be estimated.

DECO Example
Factor Structure

Rt = Ft + t

where
1/2
Ft = F t Zt

Zt i.i.d.(0, I)

t i.i.d.(0, )

= t = F t 0 + t

One-Factor Case with Everything Orthogonal

Rt = ft + t
164 CHAPTER 10

where

ft = f t zt

zt i.i.d.(0, 1)

t i.i.d.(0, 2 )

= t = f2 t 0 +

2
it = f2 t 2i + i
2

2
ijt = f2 t i j

Rigorous Modeling IV
Conditional Asset-Level (Multivariate) Volatility Dynam-
ics from High-Frequency Data
Realized Covariance

dP (t) = M (t) dt + (t)1/2 dW (t)

N ()
X
0
RCovt () Rt1+j, Rt1+j,
j=1

Z t
RCovt () ICovt = ( ) d
t1

p.d. so long as N () > N ; else use regularization methods


Asynchronous Trading and the Epps Effect
Epps effect biases covariance estimates downward
Can overcome Epps by lowering sampling frequency to accommodate least-frequently-
traded asset, but that wastes data
Opposite extreme: Calculate each pairwise realized covariance matrix using appropriate
sampling; then assemble and regularize
Regularization (Shrinkage)
VOLATILITY DYNAMICS 165

15

10

5
Quantiles of Input Sample

10

15
15 10 5 0 5 10 15
Standard Normal Quantiles

Figure 10.16: QQ Plot of S&P500 Returns. We show quantiles of daily S&P500 returns from January
2, 1990 to December 31, 2010, against the corresponding quantiles from a standard normal distribution.

S = RCovt () + (1 ) t
t

t is p.d. and 0 < < 1


t = I (naive benchmark)
t = (unconditional covariance matrix)
t = f2 0 + (one-factor market model)
Multivariate GARCH-RV

t1 )
vech (t ) = vech (C) + B vech (t1 ) + A vech(

Fine for 1-step

Multi-step requires closing the system with an RV equation


Noureldin et al. (2011), multivariate HEAVY

Rigorous Modeling V
Distributions
Modeling Entire Return Distributions:
Returns are not Unconditionally Gaussian
Modeling Entire Return Distributions:
Returns are Often not Conditionally Gaussian
Modeling Entire Return Distributions: Issues

Gaussian QQ plots effectively show calibration of Gaussian VaR at different levels

Gaussian unconditional VaR is terrible

Gaussian conditional VaR is somewhat better but left tail remains bad
166 CHAPTER 10

2
Quantiles of Input Sample

5
5 4 3 2 1 0 1 2 3 4 5
Standard Normal Quantiles

Figure 10.17: QQ Plot of S&P500 Returns Standardized by NGARCH Volatilities. We show


quantiles of daily S&P500 returns standardized by the dynamic volatility from a NGARCH model against
the corresponding quantiles of a standard normal distribution. The sample period is January 2, 1990 through
December 31, 2010. The units on each axis are standard deviations.

Gaussian conditional expected shortfall, which integrates over the left tail, would be
terrible

So we want more accurate assessment of things like V aRTp +1|T than those obtained
under Gaussian assumptions
Doing so for all values of p [0, 1] requires estimating the entire conditional return
distribution
More generally, best-practice risk measurement is about tracking the entire condi-
tional return distribution

Observation-Driven Density Forecasting


Using r = and GARCH
Assume:

rT +1 = T +1/T T +1

T +1 iid(0, 1)

Multiply T +1 draws by T +1/T (fixed across draws, from a GARCH model) to build up
the conditional density of rT +1 .

T +1 simulated from standard normal

T +1 simulated from standard t


rT +1
T +1 simulated from kernel density fit to T +1/T

T +1 simulated from any density that can be simulated


VOLATILITY DYNAMICS 167

2
Quantiles of Input Sample

5
5 4 3 2 1 0 1 2 3 4 5
Standard Normal Quantiles

Figure 10.18: QQ Plot of S&P500 Returns Standardized by Realized Volatilities. We show


quantiles of daily S&P500 returns standardized by AvgRV against the corresponding quantiles of a standard
normal distribution. The sample period is January 2, 1990 through December 31, 2010. The units on each
axis are standard deviations.

Parameter-Driven Density Forecasting


Using r = and SV
Assume:

rT +1 = T +1 T +1

T +1 iid(0, 1)

Multiply T +1 draws by T +1 draws (from a simulated SV model) to build up the condi-


tional density of rT +1 .
Again, T +1 simulated from any density deemed relevant
Modeling Entire Return Distributions:
Returns Standardized by RV are Approximately Gaussian
A Special Parameter-Driven Density Forecasting Approach
Using r = and RV
(Log-Normal / Normal Mixture)
Assume:

rT +1 = T +1 T +1

T +1 iid(0, 1)

Multiply T +1 draws from N (0, 1) by T +1 draws (from a simulated RV model fit to log
realized standard deviation) to build up the conditional density of rT +1 .
168 CHAPTER 10

Pitfalls of the r = Approach


In the conditionally Gaussian case we can write with no loss of generality:

rT +1 = T +1/T T +1

T +1 iidN (0, 1)

But in the conditionally non-Gaussian case there is potential loss of generality in writing:

rT +1 = T +1/T T +1

T +1 iid(0, 1),

because there may be time variation in conditional moments other than T +1/T , and using
T +1 iid(0, 1) assumes that away
Multivariate Return Distributions
If reliable realized covariances are available, one could do a multivariate analog of the
earlier lognormal/normal mixture model. But the literature thus far has focused primarily
on conditional distributions for daily data.
Return version:
1/2
Zt = t Rt , Zt i.i.d., Et1 (Zt ) = 0 V art1 (Zt ) = I

Standardized return version (as in DCC):

et = Dt1 Rt , Et1 (et ) = 0, V art1 (et ) = t

where Dt denotes the diagonal matrix of conditional standard deviations for each of the
assets, and t refers to the potentially time-varying conditional correlation matrix.
Leading Examples
Multivariate normal:

f (et ) = C (t ) exp 12 e0t 1



t et

Multivariate t:

(d+N )/2
e0 1 et

f (et ) = C (d, t ) 1+ t t
(d 2)
VOLATILITY DYNAMICS 169

Multivariate asymmetric t:
  r    
C d, t K d+N 1 (et )
0
d + (et ) 1 exp (et )
0 1
0
t t t
2
f (et ) = (d+N )
 (d+N ) r 
1 (e )

0
(et ) t 2 2

1+ t d + (et ) 1 (et )
0 1
0
d t t

More flexible than symmetric t but requires estimation of N asymmetry parameters si-
multaneously with the other parameters, which is challenging in high dimensions.
Copula methods sometimes provide a simpler two-step approach.
Copula Methods
Sklars Theorem:

F (e) = G( F1 (e1 ), ..., FN (eN ) ) G( u1 , ..., uN ) G(u)

N
N G(F1 (e1 ), ..., FN (eN )) Y
f (e) = = g (u) fi (ei )
e1 ...eN i=1

T
X T X
X N
= log L = log g(ut ) + log fi (ei,t )
t=1 t=1 i=1

Standard Copulas
Normal:

 
1 1 1 1
g(ut ; t ) = |t | 2 0 1
exp (ut ) (t I) (ut )
2
where 1 (ut ) refers to the N 1 vector of standard inverse univariate normals, and the
correlation matrix t pertains to the N 1 vector et with typical element,

ei,t = 1 (ui,t ) = 1 (Fi (ei,t )).

Often does not allow for sufficient dependence between tail events.
t copula
Asymmetric t copula
Asymmetric Tail Correlations
Multivariate Distribution Simulation (General Case)
Simulate using:

1/2
Rt = t Zt

Zt i.i.d.(0, I)

Zt may be drawn from parametrically-(Gaussian, t, ...) or nonparametrically-fitted


170 CHAPTER 10

16 Developed Markets, 19732009


0.5

Empirical
Gaussian
0.4 DECO

0.3
Threshold Correlation

0.2

0.1

0
1 0.5 0 0.5 1
Standard Deviation

Figure 10.19: Average Threshold Correlations for Sixteen Developed Equity Markets. The
solid line shows the average empirical threshold correlation for GARCH residuals across sixteen developed
equity markets. The dashed line shows the threshold correlations implied by a multivariate standard normal
distribution with constant correlation. The line with square markers shows the threshold correlations from a
DECO model estimated on the GARCH residuals from the 16 equity markets. The figure is based on weekly
returns from 1973 to 2009.

distributions, or with replacement from the empirical distribution.


Multivariate Distribution Simulation (Factor Case)
Simulate using:

1/2 ZF,t
Ft = F,t

Ft + t
Rt =

ZF,t and t may be drawn from parametrically- or nonparametrically-fitted distributions,


or with replacement from the empirical distribution.

Rigorous Modeling VI
Risk, Return and Macroeconomic Fundamentals
We Want to Understand the Financial / Real Connections
Statistical vs. scientific models
Returns Fundamentals
rf
Disconnect?
excess volatility, disconnect, conundrum, ...
r , r , f , f
Links are complex:
r r f f
Volatilities as intermediaries?
For Example...
VOLATILITY DYNAMICS 171

Mean Recession Standard Sample


Volatility Increase Error Period
Aggregate Returns 43.5% 3.8% 63Q1-09Q3
Firm-Level Returns 28.6% 6.7% 69Q1-09Q2

Table 10.1: Stock Return Volatility During Recessions. Aggregate stock-return volatility is quar-
terly realized standard deviation based on daily return data. Firm-level stock-return volatility is the cross-
sectional inter-quartile range of quarterly returns.

Mean Recession Standard Sample


Volatility Increase Error Period
Aggregate Growth 37.5% 7.3% 62Q1-09Q2
Firm-Level Growth 23.1% 3.5% 67Q1-08Q3

Table 10.2: Real Growth Volatility During Recessions. Aggregate real-growth volatility is quarterly
conditional standard deviation. Firm-level real-growth volatility is the cross-sectional inter-quartile range of
quarterly real sales growth.

GARCH r usually has no f or f :


2 2 2
r,t = + rt1 + r,t1 .

One might want to entertain something like:


2 2 2
r,t = + rt1 + r,t1 + 1 f,t1 + 2 f,t1 .

f r
Return Volatility is Higher in Recessions
Schwerts (1989) failure: Very hard to link market risk to expected fundamentals (lever-
age, corporate profitability, etc.).
Actually a great success:
Key observation of robustly higher return volatility in recessions!
Earlier: Officer (1973)
Later: Hamilton and Lin (1996), Bloom et al. (2009)
Extends to business cycle effects in credit spreads via the Merton model
f r , Continued
Bloom et al. (2009) Results
f f
Fundamental Volatility is Higher in Recessions
More Bloom, Floetotto and Jaimovich (2009) Results
f r
Return Vol is Positively Related to Fundamental Vol
Follows immediately from relationships already documented
Moreover, direct explorations provide direct evidence:
Engle et al. (2006) time series
172 CHAPTER 10

Diebold and Yilmaz (2010) cross section


Engle and Rangel (2008) panel
Can be extended to fundamental determinants of correlations (Engle and Rangle, 2011)
[Aside: Inflation and its Fundamental (U.S. Time Series)]

Weak inflation / money growth link


[Inflation and its Fundamental (Barros Cross Section)]
Strong inflation / money growth link
100

90

80

70
P (% per year)

60

50

40

30

20

10

0
0 10 20 30 40 50 60 70 80 90 100

M currency (% per year)

Back to f r : Cross-Section Evidence


VOLATILITY DYNAMICS 173

Real Stock Return Volatility and Real PCE Growth Volatility, 1983-2002

Now Consider Relationships Involving the Equity Premium


?? r ??
r r
Risk-Return Tradeoffs (or Lack Thereof)
Studied at least since Markowitz
ARCH-M characterization:

Rt = 0 + 1 Xt + 2 t + t

t2 = + rt1
2 2
+ t1

But subtleties emerge...


r f
Odd Fama-French (1989):

rt+1 = 0 + 1 dpt + 2 termt + 3 deft + t+1

Less Odd Lettau-Ludvigson (2001):

rt+1 = 0 + 1 dpt + 2 termt + 3 deft + 4 cayt + t+1

Natural Campbell-Diebold (2009):


rt+1 = 0 + 1 dpt + 2 termt + 3 deft + 4 cayt + 5 gte + t+1
Also Goetzman et al. (2009) parallel cross-sectional analysis
Expected Business Conditions are Crucially Important!
r f
Bansal and Yaron (2004)
(and many others recently)
174 CHAPTER 10

(1) (2) (3) (4) (5) (6) (7)


gte -0.22 -0.21 -0.20 -0.20
(0.08) (0.09) (0.09) (0.10)

DPt 0.25 0.17 0.19 0.12


(0.10) (0.10) (0.12) (0.11)
DEFt -0.11 -0.01 -0.10 0.00
(0.07) (0.09) (0.08) (0.09)
T ERMt 0.15 0.17 0.09 0.11
(0.07) (0.07) (0.09) (0.09)
CAYt 0.24 0.22 0.17 0.15
(0.07) (0.08) (0.11) (0.10)

So, Good News:


Were Learning More and More About the Links
Weve Come a Long Way Since Markowitz:
r r
The Key Lesson
The business cycle is of central importance for both r and r
Highlights the importance of high-frequency business cycle monitoring. We need to
interact high-frequency real activity with high-frequency financial market activity
e.g., Aruoba-Diebold-Scotti real-time framework at Federal Reserve Bank of Philadelphia
Conclusions

Reliable risk measurement requires conditional models that allow for time-varying
volatility.

Risk measurement may be done using univariate volatility models. Many important
recent developments.

High-frequency return data contain a wealth of volatility information.

Other tasks require multivariate models. Many important recent developments, espe-
cially for N large. Factor structure is often useful.

The business cycle emerges as a key macroeconomic fundamental driving risk.

New developments in high-frequency macro monitoring yield high-frequency real ac-


tivity data to match high-frequency financial market data.

****************************
Models for non-negative variables (from Minchul)
Introduction Motivation: Why do we need dynamic models for positive values?

Volatility: Time-varying conditional variances


BAYES 175

Duration: Intertrade duration, Unemployment spell

Count: Defaults of U.S. corporations

Autoregressive Gamma processes (ARG)

Gourieroux and Jasiak (2006)

Monfort, Pegoraro, Renne and Roussellet (2014)

Alternative model

ACD (autoregressive conditional duration) by Engle and Russell (1998)

Its extension through Dynamic conditional score models

Harvey (2013)
Creal, Koopman, and Lucas (2013)
Autoregressive Gamma Processes
Autoregressive Gamma Processes (ARG): Definition Definition: Yt follows the autoregressive gamma
process if

Yt conditional on Yt1 follows the non-central gamma distribution with


degree of freedom parameter:
non-centrality parameter: Yt1
scale parameter: c

Very exotic ... but we can guess


Gamma distribution Maybe it takes positive values
Conditional dynamics through non-centrality parameter
ARG Processes: State space representation If Yt follows ARG, then

Measurement:

Yt Zt Gamma( + Zt , c)

Transition:

Zt Yt1 P oisson(Yt1 )
176 CHAPTER 10

Yt takes positive real number


Zt takes positive integer
Dynamics through Zt

Conditional moments Measurement:



Yt Zt Gamma( + Zt , c)

Transition:

Zt Yt1 P oisson(Yt1 )

Conditional moments:

E(Yt |Yt1 ) = Yt1 + c


V (Yt |Yt1 ) = 2cYt1 + c2
Corr(Yt , Yth ) = h

where = c > 0.

The process is stationary when < 1.


Conditional over-dispersion The conditional over-dispersion exists if and only if

V (Yt |Yt1 ) > E(Yt |Yt1 )2

When < 1,
The stationary ARG process features marginal over-dispersion.
The process may feature either conditional under- or over-dispersion, depending on the value of Yt1 .

Remark: ACD (autoregressive conditional duration) model assumes the path-indepednet over-dispersion.
Continuous time limit of ARG(1) The stationary ARG process is a discretized version of the CIR process.
p
dYt = a(b Yt )dt + Yt dWt

where

a = log
c
b=
1
2 log
2 = c
1

This process is non-negative almost surely.

Originally model for interest rates.


Also used for volatility dynamics.
BAYES 177

Figure 10.20: Simulated data, = 0.5

Figure 10.21: Simulated data, = 0.9

Long memory Case 1) Let = 1, then

Yt is a stationary Markov process.


An autocorrelation function with a hyperbolic rate of decay.

Case 2) Stochastic autoregressive coefficient. Let . Then

Corr(Yt , Yth |, c, ) = E (h )

The autocorrelation function features hyperbolic decay when the distribution assigns sufficiently large
probabilities to values close to one.
Figures 1

Application in the original paper


Measurement:

Yt Zt Gamma( + Zt , c)

Transition:

Zt Yt1 P oisson(Yt1 )

Yt : Interquote durations of the Dayton Mining stock traded on the Toronto Stock Exchange in October
1998.
Estimation based on QMLE

Extension Creal (2013) considers the following non-linear state space


178 CHAPTER 10

Measurement

yt p(yt |ht , xt ; )

where xt is an exogenous regressor.

Transition

ht Gamma( + zt , c)
zt P oisson(ht1 )

When yt = ht , the process becomes ARG.


Various applications are fall into this form.

Example 1: Stochastic volatility models Measurement


p
yt = + xt + ht et , et N (0, 1)

Transition

ht Gamma( + zt , c)
zt P oisson(ht1 )

Example 2: Stochastic duration and intensity models Measurement

yt Gamma (, ht exp(xt ))

Transition

ht Gamma( + zt , c)
zt P oisson(ht1 )

Example 3: Stochastic count models Measurement

yt P oisson (ht exp(xt ))

Transition

ht Gamma( + zt , c)
zt P oisson(ht1 )

Recent extension: ARG-zero processes 1 Monfort, Pegoraro, Renne, Roussellet (2014) extend ARG process
to take account for zero-lower bound spells,

Recent extension: ARG-zero processes 2 Monfort, Pegoraro, Renne, Roussellet (2014) extend ARG process
to take account for zero-lower bound spells,
BAYES 179

If Yt follows ARG, then



Yt Zt Gamma( + Zt , c)

Zt Yt1 P oisson(Yt1 )

If Yt follows ARG-zero, then



Yt Zt Gamma(Zt , c)

Zt Yt1 P oisson( + Yt1 )

Two modifications
= 0: As 0, Gamma(, c) converges to dirac delta function.
is related with a probability of escaping from the zero lower bound.
Characterization Probability density for ARG-zero is

X
p(Yt |Yt1 ; , , c) = g(Yt , Yt1 , , , c, z)1{Yt >0} + exp( Yt1 )1{Yt =0}
z=1

Second term is consequence of 0.


If = 0, Yt = 0 becomes an absorbing state.

Conditional moments
E[Yt |Yt1 ] = c + Yt1
and
V (Yt |Yt1 ) = 2c2 + 2cYt1
where = c.
Figure: ARG-zero

ACD and DCS


180 CHAPTER 10

Figure 10.22: Simulated data

Autoregressive conditional duration model (ACD) Yt follows the autoregressive conditional duration
model if

yt = t et , E[et ] = 1
t = w + t1 + yt1

Because of its multiplicative form, it is classified as the multiplicative error model (MEM).
Conditional moments

E[yt |y1:t1 ] = t
V (yt |y1:t1 ) = k0 2t

Conditional over-dispersion is path-independent

V (yt |y1:t1 )
= k0
E[yt |y1:t1 ]2

Recall that ARG process can have path-dependent over-dispersion.

Dynamic conditional score (DCS) model Dynamic conditional score model (or Generalized Autoregressive
Score model) is a general class of observation-driven model.

Observation-driven model is a time-varying parameter model where time-varying parameter is a


function of histories of observable. For example, GARCH, ACD, ...
DCS (GAS) model encompasses GARCH, ACD, and other observation-driven models.

The idea is very simple and pragmatic


Give me a conditional likelihood and time-varying parameters, I will give you a law of motion for
time-varying parameters.

Convenient and general modelling strategy. I will describe it within the MEM class of model.
DCS Example: ACD 1 Recall

yt = t et , E[et ] = 1
t = w + t1 + yt1
BAYES 181

Instead, we apply DCS principle: Give me conditional likelihood and time-varying parameters, then I
will give you a law motion
yt = t et , et Gamma(, 1/)
DCS Example: ACD 2
yt = t et , et Gamma(, 1/)

Then DCS specifies a law of motion for t as follows:

t = w + t1 + st1

where (w, , ) are additional parameters and st is a scaled score,


1
log p(yt |t , y1:t ; ) log p(yt |t , y1:t ; ) 0

log p(yt |t , y1:t ; )
st = Et1
t t t

In this case, it happens to be

t = w + t1 + yt1

which is ACD.

However, a law of motion will be different with different choice of distribution General-
ized Gamma, Log-Logistic, Burr, Pareto, and many other distributions

10.5 EXERCISES, PROBLEMS AND COMPLEMENTS

10.6 NOTES
Chapter Eleven

High Dimensionality

11.1 EXERCISES, PROBLEMS AND COMPLEMENTS

1. xxx

11.2 NOTES
Appendices

183
Appendix A

Nonparametrics

A.1 DENSITY ESTIMATION

A.1.1 The Basic Problem


iid
{xi }N
i=1 f (x)

f smooth in [x0 h, x0 + h]

Goal: Estimate f (x) at arbitrary point x = x0


By the mean-value theorem,

Z x0 +h
1 1
f (x0 ) f (u)du = P (x [x0 h, x0 + h])
2h x0 h 2h

#xi [x0 h, x0 +h]


Estimate P (x [x0 h, x0 + h]) by N

1 #xi [x0 h, x0 + h]
fh (x0 ) =
2h N

N  
1 X1 x0 xi
= I 1
N h i=1 2 h

Rosenblatt estimator

Kernel density estimator with

kernel: K(u) = 21 I(|u| 1)

bandwidth: h

A.1.2 Kernel Density Estimation

Issues with uniform kernels:


NONPARAMETRICS 185

1. Why weight distant observations as heavily as nearby ones?

2. Why use a discontinuous kernel if we think that f is smooth?

Obvious solution: Choose smooth kernel

Standard conditions:

R
K(u)du = 1

K(u) = K(u)
Common Kernel Choices
u2
Standard normal: K(u) = 1 e 2
2

Triangular K(u) = (1 |u|)I(|u| 1)

Epinechnikov: K(u) = 34 (1 u2 )I(|u| 1)


General Form of the Kernel Density Estimator

N  
1 X x0 xi
fh (x0 ) = K
N h i=1 h

Rosenblatt-Parzen estimator

A.1.3 Bias-Variance Tradeoffs

A.1.3.1 Inescapable Bias-Variance Tradeoff (in Practice, Fixed N )

A.1.3.2 Escapable Bias-Variance Tradeoff (in Theory, N )


h2
E(fh (x0 )) f (x0 ) + 2 Op (1)

(So h 0 = bias 0)

var (fh (x0 )) 1


Nh Op (1)

(So N h = var 0)

Thus,
) p
h0
= fh (x0 ) f (x0 )
Nh
186 APPENDIX A

Figure A.1: Bandwidth Choice from Silverman (1986)

A.1.3.3 Convergence Rate

d

N h(fh (x0 ) f (x0 )) D

Effects of K minor; effects of h major.

A.1.4 Optimal Bandwidth Choice


   2
M SE fh (x0 ) = E fh (x0 ) f (xo )
 
M SE fh (x0 ) f (x) dx
R
IM SE =

Choose bandwidth to minimize IMSE:

h = N 1/5
Corresponding Optimal Convergence Rate
Recall:

  d
N h fh (x0 ) f (x0 ) D

h N 1/5

Substituting yields the best obtainable rate:


NONPARAMETRICS 187

p   d
N 4/5 fh (x0 ) f (x0 ) D

Stone optimal rate


Silvermans Rule
For the Gaussian case,

h = 1.06N 1/5

So use:

= 1.06
h N 1/5

Better to err on the side of too little smoothing:

=
h N 1/5

A.2 MULTIVARIATE

Earlier univariate kernel density estimator:

N  
1 X x0 xi
fh (x0 ) = K
N h i=1 h

Can be written as:


N
1 X
fh (x0 ) = Kh (x0 xi )
N i=1

where Kh () = h1 K( h )

or Kh () = h1 K(h1 )
Multivariate Version (d-Dimensional)
Precisely follows equation (A.2):

N
1 X
fH (x0 ) = KH (x0 xi ),
N i=1

where KH () = |H|1 K(H 1 ), and H (d d) is psd.


188 APPENDIX A

Common choice: K(u) = N (0, I), H = hI


   
1 1 1 x0 xi
= KH () = d K = dK
h h h h

N  
1 X x0 xi
= fh (x0 ) = K
N hd i=1 h

Bias-Variance Tradeoff, Convergence Rate, Optimal Bandwidth, Correpsonding Optimal


Convergence Rate

) p
h0
= fh (x0 ) f (x0 )
N hd

  d
N hd
fh (x0 ) f (x0 ) D

1
h N d+4

q
d
  d
N 1 d+4 fh (x0 ) f (x0 ) D

Stone-optimal rate drops with d

Curse of dimensionality
Silvermans Rule

 1
 d+4
= 4 1
h N d+4

d+2

where

d
2 1X 2

=

d i=1 i

(average sample variance)


NONPARAMETRICS 189

A.3 FUNCTIONAL ESTIMATION

Conditional Mean (Regression)


Z
f (y, x)
E(y|x) = M (x) = y dy
f (x)
Regression Slope

M (x) (M (x + h2 ) M (x h2 ))
(x) = = lim
xj h0 h

Regression Disturbance Density

f (u), u = y M (x)

Conditional Variance
Z
f (y, x)
var(y|x) = V (x) = y2 dy M (x)2
f (x)

Hazard Function

f (t)
(t) =
1 F (t)

Curvature (Higher-Order Derivative Estimation)

2 lim (x + h2 ) (x h2 )
C(x) = (x) = ( )M (x) =
xj xj 2 h0 h

The curse of dimensionality is much worse for curvature...

d-vector: r = (r1 , ..., rd ), |r| = di=1 ri


|r|

Define M (r) (x) r1 x1 ,..., rd xd M (x)


2|r|+d
Then Nh (r) (x0 ) M (r) (x0 )] d D
[M

A.4 LOCAL NONPARAMETRIC REGRESSION

A.4.1 Kernel Regression


Z Z
f (x0 , y)
M (x0 ) = yf (y|x0 )dy = y dy
f (x0 )
190 APPENDIX A

Using multivariate kernel density estimates and manipulating gives the Nadaraya-Watson
estimator:

N
" #
x0 xi

h (x0 ) =
X K h
M PN x0 xi
 yi
i=1 i=1 K h

h 0, N h =

d

h (x0 ) M (x0 )) N (0, V )
N hd (M

A.4.2 Nearest-Neighbor Regression

A.4.2.1 Basic Nearest-Neighbor Regression

M k (x0 ) = 1 P
k in(x0 ) yi (Locally Constant, uniform weighting)

k , k k (x0 ) P M (x0 )
0 M
N


k (M k (x0 ) M (x0 )) d D

Equivalent to Nadaraya-Watson kernel regression with:
1
K(u) = 2 I(|u| 1) (uniform)
and h = R(k) (distance from x0 to k th nearest neighbor)
Variable bandwidth!

A.4.2.2 Locally-Weighted Nearest-Neighbor Regression (Locally Polynomial, Non-Uniform


Weighting)

yt = g(xt ) + t

Computation of g(x ) :

0 < 1

kT = int( T )

Find KT nearest neighbors using norm:


1
(x , xkT ) = [P
j=1 (xkT j xj )2 ] 2
Neighborhood weight function:
NONPARAMETRICS 191

 
(xt , x )
vt (xt , x , xkT ) = C (x , x
k )
T

(
(1 u3 )3 f or u < 1
C(u) =
0 otherwise

A.5 GLOBAL NONPARAMETRIC REGRESSION

A.5.1 Series (Sieve, Projection, ...)

M (x0 ) =
j=0 j j (x0 )
(the j are orthogonal basis functions)
M J (x0 ) = J j j (x0 )
j=0
P
J , J
N 0 M J (x0 ) M (x0 )

Stone-optimal convergence rate, for suitable choice of J .

A.5.2 Neural Networks

Run linear combinations of inputs through squashing functions i = 1, ..., R inputs, j =


1, ..., S neurons

hjt = (jo + R
i=1 ij xit ), j = 1, ..., S (N euron j)
e.g. () can be logistic (regression), 0-1 (classification)

Ot = (0 + Sj=1 j hjt )
e.g. () can be the identity function

Compactly: Ot = (0 + Sj=1 j (jo + R


i=1 ij xit ) f (xt ; )

Universal Approximator: S , S
N 0 O(x0 ) p O(x0 )

Same as other nonparametric methods.

A.6 TIME SERIES ASPECTS

1. Many results go through under mixing or Markov conditions.

2. Recursive kernel regression.


Use recursive kernel estimator:

fN (x0 ) = ( NN1 )fN 1 (x0 ) + 1


N hd
K( x0 x
h
N
)
192 APPENDIX A

to get:

x xN
N (x0 ) = (N 1)hd fN 1 (x0 )M
N 1 (x0 ) + YN K( 0 )
M x x
h
(N 1)hd fN 1 (x0 ) + K( 0 N )
h

3. Bandwidth selection via recursive prediction.

4. Nonparametric nonlinear autoregression.


yt = g(yt1 , ..., ytp ) + t
R
E(yt+1 | yt , ..., ytp+1 ) = yt+1 f (yt+1 | yt , ..., ytp+1 ) dy
R f (yt+1 ,...,ytp+1 )
= yt+1 f (yt ,...,ytp+1 ) dy

Implementation: Kernel, Series, NN, LWR

5. Recurrent neural nets.


hjt = (jo + R S
i=1 ij xit + l=1 jl hl, t1 ), j = 1, ..., S

Ot = (0 + Sj=1 j hjt )

Compactly: Ot = (0 + Sj=1 j (j0 + R S


i=1 ij xi t + l=1 jl hl, t1 )

Back substitution:
Ot = g(xt , xt1 , ..., x1 ; )

A.7 EXERCISES, PROBLEMS AND COMPLEMENTS

1. Tightly parametric models are often best for time-series prediction.


Generality isnt so great; restrictions often help!

2. Semiparametric and related approaches.



N consistent estimation. Adaptive estimation.

A.8 NOTES
Appendix B

A Library of Useful Books

Ait-Sahalia, Y. and Hansen, L.P. eds. (2010), Handbook of Financial Econometrics. Ams-
terdam: North-Holland.

Ait-Sahalia, Y. and Jacod, J. (2014), High-Frequency Financial Econometrics, Princeton


University Press.

Beran, J., Feng, Y., Ghosh, S. and Kulik, R. (2013), Long-Memory Processes: Probabilistic
Properties and Statistical Methods, Springer.

Box, G.E.P. and Jenkins, G.W. (1970), Time Series Analysis, Forecasting and Control,
Prentice-Hall.

Davidson, R. and MacKinnon, J. (1993), Estimation and Inference in Econometrics, Oxford


University Press.

Diebold, F.X. (1998), Elements of Forecasting, South-Western.

Douc, R., Moulines, E. and Stoffer, D.S. (2014), Nonlinear Time Series: Theory, Methods,
and Applications with R Examples, Chapman and Hall.

Durbin, J. and Koopman, S.J. (2001), Time Series Analysis by State Space Methods, Oxford
University Press.

Efron, B. and Tibshirani, R.J. (1993), An Introduction to the Bootstrap, Chapman and
Hall.

Elliott, G., Granger, C.W.J. and Timmermann, A., eds. (2006), Handbook of Economic
Forecasting, Volume 1, North-Holland.

Elliott, G., Granger, C.W.J. and Timmermann, A., eds. (2013), Handbook of Economic
Forecasting, Volume 2, North-Holland.

Engle, R.F. and McFadden, D., eds. (1995), Handbook of Econometrics, Volume 4, North-
Holland.
194 APPENDIX B

Geweke, J. (2010), Complete and Incomplete Econometric Models, Princeton University


Press.

Geweke, J., Koop, G. and van Dijk, H., eds. (2011), The Oxford Handbook of Bayesian
Econometrics, Oxford University Press.

Granger, C.W.J. and Newbold, P. (1977), Forecasting Economic Time Series, Academic
Press.

Granger, C.W.J. and Tersvirta, Y. (1996), Modeling Nonlinear Economic Relationships,


Oxford University Press.

Hall, P. (1992), The Bootstrap and Edgeworth Expansion, Springer Verlag.

Hammersley, J.M. and Handscomb, D.C. (1964), Monte Carlo Methods, Chapman and Hall.

Hansen, L.P. and Sargent, T.J. (2013), Recursive Models of Dynamic Linear Economies,
Princeton University Press.

Harvey, A.C. (1989), Forecasting, Structural Time Series Models and the Kalman Filter,
Cambridge University Press.

Harvey, A.C. (1993.), Time Series Models, MIT Press.

Harvey, A.C. (2013), Dynamic Models for Volatility and Heavy Tails, Cambridge University
Press.

Hastie, T., Tibshirani, R. and Friedman, J. (2001), The Elements of Statistical Learning:
Data Mining, Inference and Prediction, Springer-Verlag.

Herbst, E. and Schorfheide, F. (2015), Bayesian Estimation of DSGE Models, Manuscript.

Kim, C.-J. and Nelson, C.R. (1999), State-Space Models with Regime Switching, MIT Press.

Koop, G. (2004), Bayesian Econometrics, John Wiley.

Nerlove, M., Grether, D.M., Carvalho, J.L. (1979), Analysis of Economic Time Series: A
Synthesis, Academic Press.

Priestley, M. (1981), Spectral analysis and Time Series, Academic Press.

Silverman, B.W. (1986), Density Estimation for Statistics and Data Analysis, Chapman and
Hall.
USEFUL BOOKS 195

Whittle, P. (1963), Prediction and Regulation by Linear Least Squares Methods, University
of Minnesota Press.

Zellner, A. (1971), An Introduction to Bayesian Inference in Econometrics, John Wiley and


Sons.
Bibliography

Aldrich, E.M., F. Fernndez-Villaverde, A.R. Gallant, and J.F. Rubio-Ramrez (2011), Tap-
ping the Supercomputer Under Your Desk: Solving Dynamic Equilibrium Models with
Graphics Processors, Journal of Economic Dynamics and Control , 35, 386393.

Aruoba, S.B., F.X. Diebold, J. Nalewaik, F. Schorfheide, and D. Song (2013), Improving
GDP Measurement: A Measurement Error Perspective, Working Paper, University of
Maryland, Federal Reserve Board, and University of Pennsylvania.

Nerlove, M., D.M. Grether, and J.L. Carvalho (1979), Analysis of Economic Time Series:
A Synthesis. New York: Academic Press. Second Edition.

Ruge-Murcia, Francisco J. (2010), Estimating Nonlinear DSGE Models by the Simulated


Method of Moments, Manuscript, University of Montreal.

Yu, Yaming and Xiao-Li Meng (2010), To Center or Not to Center: That is Not the Question
An Ancillarity-Sufficiency Interweaving Strategy (ASIS) for Boosting MCMC Efficiency,
Manuscript, Harvard University.

You might also like