Econometric S
Econometric S
Econometric S
Francis X. Diebold
University of Pennsylvania
Edition 2016
Version Thursday 17th March, 2016
Econometrics
Econometrics
Streamlined, Applied and e-Aware
Francis X. Diebold
c 2013-2016
Copyright
by Francis X. Diebold.
This work is freely available for your use, but be warned: it is preliminary, incomplete, and 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, go to 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), Econometrics, Department of Economics, University of Pennsylvania, http://www.ssc.upenn.edu/~fdiebold/Textbooks.html.
To my undergraduates,
who continually surprise and inspire me
xix
xxi
Guide to e-Features
xxiii
Preface
xxxi
Beginnings
1 Introduction to Econometrics
13
II
29
Cross Sections
31
4 Non-Normal Disturbances
67
ix
95
113
III
Time Series
121
137
155
201
221
IV
263
More
265
15 Panel Data
275
279
283
Appendices
285
297
303
xix
xxi
Guide to e-Features
xxiii
Preface
xxxi
Beginnings
1 Introduction to Econometrics
1.1 Welcome . . . . . . . . . . . . . . . . . . .
1.1.1 Who Uses Econometrics? . . . . . .
1.1.2 What Distinguishes Econometrics?
1.2 Types of Recorded Economic Data . . . .
1.3 Online Information and Data . . . . . . .
1.4 Software . . . . . . . . . . . . . . . . . . .
1.5 Tips on How to use this book . . . . . . .
1.6 Exercises, Problems and Complements . .
1.7 Notes . . . . . . . . . . . . . . . . . . . .
2 Graphics and Graphical Style
2.1 Simple Techniques of Graphical Analysis
2.1.1 Univariate Graphics . . . . . . .
2.1.2 Multivariate Graphics . . . . . .
2.1.3 Summary and Extension . . . . .
2.2 Elements of Graphical Style . . . . . . .
2.3 U.S. Hourly Wages . . . . . . . . . . . .
xi
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3
3
3
5
5
6
7
9
10
11
.
.
.
.
.
.
13
13
14
14
17
19
21
xii
2.4
2.5
2.6
2.7
II
Concluding Remarks . . . . . . . . . .
Exercises, Problems and Complements
Notes . . . . . . . . . . . . . . . . . . .
Graphics Legend: Edward Tufte . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Cross Sections
21
22
26
27
29
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
Ideal
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
31
31
33
33
36
37
38
38
39
39
40
41
42
45
45
46
46
47
47
47
49
49
50
50
51
51
52
53
3.5
3.6
3.7
3.8
xiii
.
.
.
.
.
.
.
.
.
.
4 Non-Normal Disturbances
4.0.1 Results . . . . . . . . . . . . . . . . . . .
4.1 Assessing Normality . . . . . . . . . . . . . . .
4.1.1 QQ Plots . . . . . . . . . . . . . . . . .
4.1.2 Residual Sample Skewness and Kurtosis
4.1.3 The Jarque-Bera Test . . . . . . . . . .
4.2 Outliers . . . . . . . . . . . . . . . . . . . . . .
4.2.1 Outlier Detection . . . . . . . . . . . . .
Graphics . . . . . . . . . . . . . . . . . .
Leave-One-Out and Leverage . . . . . .
4.3 Robust Estimation . . . . . . . . . . . . . . . .
4.3.1 Robustness Iteration . . . . . . . . . . .
4.3.2 Least Absolute Deviations . . . . . . . .
4.4 Wage Determination . . . . . . . . . . . . . . .
4.4.1 W AGE . . . . . . . . . . . . . . . . . .
4.4.2 LW AGE . . . . . . . . . . . . . . . . .
4.5 Exercises, Problems and Complements . . . . .
4.6 Notes . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
54
55
57
65
66
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
67
67
68
69
69
69
70
71
71
71
71
72
73
74
74
74
75
76
77
77
78
79
80
80
81
81
82
82
xiv
.
.
.
.
83
83
84
84
87
87
89
91
93
94
95
96
96
98
99
99
100
102
102
102
103
103
5.6
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
105
107
112
III
xv
Time Series
121
123
123
125
126
128
128
130
135
137
137
139
140
141
142
142
143
143
143
144
145
145
145
146
148
153
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
155
155
156
161
166
166
167
xvi
170
171
171
173
173
179
181
183
185
201
203
203
206
207
209
209
221
222
227
234
235
236
236
237
238
238
240
255
261
211
215
218
220
IV
xvii
More
263
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
265
265
265
267
267
268
269
269
270
271
274
.
.
.
.
.
.
275
275
276
276
277
277
277
xviii
16.3
16.4
16.5
16.6
16.7
Time . . . . . . . . . . . . . . . .
Additional Useful Strategies . . . . . . .
16.3.1 Regression Discontinuity Designs
16.3.2 Differences of Differences . . . . .
16.3.3 Matching . . . . . . . . . . . . .
Graphical Models . . . . . . . . . . . . .
Internal and External Validity . . . . . .
Exercises, Problems and Complements .
Notes . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Appendices
281
281
281
281
281
281
281
282
282
283
285
285
285
288
289
289
291
297
303
292
292
293
294
296
The colorful painting is Enigma, by Glen Josselsohn, from Wikimedia Commons. As noted there:
Glen Josselsohn was born in Johannesburg in 1971. His art has
been exhibited in several art galleries around the country, with a
number of sell-out exhibitions on the South African art scene ...
Glens fascination with abstract art comes from the likes of Picasso,
Pollock, Miro, and local African art.
I used the painting mostly just because I like it. But econometrics is indeed
something of an enigma, part economics and part statistics, part science and
part art, hunting faint and fleeting signals buried in massive noise. Yet,
perhaps somewhat miraculously, it often succeeds.
xxi
Guide to e-Features
xxiii
xxiv
Guide
List of Figures
1.1
1.2
1.3
1.4
.
.
.
.
7
8
9
10
2.1
2.2
2.3
15
16
2.4
2.5
2.6
3.1
3.2
3.3
3.4
3.5
3.6
3.7
6.1
6.2
6.3
6.4
6.5
Page
. . .
. . .
. . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. . .
. . .
Re. . .
. . .
. . .
. . .
. . .
17
18
21
27
32
34
35
42
52
54
66
88
90
90
91
94
xxvi
7.1
7.2
7.3
LIST OF FIGURES
106
7.5
9.1
9.2
9.3
9.4
9.5
9.6
9.7
9.8
.
.
.
.
.
.
.
.
124
129
130
131
132
133
134
135
138
140
147
148
12.1
12.2
12.3
12.4
***.
***.
***.
***.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
212
213
213
215
13.1
13.2
13.3
13.4
13.5
13.6
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
243
243
244
245
245
253
7.4
.
.
.
.
.
.
.
.
10.1
10.2
10.3
10.4
10.5
***.
***.
***.
***.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
104
105
107
112
149
150
LIST OF FIGURES
xxvii
254
254
255
257
xxviii
LIST OF FIGURES
List of Tables
2.1
Yield Statistics . . . . . . . . . . . . . . . . . . . . . . . . . .
xxix
25
xxx
LIST OF TABLES
Preface
Most good texts arise from the desire to leave ones stamp on a discipline
by training future generations of students, driven by the recognition that
existing texts are deficient in various respects. My motivation is no different,
but it is more intense: In recent years I have come to see most existing texts
as highly deficient, in four ways.
First, many existing texts attempt exhaustive coverage, resulting in large
tomes impossible to cover in a single course (or even two, or three). Econometrics, in contrast, does not attempt exhaustive coverage. Indeed the coverage
is intentionally selective and streamlined, focusing on the core methods with
the widest applicability. Put differently, Econometrics is not designed to impress people with the breadth of my knowledge; rather, its designed to teach
real students, and it can be realistically covered in a one-semester course.
Core material appears in the main text, and additional material appears in
the end-of-chapter Exercises, Problems and Complements.
Second, many existing texts emphasize theory at the expense of serious
applications. Econometrics, in contrast, is applications-oriented throughout,
using detailed real-world applications not simply to illustrate theory, but to
teach it (in truly realistic situations in which not everything works perfectly!).
Econometrics uses modern software throughout, but the discussion is not
wed to any particular software students and instructors can use whatever
computing environment they like best.
xxxi
xxxii
PREFACE
PREFACE
xxxiii
Econometrics
xxxvi
PREFACE
Part I
Beginnings
Chapter 1
Introduction to Econometrics
1.1
1.1.1
Welcome
Who Uses Econometrics?
and so on.
Sales modeling is a good example. Firms routinely use econometric models
of sales to help guide management decisions in inventory management, sales
force management, production planning, new market entry, and so on.
More generally, firms use econometric models to help decide what to produce (What product or mix of products should be produced?), when to produce (Should we build up inventories now in anticipation of high future demand? How many shifts should be run?), how much to produce and how much
capacity to build (What are the trends in market size and market share? Are
there cyclical or seasonal effects? How quickly and with what pattern will
a newly-built plant or a newly-installed technology depreciate?), and where
to produce (Should we have one plant or many? If many, where should we
locate them?). Firms also use forecasts of future prices and availability of
inputs to guide production decisions.
Econometric models are also crucial in financial services, including asset
management, asset pricing, mergers and acquisitions, investment banking,
and insurance. Portfolio managers, for example, have been interested in
empirical modeling and understanding of asset returns such as stock returns,
interest rates, exchange rates, and commodity prices.
Econometrics is similarly central to financial risk management. In recent
decades, econoemtric methods for volatility modeling have been developed
and widely applied to evaluate and insure risks associated with asset portfolios, and to price assets such as options and other derivatives.
Finally, econometrics is central to the work of a wide variety of consulting
firms, many of which support the business functions already mentioned. Litigation support is also a very active area, in which econometric models are
routinely used for damage assessment (e.g., lost earnings), but for analyses,
and so on.
Indeed these examples are just the tip of the iceberg. Surely you can think
Econometrics is much more than just statistics using economic data, although it is of course very closely related to statistics.
Econometrics must confront the fact that economic data is not generated
from well-designed experiments. On the contrary, econometricians must
generally take whatever so-called observational data theyre given.
Econometrics must confront the special issues and features that arise
routinely in economic data, such as trends, seasonality and cycles.
Econometricians are sometimes interested in non-causal predictive modeling, which requires understanding only correlations (or, more precisely,
conditional expectations), and sometimes interested in evaluating treatment effects, which involve deeper issues of causation.
With so many applications and issues in econometrics, you might fear
that a huge variety of econometric techniques exists, and that youll have to
master all of them. Fortunately, thats not the case. Instead, a relatively
small number of tools form the common core of much econometric modeling.
We will focus on those underlying core principles.
1.2
Another issue is whether the data are recorded over time, over space, or
some combination of the two. Time series data are recorded over time, as
for example with U.S. GDP, which is measured once per quarter. A GDP
dataset might contain data for, say, 1960.I to the present. Cross sectional
data, in contrast, are recorded over space (at a point in time), as with yesterdays closing stock price for each of the U.S. S&P 500 firms. The data
structures can be blended, as for example with a time series of cross sections. If, moreover, the cross-sectional units are identical over time, we speak
of panel data, or longitudinal data. An example would be the daily closing stock price for each of the U.S. S&P 500 firms, recorded over each of the
last 30 days.
1.3
Much useful information is available on the web. The best way to learn about
whats out there is to spend a few hours searching the web for whatever interests you. 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. (See Figure 1.1.) It contains
hundreds of links to data sources, journals, professional organizations, 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 Philadelphia has real-time vintage macroeconomic data. Finally, check out Quandl, which provides access to millions of
data series on the web.
1.4. SOFTWARE
1.4
Software
Econometric software tools are widely available. One of the best high-level
environments is Eviews, a modern object-oriented environment with extensive time series, modeling and forecasting capabilities. (See Figure 1.2.) It
implements almost all of the methods described in this book, and many more.
Eviews reflects a balance of generality and specialization that makes it ideal
for the sorts of tasks that will concern us, and most of the examples in this
book are done using it. If you feel more comfortable with another package,
however, thats fine none of our discussion is wed to Eviews in any way,
and most of our techniques can be implemented in a variety of packages.
Eviews has particular strength in time series environments. Stata is
1.5
10
1.6
1.7.
NOTES
11
1.7
Notes
12
R is available for free as part of a massive and highly-successful opensource 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. Finally, Quandl has a nice R interface.
Chapter 2
Graphics and Graphical Style
Its almost always a good idea to begin an econometric analysis with graphical
data analysis. When compared to the modern array of econometric methods,
graphical analysis might seem trivially simple, perhaps even so simple as to
be incapable of delivering serious insights. Such is not the case: in many
respects the human eye is a far more sophisticated tool for data analysis
and modeling than even the most sophisticated statistical techniques. Put
differently, graphics is a sophisticated technique. Thats certainly not to
say that graphical analysis alone will get the job done certainly, graphical
analysis has its limitations of its own but its usually the best place to
start. With that in mind, we introduce in this chapter some simple graphical
techniques, and we consider some basic elements of graphical style.
2.1
We will segment our discussion into two parts: univariate (one variable) and
multivariate (more than one variable). Because graphical analysis lets the
data speak for themselves, it is most useful when the dimensionality of
the data is low; that is, when dealing with univariate or low-dimensional
multivariate data.
13
14
2.1.1
Univariate Graphics
First consider time series data. Graphics is used to reveal patterns in time
series data. The great workhorse of univariate time series graphics is the
simple time series plot, in which the series of interest is graphed against
time.
In the top panel of Figure 2.1, for example, we present a time series plot
of a 1-year Government bond yield over approximately 500 months. A number of important features of the series are apparent. Among other things,
its movements appear sluggish and persistent, it appears to trend gently upward until roughly the middle of the sample, and it appears to trend gently
downward thereafter.
The bottom panel of Figure 2.1 provides a different perspective; we plot
the change in the 1-year bond yield, which highlights volatility fluctuations.
Interest rate volatility is very high in mid-sample.
Univariate graphical techniques are also routinely used to assess distributional shape, whether in time series or cross sections. A histogram, for
example, provides a simple estimate of the probability density of a random
variable. The observed range of variation of the series is split into a number
of segments of equal length, and the height of the bar placed at a segment
is the percentage of observations falling in that segment.1 In Figure 2.2 we
show a histogram for the 1-year bond yield.
2.1.2
Multivariate Graphics
When two or more variables are available, the possibility of relations between the variables becomes important, and we use graphics to uncover the
existence and nature of such relationships. We use relational graphics to
1
In some software packages (e.g., Eviews), the height of the bar placed at a segment is simply the
number, not the percentage, of observations falling in that segment. Strictly speaking, such histograms are
not density estimators, because the area under the curve doesnt add to one, but they are equally useful
for summarizing the shape of the density.
15
16
display relationships and flag anomalous observations. You already understand the idea of a bivariate scatterplot.2 In Figure 2.3, for example, we show
a bivariate scatterplot of the 1-year U.S. Treasury bond rate vs. the 10-year
U.S. Treasury bond rate, 1960.01-2005.03. The scatterplot indicates that the
two move closely together; in particular, they are positively correlated.
Thus far all our discussion of multivariate graphics has been bivariate.
Thats because graphical techniques are best-suited to low-dimensional data.
Much recent research has been devoted to graphical techniques for highdimensional data, but all such high-dimensional graphical analysis is subject
to certain inherent limitations.
One simple and popular scatterplot technique for high-dimensional data
and one thats been around for a long time is the scatterplot matrix, or
multiway scatterplot. The scatterplot matrix is just the set of all possible
bivariate scatterplots, arranged in the upper right or lower left part of a
matrix to facilitate comparisons. If we have data on N variables, there are
2
Note that connecting the dots is generally not useful in scatterplots. This contrasts to time series
plots, for which connecting the dots is fine and is typically done.
17
Figure 2.3: Bivariate Scatterplot, 1-Year and 10-Year Government Bond Yields
N 2 N
2
scatterplot matrix for the 1-year, 10-year, 20-year, and 30-year U.S. Treasury
Bond rates, 1960.01-2005.03. There are a total of six pairwise scatterplots,
and the multiple comparison makes clear that although the interest rates are
closely related in each case, with a regression slope of approximately one, the
relationship is more precise in some cases (e.g., 20- and 30-year rates) than
in others (e.g., 1- and 30-year rates).
2.1.3
Lets summarize and extend what weve learned about the power of graphics:
a. Graphics helps us summarize and reveal patterns in univariate time-series
data. Time-series plots are helpful for learning about many features of
time-series data, including trends, seasonality, cycles, the nature and location of any aberrant observations (outliers), structural breaks, etc.
b. Graphics helps us summarize and reveal patterns in univariate cross-section
data. Histograms are helpful for learning about distributional shape.
18
Figure 2.4: Scatterplot Matrix, 1-, 10-, 20- and 30-Year Government Bond Yields
19
2.2
20
b. Show the data, and only the data, withing the bounds of reason.
c. Revise and edit, again and again (and again). Graphics produced using
software defaults are almost never satisfactory.
We can use a number of devices to show the data. First, avoid distorting
the data or misleading the viewer, in order to reveal true data variation rather
than spurious impressions created by design variation. Thus, for example,
avoid changing scales in midstream, use common scales when performing
multiple comparisons, and so on. The sizes of effects in graphics should match
their size in the data.
Second, minimize, within reason, non-data ink (ink used to depict anything other than data points). Avoid chartjunk (elaborate shadings and
grids that are hard to decode, superfluous decoration including spurious 3-D
perspective, garish colors, etc.)
Third, choose a graphs aspect ratio (the ratio of the graphs height, h,
to its width, w) to maximize pattern revelation. A good aspect ratio often
makes the average absolute slope of line segments connecting the data points
approximately equal 45 degrees. This procedure is called banking to 45
degrees.
Fourth, maximize graphical data density. Good graphs often display lots
of data, indeed so much data that it would be impossible to learn from them
in tabular form.3 Good graphics can present a huge amount of data in a
concise and digestible form, revealing facts and prompting new questions, at
both micro and macro levels.4
Graphs can often be shrunken greatly with no loss, as with sparklines
(tiny graphics, typically time-series plots, meant to flow with text) and the
3
Conversely, for small amounts of data, a good table may be much more appropriate and informative
than a graphic.
4
Note how maximization of graphical data density complements our earlier prescription to maximize the
ratio of data ink to non-data ink, which deals with maximizing the relative amount of data ink. High data
density involves maximizing as well the absolute amount of data ink.
21
2.3
We use CPS hourly wage data; for a detailed description see Appendix B.
wage histogram skewed
wage kernel density estimate with normal superimposed skewed
log wage histogram more symmetric
log wage kernel density estimate with normal superimposed not too ba
d a fit
2.4
Concluding Remarks
Ultimately good graphics proceeds just like good writing, and if good writing
is good thinking, then so too is good graphics good thinking. And good
writing is just good thinking. So the next time you hear someone pronounce
22
ignorantly along the lines of I dont like to write; I like to think, rest
assured, both his writing and his thinking are likely poor. Indeed many of
the classic prose style references contain many insights that can be adapted
to improve graphics (even if Strunk and White would view as worthless filler
my use of indeed earlier in this sentence (non-thought ink?)).
So when doing graphics, just as when writing, think. Then revise and edit,
revise and edit, ...
2.5
23
(g) For each series, calulate 90 and 95 percent confidence intervals for
the population mean growth rate. For each series, which interval is
wider, and why?
(h) Regress consumption on GDP. Discuss.
3. (Simple vs. partial correlation)
The set of pairwise scatterplots that comprises a multiway scatterplot
provides useful information about the joint distribution of the set of variables, but its incomplete information and should be interpreted with
care. A pairwise scatterplot summarizes information regarding the simple correlation between, say, x and y. But x and y may appear highly
related in a pairwise scatterplot even if they are in fact unrelated, if
each depends on a third variable, say z. The crux of the problem is
that theres no way in a pairwise scatterplot to examine the correlation
between x and y controlling for z, which we call partial correlation.
When interpreting a scatterplot matrix, keep in mind that the pairwise
scatterplots provide information only on simple correlation.
4. (Graphics and Big Data)
Another aspect of the power of statistical graphics comes into play in
the analysis of large datasets, so its increasingly more important in our
era of Big Data: Graphics enables us to present a huge amount of
data in a small space, and hence helps to make huge datasets coherent.
We might, for example, have supermarket-scanner data, recorded in fiveminute intervals for a year, on the quantities of goods sold in each of
four food categories dairy, meat, grains, and vegetables. Tabular or
similar analysis of such data is simply out of the question, but graphics
is still straightforward and can reveal important patterns.
5. (Color)
24
25
y (1) y (12)
6
12
24
36
60
120
4.9
5.1
5.3
5.6
5.9
6.5
2.1
2.1
2.1
2.0
1.9
1.8
0.98
0.98
0.97
0.97
0.97
0.97
0.64
0.65
0.65
0.65
0.66
0.68
Notes: We present descriptive statistics for end-of-month yields at various maturities. We show sample
mean, sample standard deviation, and first- and twelfth-order sample autocorrelations. Data are from the
Board of Governors of the Federal Reserve System. The sample period is January 1985 through December
2008.
Other graphical guidelines help us appeal to the viewer. First, use clear
and modest type, avoid mnemonics and abbreviations, and use labels
rather then legends when possible. Second, make graphics self-contained;
a knowledgeable reader should be able to understand your graphics without reading pages of accompanying text. Third, as with our prescriptions
for showing the data, avoid chartjunk.
8. (The Golden Aspect Ratio, Visual Appeal, and Showing the Data)
A time-honored approach to visual graphical appeal is use of an aspect
ratio such that height is to width as width is to the sum of height and
width. This turns out to correspond to height approximately sixty percent of width, the so-called golden ratio. Graphics that conform to
the golden ratio, with height a bit less than two thirds of width, are
visually appealing. Other things the same, its a good idea to keep the
golden ratio in mind when producing graphics. Other things are not
always the same, however. In particular, the golden aspect ratio may
not be the one that maximizes pattern revelation (e.g., by banking to
45 degrees).
26
Whats good?
Whats bad?
sparklines?
Check out www.zevross.com.
2.6
Notes
2.7
27
This chapter has been heavily influenced by Tufte (1983), as are all modern
discussions of statistical graphics.5 Tuftes book is an insightful and entertaining masterpiece on graphical style, and I recommend enthusiastically. Be
sure to check out his web page and other books, which go far beyond his 1983
work.
28
Part II
Cross Sections
29
Chapter 3
Regression Under the Full Ideal
Conditions
You have already been introduced to probability and statistics, but chances
are that you could use a bit of review before plunging into regression, so
begin by studying Appendix A. Be warned, however: it is no substitute
for a full-course introduction to probability and statistics, which you should
have had already. Instead it is intentionally much more narrow, reviewing
some material related to moments of random variables, which we will use
repeatedly. It also introduces notation, and foreshadows certain ideas, that
we develop subsequently in greater detail.
3.1
Preliminary Graphics
In this chapter well be working with cross-sectional data on log wages, education and experience. We already examined the distribution of log wages.
For convenience we reproduce it in Figure 3.1, together with the distributions
of the new data on education and experience.
31
32
3.2
3.2.1
33
Suppose that we have data on two variables, y and x, as in Figure 3.2, and
suppose that we want to find the linear function of x that best fits y, where
best fits means that the sum of squared (vertical) deviations of the data
points from the fitted line is as small as possible. When we run a regression,
or fit a regression line, thats what we do. The estimation strategy is called
least squares, or sometimes ordinary least squares to distinguish it from
fancier versions that well introduce later.
The specific data that we show in Figure 3.2 are log wages (LWAGE, y)
and education (EDUC, x) for a random sample of nearly 1500 people, as
described in Appendix B.
Let us elaborate on the fitting of regression lines, and the reason for the
name least squares. When we run the regression, we use a computer to fit
the line by solving the problem
min
T
X
(yt 1 2 xt )2 ,
t=1
34
35
Figure 3.3: (Log Wage, Education) Scatterplot with Superimposed Regression Line
t = 1, ..., T .
In Figure 3.3, we illustrate graphically the results of regressing LWAGE on
EDUC. The best-fitting line slopes upward, reflecting the positive correlation
between LWAGE and EDUC.1 Note that the data points dont satisfy the
fitted linear relationship exactly; rather, they satisfy it on average. To predict
LWAGE for any given value of EDUC, we use the fitted line to find the value
of LWAGE that corresponds to the given value of EDUC.
1
Note that use of log wage promostes several desiderata. First, it promotes normality, as we discussed
\
in Chapter 2. Second, it enforces positivity of the fitted wage, because W\
AGE = exp(LW
AGE), and
exp(x) > 0 for any x.
36
Everything generalizes to allow for more than one RHS variable. This is
called multiple linear regression.
Suppose, for example, that we have two RHS variables, x2 and x3 . Before
we fit a least-squares line to a two-dimensional data cloud; now we fit a leastsquares plane to a three-dimensional data cloud. We use the computer to
find the values of 1 , 2 , and 3 that solve the problem
min
T
X
t=1
where denotes the set of three model parameters. We denote the set of
with elements 1 , 2 , and 3 . The fitted values
estimated parameters by ,
are
yt = 1 + 2 x2t + 3 x3t ,
and the residuals are
et = yt yt ,
t = 1, ..., T .
37
K
X
i xit ,
k=1
Onward
Before proceeding, two aspects of what weve done so far are worth noting.
First, we now have two ways to analyze data and reveal its patterns. One is
the graphical scatterplot of Figure 3.2, with which we started, which provides
a visual view of the data. The other is the fitted regression line of Figure 3.3,
which summarizes the data through the lens of a linear fit. Each approach
has its merit, and the two are complements, not substitutes, but note that
linear regression generalizes more easily to high dimensions.
Second, least squares as introduced thus far has little to do with statistics
or econometrics. Rather, it is simply a way of instructing a computer to
fit a line to a scatterplot in a way thats rigorous, replicable and arguably
reasonable. We now turn to a probabilistic interpretation.
38
3.3
We work with the full multiple regression model (simple regression is of course
a special case). Collect the RHS variables into the vector x, where x0t =
(1, x1t , x2t , ..., xKt ).
3.3.1
Thus far we have not postulated a probabilistic model that relates yt and xt ;
instead, we simply ran a mechanical regression of yt on xt to find the best
fit to yt formed as a linear function of xt . Its easy, however, to construct
a probabilistic framework that lets us make statistical assessments about
the properties of the fitted line. We assume that yt is linearly related to
an exogenously-determined xt , and we add an independent and identically
distributed zero-mean (iid) Gaussian disturbance:
yt = 1 + 2 x2t + ... + K xKt + t
t iidN (0, 2 ),
t = 1, ..., T . The intercept of the line is 1 , the slope parameters are the
i s, and the variance of the disturbance is 2 .2 Collectively, we call the s
the models parameters. The index t keeps track of time; the data sample
begins at some time weve called 1 and ends at some time weve called T ,
so we write t = 1, ..., T . (Or, in cross sections, we index cross-section units
by i and write i = 1, ..., N .)
Note that in the linear regression model the expected value of yt conditional upon xt taking a particular value, say xt , is
E(yt |xt = xt ) = 1 + 2 x2t + ... + K xKt .
2
39
The discussion thus far was intentionally a bit loose, focusing on motivation
and intuition. Let us now be more precise about what we assume and what
results obtain.
A Bit of Matrix Notation
We put
that in the leftmost column of the X matrix, which is just ones. The other
columns contain the data on the other RHS variables, over the cross section
in the cross-sectional case, i = 1, ..., N , or over time in the time-series case,
t = 1, ..., T . With no loss of generality, suppose that were in a time-series
situation; then notationally X is a T K matrix.
40
can be written very compactly using it. We have written the model as
yt = 1 + 2 x2t + ... + K xKt + t , t = 1, ..., T.
Alternatively, stack yt , t = 1, ..., T into the vector y, where y 0 = (y1 , y2 , ..., yT ),
and stack j , j = 1, ..., K into the vector , where 0 = (1 , 2 , ..., K ), and
stack t , t = 1, ..., T , into the vector , where 0 = (1 , 2 , ..., T ).
Then we can write the complete model over all observations as
y = X + .
(3.1)
(3.2)
1. The DGP is (3.1)-(3.2), and the fitted model matches the DGP exactly.
41
2. Fixed coefficients,
3. N
4. has constant variance 2
5. The s are uncorrelated.
FIC 2 says that re-running the world to generate a new sample y would
entail simply generating new shocks and running them through equation
(3.1):
y = X + .
That is, X would stay fixed across replications. This fixed X condition
looks innocuous, but its not, and we will have much more to say about it.
FIC 3 is more of a technical detail. It effectively says that there is no
redundancy among the variables contained in X (more precisely, no regressor
is a perfect linear combination of the others). Full column rank of X guarantees that X 0 X is non-singular and hence invertible, which is necessary for
calculation of the OLS estimator, (X 0 X)1 X 0 y. The condition is largely technical insofar as X will always be of full column rank unless you do something
really silly, like entering the same regressor twice. However, situations where
X 0 X is almost singular can occur and raise issues, if not cause disasters. We
will discuss such situations later.
The FIC are surely heroic in many contexts, and much of econometrics is
devoted to detecting and dealing with various FIC failures. But before we
worry about FIC failures, its invaluable first to understand what happens
when they hold.
Results
42
and under the FIC it is MVUE and normally distributed with covariance
matrix 2 (X 0 X)1 . We write
LS N , 2 (X 0 X)1 .
We estimate the covariance matrix 2 (X 0 X)1 using s2 (X 0 X)1 , where s2 =
PT 2
t=1 et /(T K).
3.4
A Wage Equation
Now lets do more than a simple graphical analysis of the regression fit.
Instead, lets look in detail at the computer output, which we show in Figure
6.2 for a regression of LW AGE on an intercept, EDU C and EXP ER. We
run regressions dozens of times in this book, and the output format and
interpretation are always the same, so its important to get comfortable with
it quickly. The output is in Eviews format. Other software will produce
more-or-less the same information, which is fundamental and standard.
43
Before proceeding, note well that the FIC may not be satisfied for this
dataset, yet we will proceed assuming that they are satisfied. As we proceed
through this book, we will confront violations of the various assumptions
indeed thats what econometrics is largely about and well return repeatedly
to this dataset and others. But we must begin at the beginning.
The printout begins by reminding us that were running a least-squares
(LS) regression, and that the left-hand-side (LHS) variable is the log wage
(LWAGE), using a total of 1323 observations.
Next comes a table listing each RHS variable together with four statistics.
The RHS variables EDUC and EXPER are education and experience, and the
C variable refers to the earlier-mentioned intercept. The C variable always
equals one, so the estimated coefficient on C is the estimated intercept of the
regression line.3
The four statistics associated with each RHS variable are the estimated
coefficient (Coefficient), its standard error (Std. Error), a t statistic,
and a corresponding probability value (Prob.). The standard errors of
the estimated coefficients indicate their likely sampling variability, and hence
their reliability. The estimated coefficient plus or minus one standard error is
approximately a 68% confidence interval for the true but unknown population
parameter, and the estimated coefficient plus or minus two standard errors
is approximately a 95% confidence interval, assuming that the estimated
coefficient is approximately normally distributed, which will be true if the
regression disturbance is normally distributed or if the sample size is large.
Thus large coefficient standard errors translate into wide confidence intervals.
Each t statistic provides a test of the hypothesis of variable irrelevance:
that the true but unknown population parameter is zero, so that the corresponding variable contributes nothing to the forecasting regression and can
therefore be dropped. One way to test variable irrelevance, with, say, a 5%
3
Sometimes the population coefficient on C is called the constant term, and the regression estimate is
called the estimated constant term.
44
If the sample size is small, or if we want a significance level other than 5%, we must refer to a table of
critical values of the t distribution. We also note that use of the t distribution in small samples also requires
an assumption of normally distributed disturbances.
45
46
3.4.3
T
X
e2t .
t=1
3.4.4
The likelihood function is the joint density function of the data, viewed
as a function of the model parameters. Hence a natural estimation strategy, called maximum likelihood estimation, is to find (and use as estimates) the parameter values that maximize the likelihood function. After all,
by construction, those parameter values maximize the likelihood of obtaining the data that were actually obtained. In the leading case of normallydistributed regression disturbances, maximizing the likelihood function (or
equivalently, the log likelihood function, because the log is a monotonic transformation) turns out to be equivalent to minimizing the sum of squared residuals, hence the maximum-likelihood parameter estimates are identical to the
least-squares parameter estimates. The number reported is the maximized
value of the log of the likelihood function.5 Like the sum of squared residuals, its not of direct use, but its useful for comparing models and testing
hypotheses. We will rarely use the log likelihood function directly; instead,
well focus for the most part on the sum of squared residuals.
5
3.4.5
47
F statistic 199.626
We use the F statistic to test the hypothesis that the coefficients of all variables in the regression except the intercept are jointly zero.6 That is, we
test whether, taken jointly as a set, the variables included in the forecasting
model have any predictive value. This contrasts with the t statistics, which
we use to examine the predictive worth of the variables one at a time.7 If no
variable has predictive value, the F statistic follows an F distribution with
k 1 and T k degrees of freedom. The formula is
F =
(SSRres SSR)/(K 1)
,
SSR/(T K)
where SSRres is the sum of squared residuals from a restricted regression that
contains only an intercept. Thus the test proceeds by examining how much
the SSR increases when all the variables except the constant are dropped. If
it increases by a great deal, theres evidence that at least one of the variables
has predictive content.
3.4.6
The probability value for the F statistic gives the significance level at which
we can just reject the hypothesis that the set of RHS variables has no predictive value. Here, the value is indistinguishable from zero, so we reject the
hypothesis overwhelmingly.
3.4.7
If we knew the elements of and forecasted yt using x0t , then our forecast
errors would be the t s, with variance 2 . Wed like an estimate of 2 ,
6
We dont want to restrict the intercept to be zero, because under the hypothesis that all the other
coefficients are zero, the intercept would equal the mean of y, which in general is not zero. See Problem 6.
7
In the degenerate case of only one RHS variable, the t and F statistics contain exactly the same information, and F = t2 . When there are two or more RHS variables, however, the hypotheses tested differ, and
F 6= t2 .
48
because it tells us whether our forecast errors are likely to be large or small.
The observed residuals, the et s, are effectively estimates of the unobserved
population disturbances, the t s . Thus the sample variance of the es, which
we denote s2 (read s-squared), is a natural estimator of 2 :
PT
s =
2
t=1 et
T K
SER =
s
s2
PT
2
t=1 et
T K
49
R-squared .232
PT
2
t=1 et
R = 1 PT
)2
t=1 (yt y
R =1
1
T
PT
2
t=1 et
PT
)2
t=1 (yt y
which makes clear that the numerator in the large fraction is very close to
s2 , and the denominator is very close to the sample variance of y.
3.4.9
The interpretation is the same as that of R2 , but the formula is a bit different.
Adjusted R2 incorporates adjustments for degrees of freedom used in fitting
the model, in an attempt to offset the inflated appearance of good fit if many
RHS variables are tried and the best model selected. Hence adjusted R2
is a more trustworthy goodness-of-fit measure than R2 . As long as there is
50
more than one RHS variable in the model fitted, adjusted R2 is smaller than
R2 ; here, however, the two are extremely close (23.1% vs. 23.2%). Adjusted
2 ; the formula is
R2 is often denoted R
2 = 1
R
PT 2
1
t=1 et
T K
,
P
T
1
2
(y
)
t
t=1
T 1
where K is the number of RHS variables, including the constant term. Here
the numerator in the large fraction is precisely s2 , and the denominator is
precisely the sample variance of y.
3.4.10
3.4.11
PT
2
t=1 et
PT
2
t=1 et
.
T
The AIC and SIC are tremendously important for guiding model selection
in a ways that avoid data mining and in-sample overfitting.
3.4.12
51
2
t=2 (et et1 )
.
PT 2
e
t=1 t
Although the Durbin-Watson test is designed to be very good at detecting serial correlation of the AR(1)
type. Many other types of serial correlation are possible; well discuss them extensively in Chapter 11.1.
52
DW takes values in the interval [0, 4], and if all is well, DW should be
around 2. If DW is substantially less than 2, there is evidence of positive
serial correlation. As a rough rule of thumb, if DW is less than 1.5, there
may be cause for alarm, and we should consult the tables of the DW statistic,
available in many statistics and econometrics texts.
3.4.14
3.4.15
53
In time-series settings, its always a good idea to assess visually the adequacy of the model via time series plots of the actual data (yt s), the fitted
values (
yt s), and the residuals (et s). Often well refer to such plots, shown
together in a single graph, as a residual plot.9 Well make use of residual
plots throughout this book. Note that even with many RHS variables in
the regression model, both the actual and fitted values of y, and hence the
residuals, are simple univariate series that can be plotted easily.
The reason we examine the residual plot is that patterns would indicate
violation of our iid assumption. In time series situations, we are particularly
interested in inspecting the residual plot for evidence of serial correlation
in the et s, which would indicate failure of the assumption of iid regression
disturbances. More generally, residual plots can also help assess the overall
performance of a model by flagging anomalous residuals, due for example to
outliers, neglected variables, or structural breaks.
Our wage regression is cross-sectional, so there is no natural ordering of
the observations, and the residual plot is of limited value. But we can still
use it, for example, to check for outliers.
In Figure 3.6, we show the residual plot for the regression of LWAGE on
EDUC and EXPER. The actual and fitted values appear at the top of the
graph; their scale is on the right. The fitted values track the actual values
fairly well. The residuals appear at the bottom of the graph; their scale is
on the left. Its important to note that the scales differ; the et s are in fact
substantially smaller and less variable than either the yt s or the yt s. We
draw the zero line through the residuals for visual comparison. No outliers
are apparent.
9
Sometimes, however, well use residual plot to refer to a plot of the residuals alone. The intended
meaning should be clear from context.
54
3.4.16
You will want to start using AIC and SIC immediately, so we provide a
bit more information here. Model selection by maximizing R2 , or equivalently minimizing residual SSR, is ill-advised, because they dont penalize
for degrees of freedom and therefore tend to prefer models that are too big.
2 , or equivalently minimizing residual s2 ,
Model selection by maximizing R
2 and s2 penalize somewhat for degrees of
is still ill-advised, even though R
freedom, because they dont penalize harshly enough and therefore still tend
to prefer models that are too big. In contrast, AIC and SIC get things just
right. SIC has a wonderful asymptotic optimality property when the set of
candidate models is viewed as fixed: Basically SIC gets it right asymptotically, selecting either the DGP (if the DGP is among the models considered)
or the best predictive approximation to the DGP (if the DGP is not among
the models considered). AIC has a different and also-wonderful asymptotic
55
3.5
Quantile Regression
T
X
t=1
Simple
(analytic closed-form expression, (X 0 X)1 X 0 y)
Wonderful properties under the FIC
(Unbiased, consistent, Gaussian, MVUE)
But other approaches are possible and sometimes useful.
T
X
t=1
2t
56
T
X
linlin(t ),
t=1
where:
linlin(e) =
a|e|, if e 0
b|e|, if e > 0
b
1
=
a + b 1 + a/b
57
3.6
58
59
60
7. (Dimensionality)
We have emphasized, particularly in Chapter 2, that graphics is a powerful tool with a variety of uses in the construction and evaluation of
econometric models. We hasten to add, however, that graphics has its
limitations. In particular, graphics loses much of its power as the dimension of the data grows. If we have data in ten dimensions, and we try to
squash it into two or three dimensions to make graphs, theres bound to
be some information loss.
Thus, in contrast to the analysis of data in two or three dimensions,
in which case learning about data by fitting models involves a loss of
information whereas graphical analysis does not, graphical methods lose
their comparative advantage in higher dimensions. In higher dimensions, graphical analysis can become comparatively laborious and less
insightful.
8. (Wage regressions)
The relationship among wages and their determinants is one of the most
important in all of economics. In the text we have examined, and will
continue to examine, the relationship for 1995 using a CPS subsample.
Here you will thoroughly analyze the relationship for 2004 and 2012,
compare your results to those for 1995, and think hard about the meaning and legitimacy of your results.
(a) Obtain the relevant 1995, 2004 and 2012 CPS subsamples.
(b) Discuss any differences in the datasets. Are the same people in each
dataset?
(c) For now, assume the validity of the ideal conditions. Using each
dataset, run the OLS regression W AGE c, EDU C, EXP ER.
(Note that the LHS variable is W AGE, not LW AGE.) Discuss and
compare the results in detail.
61
2
t=1 et
ln(AIC) = ln
T
PT
ln(SIC) = ln
2
t=1 et
+
!
+
2K
T
K ln(T )
.
T
The practice is so common that log(AIC) and log(SIC) are often simply called the AIC and SIC. AIC and SIC must be greater than
zero, so log(AIC) and log(SIC) are always well-defined and can take on
any real value. The important insight, however, is that although these
variations will of course change the numerical values of AIC and SIC
produced by your computer, they will not change the rankings of models under the various criteria. Consider, for example, selecting among
three models. If AIC1 < AIC2 < AIC3 , then it must be true as well
62
that ln(AIC1 ) < ln(AIC2 ) < ln(AIC3 ) , so we would select model 1 regardless of the definition of the information criterion used.
11. (Parallels between the sampling distribution of the sample mean under simple random sampling, and the sampling distribution of the OLS
estimator under the FIC)
Consider first the sample mean under Gaussian simple random sampling.
(a) What is a Gaussian simple random sample?
(b) What is the sample mean, and what finite-sample properties does
it have under Gaussian simple random sampling?
(c) Display and discuss the exact distribution of the sample mean.
(d) How would you estimate and plot the exact distribution of the sample mean?
Now consider the OLS regression estimator under the FIC.
(a) What are the FIC?
(b) What is the OLS estimator, and what finite-sample properties does
it enjoy?
(c) Display and discuss the exact distribution of the OLS estimator.
Under what conditions, if any, do your sample mean answers and
OLS answers precisely coincide?
12. (The sum of squared residuals, SSR)
(a) What is SSR and why is it reported?
(b) Do you agree with bigger is better, smaller is better, or neither?
Be careful.
63
2,
(c) Describe in detail and discuss the use of regression statistics R2 , R
F , SER, and SIC. What role does SSR play in each of the test
statistics?
(d) Under the FIC, is the maximized log likelihood related to the SSR?
If so, how? Would your answer change if we dropped normality?
13. (OLS regression residuals sum to zero)
Assertion: As long as an intercept is included in a linear regression, the
OLS residuals must sum to precisely zero. The intuition is simply that
non-zero residual mean (residual constant term) would automatically
be pulled into the residual constant term, hence guaranteeing a zero
residual mean.
(a) Prove the assertion precisely.
(b) Evaluate the claim that the assertion implies the regression fits perfectly on average, despite the fact that it fits imperfectly pointby-point.
14. (Maximum-likelihood estimation and likelihood-ratio tests)
A natural estimation strategy with wonderful asymptotic properties,
called maximum likelihood estimation, is to find (and use as estimates) the parameter values that maximize the likelihood function.
After all, by construction, those parameter values maximize the likelihood of obtaining the data that were actually obtained.
In the leading case of normally-distributed regression disturbances, maximizing the likelihood function turns out to be equivalent to minimizing
the sum of squared residuals, hence the maximum-likelihood parameter
estimates are identical to the least-squares parameter estimates.
To see why maximizing the Gaussian log likelihood gives the same parameter estimate as minimizing the sum of squared residuals, let us
64
derive the likelihood for the Gaussian linear regression model with nonstochastic regressors,
yt = x0t +
t iidN (0, 2 ).
The model implies that
yt iidN (x0t , 2 ),
so that
1
f (yt ) = (2 2 ) 2 e 22 (yt xt ) .
Hence f (y1 , ..., yT ) = f (y1 )f (y2 ) f (yT ) (by independence of the yt s).
In particular,
L=
T
Y
(2 2 ) 2 e 22 (yt xt )
t=1
so
ln L = (2 )
T
2
1 X
(yt x0t )2 .
2
2 t=1
Note in particular that the vector that maximizes the likelihood (or
log likelihood the optimizers must be identical because the log is a
positive monotonic transformation) is the vector that minimizes the
sum of squared residuals.
The log likelihood is also useful for hypothesis testing via likelihoodratio tests. Under very general conditions we have asymptotically that:
2(ln L0 ln L1 ) 2d ,
where ln L0 is the maximized log likelihood under the restrictions implied
by the null hypothesis, ln L1 is the unrestricted log likelihood, and d is
the number of restrictions imposed under the null hypothesis.
3.7. NOTES
65
3.7
Notes
Dozens of software packages implement linear regression analysis. Most automatically include an intercept in linear regressions unless explicitly instructed
otherwise. That is, they automatically create and include a C variable.
The R command for ordinary least squares regression is lm. Its already
pre-loaded into R as the default package for estimating linear models. It
uses standard R format for such models, where you specify formula, data,
and various estimation options. It returns a model estimated by OLS including coefficients, residuals, and fitted values. You can also easily calculate
summary statistics using the summary function.
The standard R quantile regression package is quantreg, written by Roger
Koenker, the inventor of quantile regression. The command rq functions
similarly to lm. It takes as input a formula, data, the quantile to be
estimated, and various estimation options.
66
3.8
Chapter 4
Non-Normal Disturbances
Here we consider a violation of the full ideal conditions, non-normal disturbances.
Non-normality and outliers, which we introduce in this chapter, are
closely related, because deviations from Gaussian behavior are often characterized by fatter tails than the Gaussian, which produce outliers. It is important to note that outliers are not necessarily bad, or requiring treatment.
Every data set must have some most extreme observation, by definition! Statistical estimation efficiency, moreover, increases with data variability. The
most extreme observations can be the most informative about the phenomena of interest. Bad outliers, in contrast, are those associated with things
like data recording errors (e.g., you enter .753 when you mean to enter 75.3)
or one-off events (e.g., a strike or natural disaster).
4.0.1
Results
67
68
we have that the sample mean is best linear unbiased (BLUE), with
a
2
y N ,
.
T
This result forms the basis for asymptotic inference. It is a Gaussian central
limit theorem. We consistently estimate the large-sample variance of the
sample mean using s2 /T .
Now consider the full linear regression model without normal disturbances.
We have that the linear regression estimator is BLUE, with
a
OLS N , 2 (X 0 X)1 .
4.1
Assessing Normality
3.
Indeed they must, as the sample mean corresponds to regression on an intercept. See EPC 6 of Chapter
4.1.1
69
QQ Plots
We introduced histograms earlier in Chapter 2 as a graphical device for learning about distributional shape. If, however, interest centers on the tails of
distributions, QQ plots often provide sharper insight as to the agreement or
divergence between the actual and reference distributions.
The QQ plot is simply a plot of the quantiles of the standardized data
against the quantiles of a standardized reference distribution (e.g., normal). If
the distributions match, the QQ plot is the 45 degree line. To the extent that
the QQ plot does not match the 45 degree line, the nature of the divergence
can be very informative, as for example in indicating fat tails.
4.1.2
E(y )3
3
E(y )4
K=
.
4
Obviously, each tells about a different aspect of non-normality. Kurtosis, in
particular, tells about fatness of distributional tails relative to the normal.
A simple strategy is to check various implications of residual normality,
T
JB =
6
1
3)2 .
S2 + (K
4
70
4.2
Outliers
We have discussed the case of an observed time series. If the series being tested for normality is the
residual from a model, then T can be replaced with T K, where K is the number of parameters estimated,
although the distinction is inconsequential asymptotically.
4.2.1
71
Outlier Detection
Graphics
t = 1, ..., T .
It can be shown, however, that the change in OLS is
(t)
OLS OLS =
1
(X 0 X)1 x0t et ,
1 ht
where ht is the t-th diagonal element of the hat matrix, X(X 0 X)1 X 0 .
(t)
Hence the estimated coefficient change
OLS is driven by 1 . ht is
OLS
1ht
called the time-t leverage. ht can be shown to be in [0, 1], so that the larger
(t)
is ht , the larger is
OLS . Hence one really just needs to examine the
OLS
4.3
Robust Estimation
Robust estimation provides a useful middle ground between completely discarding allegedly-outlying observations (dummying them out) and doing
nothing. Here we introduce outlier-robust approaches to regression. The
first involves OLS regression, but on weighted data, an the second involves
72
Robustness Iteration
" T
X
#
(yt x0t )2 .
t=1
t = S
(0)
et
(0)
6 med|et |
where
(0)
(0)
et = yt yt ,
and S(z) is a function such that S(z) = 1 for z [1, 1] but downweights
outside that interval.
Fit at robustness iteration 1:
y(1) = X (1)
where
"
(1) = argmin
T
X
t=1
Continue as desired.
#
(1)
t (yt xt 0 )
4.3.2
73
T
X
t=1
T
X
t=1
or
min
T
X
|t |
t=1
74
4.4
4.4.1
Wage Determination
W AGE
LW AGE
75
LAD estimation
4.5
76
4.6
Notes
Chapter 5
Stochastic Regressors I: Measurement
Error, Omitted Variables, and
Multicollinearity
5.1
We will study such environments later in Chapter 12. For now we continue to work in cross sections.
77
5.2
Omitted Variables
Actually we can significantly weaken even the requirement that X and are independent; see EPC 2.
79
5.3
5.3.1
R() R( ) p 0.
Hence in large samples provides a good way to predict y for any hypo OLS is effectively always P-consistent; we require
thetical x: simply use x0 .
almost no conditions of any kind!
5.3.3
81
To take a simple example, suppose that y and x are in fact causally unrelated,
so that the true treatment effect of x on y is 0 by construction. But suppose
that x is also highly correlated with an unobserved variable z that does cause
y. Then y and x will be correlated due to their joint dependence on z, and
that correlation can be used to predict y given x, despite the fact that, by
construction, x treatments (interventions) will have no effect on y.
Consider a thought experiment. Let the DGP be yi = zi + i , and suppose
also that there exists a variable x such that corr(x, z) > 0. Consider running
the regression y x. OLS P-consistent, as always. But its not OLS
T-consistent, because the omitted variable zi is in i , so that the regressor
and disturbance in the fitted regression are correlated. The fitted regression
coefficient on x will be non-zero and may be very large, even asymptotically,
despite that fact that the true causal impact of x on y is zero, by construction.
5.4
Measurement Error
5.5
Multicollinearity
Collinearity refers to two x variables that are highly correlated. But all pairwise correlations could be small and yet an x variable is highly correlated
5.5. MULTICOLLINEARITY
83
with a linear combination of other x variables. That raises the idea of multicollinearity, where an x variable is highly correlated with a linear combination
of other x variables. Hence collinearity is a special case of multicollinearity,
and from now on we will simply speak of multicollinearity.
There are two types of multicollinearity, perfect and imperfect.
5.5.1
Perfect Multicollinearity
Imperfect Multicollinearity
Imperfect multicollinearity, in contrast occurs routinely but is not necessarily problematic, although in extreme cases it may require some attention. Imperfect collinearity/multicollinearity refers to (imperfect) correlation among some regressors, or linear combinations of regressors. Imperfect
multicollinearity is not a problem in the sense that something was done
incorrectly, and it is not a violation of the FIC. Rather, it just reflects the
nature of economic and financial data. But we still need to be aware of it
and understand its effects.
Telltale symptoms are large F and R2 , yet small ts (large s.e.s), and/or
coefficients that are sensitive to small changes in sample period. That is,
3
A classic and more sophisticated example involves the dummy variable trap, in which we include as
regressors a full set of dummy variables and an intercept. We will define dummy variables and note the
dummy variable trap in Chapters 6 and 9.
OLS has trouble parsing individual influences, yet its clear that there is an
overall relationship.
OLS is in some sense just what the doctor ordered orthogonal projection.
5.5.3
A Bit More
var(k ) = f |{z}
2 , x2k , Rk2
|{z} |{z}
+
1
,
1 Rk2
5.6
1. Regularity conditions on X.
We have repeatedly mentioned (in section 5.1, for example) regularity
conditions on X, without saying more, required for various of the results claimed. In cross sections, sufficient regularity would obtain for
X iid. In time series, sufficient regularity would obtain for X covariance stationary. We will define and discuss covariance stationarity in
Chapter 11. It corresponds to a certain kind of stability over time.
2. Dropping the assumption that X and are independent.
85
Actually we can go even farther than we did in section 5.1, and relax
normality and fixed-X simultaneously, under even weaker conditions not
requiring full independence of X and , and our usual estimators still
have their usual asymptotic properties. We just need that be conditional mean and variance independent of X. More precisely, in the
iid X (cross-section) case we need E(t |xt ) = 0 and var(t |xt ) = 2 ,
and in the dynamic (time-series) case we need E(t |xt , xt1 , ...) = 0 and
var(t |xt , xt1 , ...) = 2 .
3. Measurement error correlated with X.
In section 5.4, we considered measurement error v that was independent of , and we argued that such measurement error biases the OLS
estimator toward 0. What happens if v and are correlated ?
4. Omitted variable bias.
How might you assess whether a regression suffers from omitted variable
bias?
5. Included Irrelevant Variables
Another violation of the full ideal conditions is inclusion of irrelevant
variables. Fortunately the effects are minor; some degrees of freedom
are wasted, but otherwise theres no problem.
How would you assess whether a variable included in a regression is
irrelevant? A set of variables?
Chapter 6
Indicator Variables in Cross Sections:
Group Heterogeneity
From one perspective we contimue working under the FIC. From another
we now begin relaxing the FIC, effectively by recognizing RHS variables that
were omitted from, but should not have been omitted from, our original wage
regression.
6.1
87
we have examined them before and there is nothing new to say. The new variables are 0-1 dummies, UNION (already defined) and NONWHITE, where
(
1, if observation t corresponds to a non white person
N ON W HIT Et =
0, otherwise.
Note that the sample mean of a dummy variable is the fraction of the
sample with the indicated attribute. The histograms indicate that roughly
one-fifth of people in our sample are union members, and roughly one-fifth
are non-white.
We also have a third dummy, FEMALE, where
(
1, if observation t corresponds to a female
F EM ALEt =
0, otherwise.
We dont show its histogram because its obvious that FEMALE should be
approximately 0 w.p. 1/2 and 1 w.p. 1/2, which it is.
89
6.2
Well examine such issues in detail later when we study multicollinearity in Chapter ??.
91
Figure 6.4: Residual Scatter from Wage Regression on Education, Experience and Group
Dummies
forty-five degree line (the regression R2 is higher but still only .31), but its
getting closer.
6.3
1. (Slope dummies)
Consider the regression
yt = 1 + 2 xt + t .
The dummy variable model as introduced in the text generalizes the
intercept term such that it can change across groups. Instead of writing
the intercept as 1 , we write it as 1 + Dt .
We can also allow slope coefficients to vary with groups. Instead of
writing the slope as 2 , we write it as 2 + Dt . Hence to capture slope
variation across groups we regress not only on an intercept and x, but
also on D x.
Allowing for both intercept and slope variation across groups corresponds
to regressing on an intercept, D, x, and D x.
2. (Dummies vs. separate regression)
Consider the simple regression, yt c, xt .
(a) How is inclusion of a group G intercept dummy related to the idea
of running separate regressions, one for G and one for non-G? Are
the two strategies equivalent? Why or why not?
(b) How is inclusion of group G intercept and slope dummies related
to the idea of running separate regressions, one for G and one for
non-G? Are the two strategies equivalent? Why or why not?
3. (Analysis of variance (ANOVA) and dummy variable regression)
[You should have learned about analysis of variance (ANOVA) in
your earlier statistics course. In any event theres good news: If you
understand regression on dummy variables, you understand analysis of
variance (ANOVA), as any ANOVA analysis can be done via regression
on dummies. So here we go.]
You treat each of 1000 randomly-selected farms that presently use no
fertilizer. You either do nothing, or you apply one of four experimental
fertilizers, A, B, C or D. Using a dummy variable regression setup:
(a) How would you test the hypothesis that none of the four new fertilizers is effective?
6.4. NOTES
93
(b) Assuming that you reject the null, how would you estimate the improvement (or worsening) due to using fertilizer A, B, C or D?
6.4
Notes
ANOVA traces to Sir Ronald Fischers 1918 article, The Correlation Between Relatives on the Supposition of Mendelian Inheritance, and it was
featured prominently in his classic 1925 book, Statistical Methods for Research Workers. Fischer is in many ways the father of much of modern
statistics.
6.5
Chapter 7
Non-Linear Functional Form in Cross
Sections
In general there is no reason why the conditional mean function should be linear. That is, the appropriate functional form may not be linear. Whether
linearity provides an adequate approximation is an empirical matter.
non-linearity is related to non-normality, which we studied in chapter 7.
In particular, in the mutivariate normal case, the conditional mean function
is linear in the conditioning variables. But once we leave the terra firma
of multivariate normality, anything goes. The conditional mean function
and disturbances may be linear and Gaussian, non-linear and Gaussian, linear
and non-Gaussian, or non-linear and non-Gaussian.
In the Gaussian case, because the conditional mean is a linear function
of the conditioning variable(s), it coincides with the linear projection. In
non-Gaussian cases, however, linear projections are best viewed as approximations to generally non-linear conditional mean functions. That is, we can
view the linear regression model as a linear approximation to a generally nonlinear conditional mean function. Sometimes the linear approximation may
be adequate, and sometimes not.
95
96
7.1
Logarithms
97
98
7.1.2
Box-Cox
The Box-Cox transformation generalizes log-lin regression. We have
B(yt ) = 1 + 2 xt + t ,
where
yt 1
B(yt ) =
.
Hence
E(yt |xt ) = B 1 (1 + 2 xt ).
Because
lim0
y 1
= ln(yt ),
the Box-Cox model corresponds to the log-lin model in the special case of
= 0.
GLM
The so-called generalized linear model (GLM) provides an even more
flexible framework. Almost all models with left-hand-side variable transformations are special cases of those allowed in the generalized linear model
(GLM). In the GLM, we have
G(yt ) = 1 + 2 xt + t ,
so that
E(yt |xt ) = G1 (1 + 2 xt ).
Wide classes of link functions G can be entertained. Log-lin regression,
for example, emerges when G(yt ) = ln(yt ), and Box-Cox regression emerges
when G(yt ) =
yt 1
.
7.2
99
1
,
a + brx
with 0 < r < 1. The precise shape of the logistic curve of course depends on
the precise values of a, b and r, but its S-shape is often useful. The key
point for our present purposes is that there is no simple transformation of y
that produces a model linear in the transformed variables.
7.2.1
The least squares estimator is often called ordinary least squares, or OLS.
As we saw earlier, the OLS estimator has a simple closed-form analytic expression, which makes it trivial to implement on modern computers. Its
computation is fast and reliable.
The adjective ordinary distinguishes ordinary least squares from more
laborious strategies for finding the parameter configuration that minimizes
the sum of squared residuals, such as the non-linear least squares (NLS)
estimator. When we estimate by non-linear least squares, we use a computer
to find the minimum of the sum of squared residual function directly, using
numerical methods, by literally trying many (perhaps hundreds or even thousands) of different values until we find those that appear to minimize the
sum of squared residuals. This is not only more laborious (and hence slow),
but also less reliable, as, for example, one may arrive at a minimum that is
local but not global.
Why then would anyone ever use non-linear least squares as opposed to
100
OLS? Indeed, when OLS is feasible, we generally do prefer it. For example,
in all regression models discussed thus far OLS is applicable, so we prefer it.
Intrinsically non-linear models cant be estimated using OLS, however, but
they can be estimated using non-linear least squares. We resort to non-linear
least squares in such cases.
Intrinsically non-linear models obviously violate the linearity assumption
of the FIC. But the violation is not a big deal. Under the remaining FIC
(that is, dropping only linearity), N LS has a sampling distribution similar
to that under the FIC.
7.3
Series Expansions
Taylor
First consider Taylor series expansions of f (xt ).
The linear (first-order) approximation is
f (xt ) 1 + 2 x,
and the quadratic (second-order) approximation is
f (xt ) 1 + 2 xt + 3 x2t .
101
In the multiple regression case, Taylor approximations also involve interaction terms. Consider, for example, f (xt , zt ):
f (xt , zt ) 1 + 2 xt + 3 zt + 4 x2t + 5 zt2 + 6 xt zt + ....
Such interaction effects are also relevant in situations involving dummy
variables. There we capture interactions by including products of dummies.1
Key insight:
The ultimate point is that so-called intrinsically non-linear models are
themselves linear when viewed from the series-expansion perspective. In principle, of course, an infinite number of series terms are required, but in practice
nonlinearity is often quite gentle (e.g., quadratic) so that only a few series
terms are required.
So non-linearity is in some sense really an omitted-variables problem
Fourier
Notice that a product of dummies is one if and only if both individual dummies are one.
102
7.4
It is of interest to step back and ask what parts of the FIC are violated in
our various non-linear models.
Models linear in transformed variables (e.g., log-log regression) actually
dont violate the FIC, after transformation. Neither do series expansion models, if the adopted expansion order is deemed correct, because they too are
linear in transformed variables.
The series approach to handling non-linearity is actually very general and
handles intrinsically non-linear models as well, and low-ordered expansions
are often adequate in practice, even if an infinite expansion is required in
theory. If series terms are needed, a purely linear model would suffer from
misspecification of the X matrix (a violation of the FIC) due to the omitted
higher-order expansion terms. Hence the failure of the FIC discussed in this
chapter can be viewed either as:
1. The linearity assumption (E(y|X) = X 0 ) is incorrect, or
2. The linearity assumption (E(y|X) = X 0 ) is correct, but the assumption
that X is correctly specified (i.e., no omitted variables) is incorrect, due
to the omitted higher-order expansion terms.
7.5
7.5.1
One can use the usual t and F tests for testing linear models against nonlinear alternatives in nested cases, and information criteria (AIC and SIC)
for testing against non-linear alternatives in non-nested cases. To test linearity against a quadratic alternative in a simple regression case, for example,
we can simply run y c, x, x2 and perform a t-test for the relevance of x2 .
And of course, use AIC and SIC as always.
7.5.2
103
7.6
For convenience we reproduce in Figure 7.1 the results of our current linear
wage regression,
LW AGE c, EDU C, EXP ER,
F EM ALE, U N ION, N ON W HIT E.
The RESET test from that regression suggests neglected non-linearity; the
p-value is .03 when using yt2 and yt3 in the RESET test regression.
Non-Linearity in EDU C and EXP ER: Powers and Interactions
104
Given the results of the RESET test, we proceed to allow for non-linearity.
In Figure 7.2 we show the results of the quadratic regression
LW AGE EDU C, EXP ER
EDU C 2 , EXP ER2 , EDU C EXP ER,
F EM ALE, U N ION, N ON W HIT E
Two of the non-linear effects are significant. The impact of experience is
decreasing, and experience seems to trade off with education, insofar as the
interaction is negative.
Non-Linearity in F EM ALE, U N ION and N ON W HIT E: Interactions
Just as continuous variables like EDU C and EXP ER may interact (and
we found that they do), so too may discrete dummy variables. For example,
the wage effect of being female and non-white might not simply be the sum
of the individual effects. We would estimate it as the sum of coefficients on
the individual dummies F EM ALE and N ON W HIT E plus the coefficient
105
Now lets incorporate powers and interactions in EDU C and EXP ER, and
interactions in F EM ALE, U N ION and N ON W HIT E.
In Figure 7.4 we show results for
LW AGE EDU C, EXP ER,
106
Figure 7.3: Wage Regression on Education, Experience, Group Dummies, and Interactions
107
Figure 7.4: Wage Regression with Continuous Non-Linearities and Interactions, and Discrete
Interactions
7.7
108
109
under the full ideal conditions. Find the mean of yt conditional upon
xt = xt and zt = zt . Is the conditional mean linear in (xt ? zt )?
6. (OLS vs. NLS)
Consider the following three regression models:
yt = 1 + 2 xt + t
yt = 1 e2 xt t
yt = 1 + e2 xt + t .
a. For each model, determine whether OLS may be used for estimation
(perhaps after transforming the data), or whether NLS is required.
b. For those models for which OLS is feasible, do you expect NLS and
OLS estimation results to agree precisely? Why or why not?
c. For those models for which NLS is required, show how to avoid it
using series expansions.
7. (Graphical regression diagnostic: scatterplot of et vs. xt )
This plot helps us assess whether the relationship between y and the set
of xs is truly linear, as assumed in linear regression analysis. If not,
the linear regression residuals will depend on x. In the case where there
is only one right-hand side variable, as above, we can simply make a
scatterplot of et vs. xt . When there is more than one right-hand side
variable, we can make separate plots for each, although the procedure
loses some of its simplicity and transparency.
8. (What is linear regression really estimating?)
It is important to note the distinction between a conditional mean and
a linear projection. The conditional mean is not necessarily a linear function of the conditioning variable(s). The linear projection is of
110
111
is related, and what are the two OLS regressions to which they
correspond?
(e) Consider an additional regressor, AGE, where AGE = 6 + EDUC
+ EXPER. (The idea is that 6 years of early childhood, followed by
EDUC years of education, followed by EXPER years of work experience should, under certain assumptions, sum to a persons age.)
Discuss the likely effects, if any, of adding AGE to the regression.
(f) The log wage may of course not be linear in EDUC and EXPER.
How would you assess the possibility of quadratic nonlinear effects
using t-tests? An F-test? The Schwarz criterion (SIC)? R2 ?
(g) Suppose you find that the log wage relationship is indeed non-linear
but still very simple, with only EXPER2 entering in addition to the
E(LWAGE | X)
in the expanded model?
EXPER
E(LWAGE | X)
in the original model of Figure
EXPER
112
(j) Discuss whether and how you would incorporate trend and seasonality by using a linear time trend variable and a set of seasonal dummy
variables.
7.8
Notes
Chapter 8
Heteroskedasticity and Clustering in
Cross Sections
Generalized Least Squares (GLS)
Consider the FIC except that we now let:
N (0, )
The old case is = 2 I, but things are very different when 6= 2 I:
OLS parameter estimates consistent but inefficient
(no longer MVUE or BLUE)
OLS standard errors are biased and inconsistent. Hence t ratios do not
have the t distribution in finite samples and do not have the N (0, 1)
distribution asymptotically
The GLS estimator is:
GLS = (X 0 1 X)1 X 0 1 y
Under the remaining full ideal conditions it is consistent, normally
distributed with covariance matrix (X 0 1 X)1 , and MVUE:
GLS N , (X 0 1 X)1 .
113
12 0 . . .
0 22 . . . 0
=
... ... . . . ...
2
0 0 . . . N
Can arise for many reasons
Engel curve (e.g., food expenditure vs. income) is classic example
Consequences
OLS inefficient (no longer MVUE or BLUE),
in finite samples and asymptotically
Standard errors biased and inconsistent.
Hence t ratios do not have the t distribution in finite samples
and do not have the N (0, 1) distribution asymptotically
Detection
Graphical heteroskedasticity diagnostics
115
Graphical Diagnostics
Graph e2i against xi , for various regressors
Problem: Purely pairwise
Recall Our Final Wage Regression
Squared Residual vs. EDUC
The Breusch-Godfrey-Pagan Test (BGP)
Estimate the OLS regression, and obtain the squared residuals
Regress the squared residuals on all regressors
To test the null hypothesis of no relationship, examine N R2 from this
regression. In large samples N R2 2 under the null.
BGP Test
Whites Test
Estimate the OLS regression, and obtain the squared residuals
Regress the squared residuals on all regressors, squared regressors, and
pairwise regressor cross products
To test the null hypothesis of no relationship, examine N R2 from this
regression. In large samples N R2 2 under the null.
(Whites test is a natural and flexible
generalization of the Breusch-Godfrey-Pagan test)
White Test
GLS for Heteroskedasticity
Weighted least squares (WLS)
Take a stand on the DGP. Get consistent standard errors and efficient
parameter estimates.
117
min
2
N
X
yi x 0
i
i=1
N
X
1
2
= min
(yi x0i )
2
i=1 i
119
e2i is too noisy; wed like to use not e2i but rather E(e2i |xi ). So we use an
estimate of E(e2i |xi ), namely eb2i from e2 X
Regression Weighted by Fit From White Test Regression
A Different Approach
(Advanced but Very Important)
Whites Heteroskedasticity-Consistent Standard Errors
Perhaps surprisingly, we make direct use of e2i
Dont take a stand on the DGP
Give up on efficient parameter estimates, but get consistent s.e.s.
Using advanced methods, one can obtain consistent
using only e2
s.e.s (if not an efficient )
i
8.1
8.2
1. (Robustness iteration)
Do a second-stage WLS with weights 1/|et |, or something similar. This
is not a heteroskedasticity correction, but a purely mechanical strategy
to downweight outliers.
2. (Vocabulary)
All these have the same meaning: White standard errors, White-washed
standard errors, heteroskedasticity-robust standard errors, heteroskedasticityconsistent standard errors, and robust standard errors.
8.3
Notes
Part III
Time Series
121
Chapter 9
Indicator Variables in Time Series:
Trend and Seasonality
The time series that we want to model vary over time, and we often mentally attribute that variation to unobserved underlying components related
to trend and seasonality.
9.1
Linear Trend
123
9.2. SEASONALITY
125
9.2
Seasonality
In the last section we focused on the trends; now well focus on seasonality.
A seasonal pattern is one that repeats itself every year.2 The annual repetition can be exact, in which case we speak of deterministic seasonality, or
approximate, in which case we speak of stochastic seasonality. Here we
focus exclusively on deterministic seasonality models.
Seasonality arises from links of technologies, preferences and institutions
to the calendar. The weather (e.g., daily high temperature) is a trivial but
very important seasonal series, as its always hotter in the summer than in
the winter. Any technology that involves the weather, such as production of
agricultural commodities, is likely to be seasonal as well.
Preferences may also be linked to the calendar. Consider, for example,
gasoline sales. People want to do more vacation travel in the summer, which
tends to increase both the price and quantity of summertime gasoline sales,
both of which feed into higher current-dollar sales.
Finally, social institutions that are linked to the calendar, such as holidays,
are responsible for seasonal variation in a variety of series. In Western countries, for example, sales of retail goods skyrocket every December, Christmas
season. In contrast, sales of durable goods fall in December, as Christmas
purchases tend to be nondurables. (You dont buy someone a refrigerator for
Christmas.)
You might imagine that, although certain series are seasonal for the reasons described above, seasonality is nevertheless uncommon. On the contrary, and perhaps surprisingly, seasonality is pervasive in business and economics. Many industrialized economies, for example, expand briskly every
2
Note therefore that seasonality is impossible, and therefore not an issue, in data recorded once per year,
or less often than once per year.
Seasonal Dummies
A key technique for modeling seasonality is regression on seasonal dummies. Let s be the number of seasons in a year. Normally wed think of four
seasons in a year, but that notion is too restrictive for our purposes. Instead,
think of s as the number of observations on a series in each year. Thus s = 4
if we have quarterly data, s = 12 if we have monthly data, s = 52 if we have
weekly data, and so forth.
The pure seasonal dummy model is
Seasonalt =
s
X
i SEASit
i=1
(
where SEASit =
The SEASit variables are called seasonal dummy variables. They simply
indicate which season were in.
Operationalizing the model is simple. Suppose, for example, that we have
quarterly data, so that s = 4. Then we create four variables3 :
SEAS1 = (1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, ..., 0)0
SEAS2 = (0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, ..., 0)0
SEAS3 = (0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, ..., 0)0
SEAS4 = (0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, ..., 1)0 .
SEAS1 indicates whether were in the first quarter (its 1 in the first quarter
and zero otherwise), SEAS2 indicates whether were in the second quarter
(its 1 in the second quarter and zero otherwise), and so on. At any given
time, we can be in only one of the four quarters, so one seasonal dummy is
1, and all others are zero.
3
For illustrative purposes, assume that the data sample begins in Q1 and ends in Q4.
9.2. SEASONALITY
127
To estimate the model for a series y, we simply run the least squares
regression,
y SEAS1 , ..., SEASs .
Effectively, were just regressing on an intercept, but we allow for a different
intercept in each season. Those different intercepts (that is i s) are called the
seasonal factors; they summarize the seasonal pattern over the year, and we
often may want to examine them and plot them. In the absence of seasonality,
those intercepts are all the same, so we can drop all the seasonal dummies
and instead simply include an intercept in the usual way.
In time-series contexts its often most natural to include a full set of seasonal dummies, without an intercept. But of course we could instead include
any s 1 seasonal dummies and an intercept. Then the constant term is the
intercept for the omitted season, and the coefficients on the seasonal dummies give the seasonal increase or decrease relative to the omitted season. In
no case, however, should we include s seasonal dummies and an intercept.
Including an intercept is equivalent to including a variable in the regression
whose value is always one, but note that the full set of s seasonal dummies
sums to a variable whose value is always one, so it is completely redundant.
Trend may be included as well. For example, we can account for seasonality and linear trend by running4
y T IM E, SEAS1 , ..., SEASs .
In fact, you can think of what were doing in this section as a generalization
of what we did in the last, in which we focused exclusively on trend. We still
want to account for trend, if its present, but we want to expand the model
so that we can account for seasonality as well.
4
9.2.2
The idea of seasonality may be extended to allow for more general calendar
effects. Standard seasonality is just one type of calendar effect. Two
additional important calendar effects are holiday variation and tradingday variation.
Holiday variation refers to the fact that some holidays dates change over
time. That is, although they arrive at approximately the same time each year,
the exact dates differ. Easter is a common example. Because the behavior
of many series, such as sales, shipments, inventories, hours worked, and so
on, depends in part on the timing of such holidays, we may want to keep
track of them in our forecasting models. As with seasonality, holiday effects
may be handled with dummy variables. In a monthly model, for example,
in addition to a full set of seasonal dummies, we might include an Easter
dummy, which is 1 if the month contains Easter and 0 otherwise.
Trading-day variation refers to the fact that different months contain different numbers of trading days or business days, which is an important consideration when modeling and forecasting certain series. For example, in a
monthly forecasting model of volume traded on the London Stock Exchange,
in addition to a full set of seasonal dummies, we might include a trading day
variable, whose value each month is the number of trading days that month.
More generally, you can model any type of calendar effect that may arise,
by constructing and including one or more appropriate dummy variables.
9.3
129
The nature of the logarithmic transformation is such that it compresses an increasing variance. Make
a graph of log(x) as a function of x, and youll see why.
6
From this point onward, for brevity well simply refer to liquor sales, but remember that weve taken
logs.
7
Recall that the Durbin-Watson test is designed to detect simple AR(1) dynamics. It also has the ability
to detect other sorts of dynamics, but evidently not those relevant to the present application, which are very
different from a simple AR(1).
and seasonal dummies. (Note that we dropped the intercept!) The seasonal
dummies are highly significant, and in many cases significantly different from
each other. R2 is higher.
In Figure 9.7 we show the corresponding residual plot. The model now
picks up much of the seasonality, as reflected in the seasonal fitted series and
the non-seasonal residuals.
In Figure 9.8 we plot the estimated seasonal pattern, which peaks during
the winter holidays.
All of these results are crude approximations, because the linear trend
is clearly inadequate. We will subsequently allow for more sophisticated
(nonlinear) trends.
9.4
131
Coefficient
Std. Error
t-Statistic
Prob.
C
TIME
6.454290
0.003809
0.017468
8.98E-05
369.4834
42.39935
0.0000
0.0000
R-squared
Adjusted R-squared
S.E. of regression
Sum squared resid
Log likelihood
F-statistic
Prob(F-statistic)
0.843318
0.842849
0.159743
8.523001
140.5262
1797.705
0.000000
7.096188
0.402962
-0.824561
-0.801840
-0.815504
1.078573
b. Fit a linear trend. Discuss both the estimation results and the residual
plot.
c. Is there any evidence of seasonality in the residuals? Why or why
not?
d. The residuals from your fitted model are effectively a linearly detrended version of your original series. Why? Discuss.
2. (Using model selection criteria to select a trend model)
You are tracking and forecasting the earnings of a new company developing and applying proprietary nano-technology. The earnings are trending upward. You fit linear, quadratic, and exponential trend models,
yielding sums of squared residuals of 4352, 2791, and 2749, respectively.
Which trend model would you select, and why?
3. (Seasonal adjustment)
Just as we sometimes want to remove the trend from a series, sometimes
133
9.5. NOTES
135
9.5
Notes
Nerlove et al. (1979) and Harvey (1991) discuss a variety of models of trend
and seasonality.
The two most common and important official seasonal adjustment methods are X-12-ARIMA from the U.S. Census Bureau, and TRAMO-SEATS
from the Bank of Spain.
Chapter 10
Non-Linearity and Structural Change
in Time Series
In time series a central issue is nonlinear trend. Here we focus on it.
10.1
Exponential Trend
The insight that exponential growth is non-linear in levels but linear in logarithms takes us to the idea of exponential trend, or log-linear trend,
which is very common in business, finance and economics.1
Exponential trend is common because economic variables often display
roughly constant real growth rates (e.g., two percent per year). If trend is
characterized by constant growth at rate 2 , then we can write
T rendt = 1 e2 T IM Et .
The trend is a non-linear (exponential) function of time in levels, but in
logarithms we have
ln(T rendt ) = ln(1 ) + 2 T IM Et .
Thus, ln(T rendt ) is a linear function of time.
1
137
(10.1)
In Figure 10.1 we show the variety of exponential trend shapes that can
be obtained depending on the parameters. Depending on the signs and sizes
of the parameter values, exponential trend can achieve a variety of patterns,
increasing or decreasing at increasing or decreasing rates.
Although the exponential trend model is non-linear, we can estimate it by
simple least squares regression, because it is linear in logs. We simply run the
least squares regression, ln y c, T IM E. Note that because the intercept
in equation (10.1) is not 1 , but rather ln(1 ), we need to exponentiate the
estimated intercept to get an estimate of 1 . Similarly, the fitted values from
this regression are the fitted values of lny, so they must be exponentiated to
get the fitted values of y. This is necessary, for example, for appropriately
comparing fitted values or residuals (or statistics based on residuals, like AIC
and SIC) from estimated exponential trend models to those from other trend
models.
139
Its important to note that, although the same sorts of qualitative trend
shapes can be achieved with quadratic and exponential trend, there are subtle differences between them. The non-linear trends in some series are well
approximated by quadratic trend, while the trends in other series are better
approximated by exponential trend. Ultimately its an empirical matter as
to which is best in any particular application.
10.2
Quadratic Trend
Sometimes trend appears non-linear, or curved, as for example when a variable increases at an increasing or decreasing rate. Ultimately, we dont require
that trends be linear, only that they be smooth.
We can allow for gentle curvature by including not only T IM E, but also
T IM E 2 ,
T rendt = 1 + 2 T IM Et + 3 T IM Et2 .
This is called quadratic trend, because the trend is a quadratic function of
T IM E.2 Linear trend emerges as a special (and potentially restrictive) case
when 3 = 0.
A variety of different non-linear quadratic trend shapes are possible, depending on the signs and sizes of the coefficients; we show several in Figure
10.2. In particular, if 2 > 0 and 3 > 0 as in the upper-left panel, the trend is
monotonically, but non-linearly, increasing, Conversely, if 2 < 0 and 3 < 0,
the trend is monotonically decreasing. If 2 < 0 and 3 > 0 the trend has a
U shape, and if 2 > 0 and 3 < 0 the trend has an inverted U shape. Keep
in mind that quadratic trends are used to provide local approximations; one
rarely has a U-shaped trend, for example. Instead, all of the data may lie
on one or the other side of the U.
Estimating quadratic trend models is no harder than estimating linear
2
Higher-order polynomial trends are sometimes entertained, but its important to use low-order polynomials to maintain smoothness.
trend models. We first create T IM E and its square; call it T IM E2, where
T IM E2t = T IM Et2 . Because T IM E = (1, 2, ..., T ), T IM E2 = (1, 4, ..., T 2 ).
Then we simply run the least squares regression y c, T IM E, T IM E2.
Note in particular that although the quadratic is a non-linear function, it is
linear in the variables T IM E and T IM E2.
10.3
The trend regression technique is one way to estimate trend. Two additional
ways involve model-free smoothing techniques. They are moving-average
smoothers and Hodrick-Prescott smoothers. We briefly introduce them here.
10.3.1
141
m
X
yti ,
i=m
m
X
yti ,
i=0
m
X
wi yti ,
i=0
where the wi are weights and m is an integer chosen by the user. The standard one-sided moving average corresponds to a one-sided weighted moving
average with all weights equal to (m + 1)1 .
a. For each of the smoothing techniques, discuss the role played by m. What
happens as m gets very large? Very small? In what sense does m play a
role similar to p, the order of a polynomial trend?
b. If the original data runs from time 1 to time T , over what range can
smoothed values be produced using each of the three smoothing methods?
What are the implications for real-time smoothing or on-line
smoothing versus ex post smoothing or off-line smoothing?
10.3.2
A final approach to trend fitting and de-trending is known as HodrickPrescott filtering. The HP trend solves:
min
T
{st }t=1
T
X
(yt st ) +
t=1
T 1
X
t=2
10.4
Structural Change
Recall the full ideal conditions. Here we deal with violation of the assumption
that the coefficients, , are fixed.
The cross-section dummy variables that we already studied effectively allow for structural change in the cross section (heterogeneity across groups).
But structural change is of special relevance in time series. It can be gradual (Lucas critique, learning, evolution of tastes, ...) or abrupt (e.g., new
legislation).
Structural change is related to nonlinearity, because abrupt structural
change is actually a type of nonlinearity. Structural change is also related
to outliers, because outliers can sometimes be viewed as a kind of structural
change a quick intercept break and return.
For notational simplicity we consider the case of simple regression throughout, but the ideas extend immediately to multiple regression.
10.4.1
143
In many cases, parameters may evolve gradually rather than breaking abruptly.
Suppose, for example, that
yt = 1t + 2t xt + t
where
1t = 1 + 2 T IM Et
2t = 1 + 2 T IM Et .
Then we have:
yt = (1 + 2 T IM Et ) + (1 + 2 T IM Et )xt + t .
We simply run:
yt c, , T IM Et , xt , T IM Et xt .
This is yet another important use of dummies. The regression can be
used both to test for structural change (F test of 2 = 2 = 0), and to
accommodate it if present.
10.4.2
Exogenously-Specified Breaks
Suppose that we dont know whether a break occurred, but we know that if
it did occur, it occurred at time T .
A Dummy-Variable Approach That is, we entertain the possibility that
(
11 + 21 xt + t , t = 1, ..., T
yt =
12 + 22 xt + t , t = T + 1, ..., T
Let
0, t = 1, ..., T
Dt =
1, t = T + 1, ...T
SSRres SSR)/K
,
SSR/(T 2K)
where SSRres is from the regression using sample t = 1, ..., T and SSR =
SSR1 + SSR2 , where SSR1 is from the regression using sample t = 1, ..., T
and SSR2 is from the regression using sample t = T + 1, ...T . Under the
FIC, Chow is distributed F , with K and T 2K degrees of freedom.
The Chow test with Endogenous Break Selection
Thus far we have (unrealistically) assumed that the potential break date is
known. In practice, potential break dates are often unknown and are identified by peeking at the data. We can capture this phenomenon in stylized
fashion by imagining splitting the sample sequentially at each possible break
date, and picking the split at which the Chow breakpoint test statistic is
maximized. Implicitly, thats what people often do in practice, even if they
145
10.5
10.5.1
Dummy Variables
Notice that dummy (indicator) variables have arisen repeatedly in our discussions. We used 0-1 dummies to handle group heterogeneity in cross-sections.
We used time dummies to indicate the date in time series. We used 0-1
seasonal dummies to indicate the season in time series.
Now, in this chapter, we used both (1) time dummies to allow for gradual
parameter evolution, and (2) 0-1 dummies to indicate a sharp break date, in
time series.
10.5.2
Omitted Variables
Notice that omitted variables have also arisen repeatedly in our discussions.
1. If there are neglected group effects in cross-section regression, we fix the
problem (of omitted group dummies) by including the requisite group
dummies.
10.6
147
Coefficient
Std. Error
t-Statistic
Prob.
C
TIME
TIME2
6.231269
0.007768
-1.17E-05
0.020653
0.000283
8.13E-07
301.7187
27.44987
-14.44511
0.0000
0.0000
0.0000
R-squared
Adjusted R-squared
S.E. of regression
Sum squared resid
Log likelihood
F-statistic
Prob(F-statistic)
0.903676
0.903097
0.125439
5.239733
222.2579
1562.036
0.000000
7.096188
0.402962
-1.305106
-1.271025
-1.291521
1.754412
the hypothesis that the regression disturbance is white noise. The residual
plot (Figure 10.4) shows that the fitted quadratic trend appears adequate,
and that it increases at a decreasing rate. The residual plot also continues
to indicate obvious residual seasonality. (Why does the Durbin-Watson not
detect it?)
In Figure 10.5 we show the results of regression on quadratic trend and
a full set of seasonal dummies. The trend remains highly significant, and
the coefficients on the seasonal dummies vary significantly. The adjusted R2
rises to 99%. The Durbin-Watson statistic, moreover, has greater ability to
detect residual serial correlation now that we have accounted for seasonality, and it sounds a loud alarm. The residual plot of Figure 10.6 shows no
seasonality, as the model now accounts for seasonality, but it confirms the
Durbin-Watson statistics warning of serial correlation. The residuals appear
highly persistent.
There remains one model as yet unexplored, exponential trend fit to
LSALES. We do it by N LS (why?) and present the results in Figure ***.
Among the linear, quadratic and exponential trend models for LSALES,
both SIC and AIC clearly favor the quadratic.
Exogenously-specified break in log-linear trend model
Endogenously-selected break in log-linear trend model
SIC for best broken log-linear trend model vs. log-quadratic trend model
10.7
149
Coefficient
Std. Error
t-Statistic
Prob.
TIME
TIME2
D1
D2
D3
D4
D5
D6
D7
D8
D9
D10
D11
D12
0.007739
-1.18E-05
6.138362
6.081424
6.168571
6.169584
6.238568
6.243596
6.287566
6.259257
6.199399
6.221507
6.253515
6.575648
0.000104
2.98E-07
0.011207
0.011218
0.011229
0.011240
0.011251
0.011261
0.011271
0.011281
0.011290
0.011300
0.011309
0.011317
74.49828
-39.36756
547.7315
542.1044
549.3318
548.8944
554.5117
554.4513
557.8584
554.8647
549.0938
550.5987
552.9885
581.0220
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
R-squared
Adjusted R-squared
S.E. of regression
Sum squared resid
Log likelihood
Durbin-Watson stat
0.987452
0.986946
0.046041
0.682555
564.6725
0.581383
7.096188
0.402962
-3.277812
-3.118766
-3.214412
Figure 10.5: Liquor Sales Log-Quadratic Trend Estimation with Seasonal Dummies
Figure 10.6: Residual Plot, Liquor Sales Log-Quadratic Trend Estimation With Seasonal
Dummies
151
tives. Even the same software package may change algorithms or details
of implementation across versions, leading to different results.
5. (Direct estimation of exponential trend in levels)
We can estimate an exponential trend in two ways. First, as we have
emphasized, we can take logs and then use OLS to fit a linear trend.
Alternatively we can use NLS, proceeding directly from the exponential
representation and letting the computer find
(1 , 2 ) = argmin1 ,2
T
X
yt 1 e2 T IM Et
2
t=1
1
,
a + brT IM Et
with 0<r<1.
a. Graph the trend shape for various combinations of a and b values.
When might such a trend shape be useful?
b. Can you think of other specialized situations in which other specialized trend shapes might be useful? Produce mathematical formulas
for the additional specialized trend shapes you suggest.
7. (Modeling Liquor Sales Trend and Seasonality)
Consider the liquor sales data. Never include an intercept. Discuss all
results in detail.
(a) Fit a linear trend plus seasonal dummy model to log liquor sales
(LSALES), using a full set of seasonal dummies.
(b) Find a best linear trend plus seasonal dummy LSALES model.
That is, consider tightening the seasonal specification to include
fewer than 12 seasonal dummies, and decide whats best.
(c) Keeping the same seasonality specification as in (7b), re-estimate
the model in levels (that is, the LHS variable is now SALES rather
than LSALES) using exponential trend and nonlinear least squares.
Do your coefficient estimates match those from (7b)? Does the SIC
match that from (7b)?
(d) Repeat (7c), again using SALES and again leaving intact your seasonal specification from (7b), but try linear and quadratic trend instead of the exponential trend in (7c). What is your final SALES
model?
(e) Critique your final SALES model from (7d). In what ways is it
likely still deficient? You will of course want to discuss its residual
plot (actual values, fitted values, residuals), as well as any other
diagnostic plots or statistics that you deem relevant.
(f) Take your final estimated SALES model from (7d), and include as
regressors three lags of SALES (i.e., SALESt1 , SALESt2 and
SALESt3 ). What role do the lags of SALES play? Consider this
new model to be your final, final SALES model, and repeat (7e).
8. Regime Switching I: Observed-Regime Threshold Model
10.8. NOTES
153
yt =
(u)
(l)
!
(yt st )2
.
2 2
Switching regression:
f (yt |st ) =
10.8
Notes
1
exp
2
(yt x0t st )2
2 2
!
.
Chapter 11
Serial Correlation in Observed Time
Series
Observed Time Series.
11.1
Weve already considered models with trend and seasonal components. In this
chapter we consider a crucial third component, cycles. When you think of a
cycle, you probably think of the sort of rigid up-and-down pattern depicted
in Figure ??. Such cycles can sometimes arise, but cyclical fluctuations in
business, finance, economics and government are typically much less rigid.
In fact, when we speak of cycles, we have in mind a much more general,
all-encompassing, notion of cyclicality: any sort of dynamics not captured by
trends or seasonals.
Cycles, according to our broad interpretation, may display the sort of
back-and-forth movement characterized in Figure ??, but they dont have to.
All we require is that there be some dynamics, some persistence, some way in
which the present is linked to the past, and the future to the present. Cycles
are present in most of the series that concern us, and its crucial that we know
how to model and forecast them, because their history conveys information
155
156
157
erning the future would differ from those governing the past. At a minimum
wed like a series mean and its covariance structure (that is, the covariances
between current and past values) to be stable over time, in which case we
say that the series is covariance stationary. Lets discuss covariance stationarity in greater depth. The first requirement for a series to be covariance
stationary is that the mean of the series be stable over time. The mean of
the series at time t is Eyt = t . If the mean is stable over time, as required
by covariance stationarity, then we can write Eyt = , for all t. Because the
mean is constant over time, theres no need to put a time subscript on it.
The second requirement for a series to be covariance stationary is that
its covariance structure be stable over time. Quantifying stability of the
covariance structure is a bit tricky, but tremendously important, and we do
it using the autocovariance function. The autocovariance at displacement
is just the covariance between yt and yt . It will of course depend on ,
and it may also depend on t, so in general we write
(t, ) = cov(yt , yt ) = E(yt )(yt ).
If the covariance structure is stable over time, as required by covariance
stationarity, then the autocovariances depend only on displacement, , not
on time, t, and we write (t, ) = ( ), for all t.
The autocovariance function is important because it provides a basic summary of cyclical dynamics in a covariance stationary series. By examining
the autocovariance structure of a series, we learn about its dynamic behavior. We graph and examine the autocovariances as a function of . Note that
the autocovariance function is symmetric; that is, ( ) = ( ), for all .
Typically, well consider only non-negative values of . Symmetry reflects the
fact that the autocovariance of a covariance stationary series depends only
on displacement; it doesnt matter whether we go forward or backward. Note
also that (0) = cov(yt , yt ) = var(yt ).
158
For that reason, covariance stationarity is sometimes called second-order stationarity or weak stationarity.
159
by
corr(x, y) =
cov(x, y)
.
x y
That is, the correlation is simply the covariance, normalized, or standardized, by the product of the standard deviations of x and y. Both the
correlation and the covariance are measures of linear association between two
random variables. The correlation is often more informative and easily interpreted, however, because the construction of the correlation coefficient guarantees that corr(x, y) [1, 1], whereas the covariance between the same two
random variables may take any value. The correlation, moreover, does not
depend on the units in which x and y are measured, whereas the covariance
does. Thus, for example, if x and y have a covariance of ten million, theyre
not necessarily very strongly associated, whereas if they have a correlation of
.95, it is unambiguously clear that they are very strongly associated.
In light of the superior interpretability of correlations as compared to
covariances, we often work with the correlation, rather than the covariance,
between yt and yt . That is, we work with the autocorrelation function,
( ), rather than the autocovariance function, ( ). The autocorrelation
function is obtained by dividing the autocovariance function by the variance,
( ) =
( )
, = 0, 1, 2, ....
(0)
The formula for the autocorrelation is just the usual correlation formula,
specialized to the correlation between yt and yt . To see why, note that the
variance of yt is (0), and by covariance stationarity, the variance of y at any
other time yt is also (0). Thus,
cov(yt , yt )
( )
( )
p
p
( ) = p
=p
=
,
(0)
var(yt ) var(yt )
(0) (0)
as claimed. Note that we always have (0) =
(0)
(0)
160
161
11.2
White Noise
In this section well study the population properties of certain important time
series models, or time series processes. Before we estimate time series
models, we need to understand their population properties, assuming that
the postulated model is true. The simplest of all such time series processes
is the fundamental building block from which all others are constructed. In
fact, its so important that we introduce it now. We use y to denote the
observed series of interest. Suppose that
yt = t
t (0, 2 ),
where the shock, t , is uncorrelated over time. We say that t , and hence yt
, is serially uncorrelated. Throughout, unless explicitly stated otherwise,
we assume that 2 < . Such a process, with zero mean, constant variance,
and no serial correlation, is called zero-mean white noise, or simply white
162
Its called white noise by analogy with white light, which is composed of all colors of the spectrum,
in equal amounts. We can think of white noise as being composed of a wide variety of cycles of differing
periodicities, in equal amounts.
5
Recall that zero correlation implies independence only in the normal case.
6
Another name for independent white noise is strong white noise, in contrast to standard serially
uncorrelated weak white noise.
7
Carl Friedrich Gauss, one of the greatest mathematicians of all time, discovered the normal distribution
some 200 years ago; hence the adjective Gaussian.
163
, = 0
0, 1,
164
1, = 0
( ) =
0, 1.
In Figure *** we plot the white noise autocorrelation function.
Finally, consider the partial autocorrelation function for a white noise
series. For the same reason that the autocorrelation at displacement 0 is
always one, so too is the partial autocorrelation at displacement 0. For a
white noise process, all partial autocorrelations beyond displacement 0 are
zero, which again follows from the fact that white noise, by construction, is
serially uncorrelated. Population regressions of yt on yt1 , or on yt1 and
yt2 , or on any other lags, produce nothing but zero coefficients, because the
process is serially uncorrelated. Formally, the partial autocorrelation function
of a white noise process is
p( ) =
1, = 0
0, 1.
165
is to reduce the data (or 1-step-ahead forecast errors) to white noise. After
all, if such forecast errors arent white noise, then theyre serially correlated,
which means that theyre forecastable, and if forecast errors are forecastable
then the forecast cant be very good. Thus its important that we understand
and be able to recognize white noise.
Thus far weve characterized white noise in terms of its mean, variance,
autocorrelation function and partial autocorrelation function. Another characterization of dynamics involves the mean and variance of a process, conditional upon its past. In particular, we often gain insight into the dynamics in
a process by examining its conditional mean.10 In fact, throughout our study
of time series, well be interested in computing and contrasting the unconditional mean and variance and the conditional mean and variance of
various processes of interest. Means and variances, which convey information
about location and scale of random variables, are examples of what statisticians call moments. For the most part, our comparisons of the conditional
and unconditional moment structure of time series processes will focus on
means and variances (theyre the most important moments), but sometimes
well be interested in higher-order moments, which are related to properties
such as skewness and kurtosis.
For comparing conditional and unconditional means and variances, it will
simplify our story to consider independent white noise, yt iid(0, 2 ). By
the same arguments as before, the unconditional mean of y is 0 and the unconditional variance is 2 . Now consider the conditional mean and variance,
where the information set t1 upon which we condition contains either the
past history of the observed series, t1 = yt1 , yt2 , ..., or the past history of
the shocks, t1 = t1 , t2 .... (Theyre the same in the white noise case.)
In contrast to the unconditional mean and variance, which must be constant
by covariance stationarity, the conditional mean and variance need not be
10
If you need to refresh your memory on conditional means, consult any good introductory statistics book,
such as Wonnacott and Wonnacott (1990).
166
constant, and in general wed expect them not to be constant. The unconditionally expected growth of laptop computer sales next quarter may be ten
percent, but expected sales growth may be much higher, conditional upon
knowledge that sales grew this quarter by twenty percent. For the independent white noise process, the conditional mean is
E(yt |t1 ) = 0,
and the conditional variance is
var(yt |t1 ) = E[(yt E(yt |t1 ))2 |t1 ] = 2 .
Conditional and unconditional means and variances are identical for an independent white noise series; there are no dynamics in the process, and hence
no dynamics in the conditional moments.
11.3
Estimation and Inference for the Mean, Autocorrelation and Partial Autocorrelation Functions
Now suppose we have a sample of data on a time series, and we dont know
the true model that generated the data, or the mean, autocorrelation function
or partial autocorrelation function associated with that true model. Instead,
we want to use the data to estimate the mean, autocorrelation function, and
partial autocorrelation function, which we might then use to help us learn
about the underlying dynamics, and to decide upon a suitable model or set
of models to fit to the data.
11.3.1
Sample Mean
11.3. ESTIMATION AND INFERENCE FOR THE MEAN, AUTOCORRELATION AND PARTIAL AUT
Typically were not directly interested in the estimate of the mean, but its
needed for estimation of the autocorrelation function.
11.3.2
Sample Autocorrelations
E [(yt )(yt )]
.
E[(yt )2 ]
1
T
PT
)(yt
t= +1 [(yt y
P
T
1
)2
t=1 (yt y
T
y)]
PT
=
)(yt
t= +1 [(yt y
PT
)2
t=1 (yt y
y)]
This estimator, viewed as a function of , is called the sample autocorrelation function, or correlogram. Note that some of the summations begin
at t = + 1, not at t = 1; this is necessary because of the appearance of yt
in the sum. Note that we divide those same sums by T , even though only
T terms appear in the sum. When T is large relative to (which is the
relevant case), division by T or by T will yield approximately the same
result, so it wont make much difference for practical purposes, and moreover
there are good mathematical reasons for preferring division by T .
Its often of interest to assess whether a series is reasonably approximated
as white noise, which is to say whether all its autocorrelations are zero in
population. A key result, which we simply assert, is that if a series is white
noise, then the distribution of the sample autocorrelations in large samples
168
is
( ) N
1
0,
T
.
Note how simple the result is. The sample autocorrelations of a white noise
series are approximately normally distributed, and the normal is always a
convenient distribution to work with. Their mean is zero, which is to say the
sample autocorrelations are unbiased estimators of the true autocorrelations,
which are in fact zero. Finally, the variance of the sample autocorrelations
T ( ) N (0, 1).
11.3. ESTIMATION AND INFERENCE FOR THE MEAN, AUTOCORRELATION AND PARTIAL AUT
m
X
2 ( ),
=1
is approximately distributed as a 2m random variable under the null hypothesis that y is white noise.12 A slight modification of this, designed to follow
more closely the 2 distribution in small samples, is
QLB = T (T + 2)
m
X
=1
1
T
2 ( ).
Under the null hypothesis that y is white noise, QLB is approximately distributed as a 2m random variable. Note that the Ljung-Box Q-statistic is
the same as the Box-Pierce Q statistic, except that the sum of squared autocorrelations is replaced by a weighted sum of squared autocorrelations, where
the weights are (T + 2)/(T ). For moderate and large T , the weights are
approximately 1, so that the Ljung-Box statistic differs little from the BoxPierce statistic.
Selection of m is done to balance competing criteria. On one hand, we
dont want m too small, because after all, were trying to do a joint test on
11
Recall that the square of a standard normal random variable is a 2 random variable with one degree
of freedom. We square the sample autocorrelations ( ) so that positive and negative values dont cancel
when we sum across various values of , as we will soon do.
12
m is a maximum displacement selected by the user. Shortly well discuss how to choose it.
170
Recall that the partial autocorrelations are obtained from population linear
regressions, which correspond to a thought experiment involving linear regression using an infinite sample of data. The sample partial autocorrelations
correspond to the same thought experiment, except that the linear regression
is now done on the (feasible) sample of size T . If the fitted regression is
yt = c + 1 yt1 + ... + yt ,
then the sample partial autocorrelation at displacement is
p( ) .
Distributional results identical to those we discussed for the sample autocorrelations hold as well for the sample partial autocorrelations. That is, if
the series is white noise, approximately 95% of the sample partial autocorre
lations should fall in the interval 2/ T . As with the sample autocorrelations, we typically plot the sample partial autocorrelations along with their
two-standard-error bands.
A correlogram analysis simply means examination of the sample autocorrelation and partial autocorrelation functions (with two standard error
bands), together with related diagnostics, such as Q statistics.
We dont show the sample autocorrelation or partial autocorrelation at
displacement 0, because as we mentioned earlier, they equal 1.0, by construction, and therefore convey no useful information. Well adopt this convention
throughout.
Note that the sample autocorrelation and partial autocorrelation are identical at displacement 1. Thats because at displacement 1, there are no earlier
lags to control for when computing the sample partial autocorrelation, so it
equals the sample autocorrelation. At higher displacements, of course, the
two diverge.
11.4
11.4.1
The lag operator and related constructs are the natural language in which
time series models are expressed. If you want to understand and manipulate
time series models indeed, even if you simply want to be able to read the
software manuals you have to be comfortable with the lag operator. The
lag operator, L, is very simple: it operates on a series by lagging it. Hence
Lyt = yt1 . Similarly, L2 yt = L(L(yt )) = L(yt1 ) = yt2 , and so on. Typically
well operate on a series not with the lag operator but with a polynomial
in the lag operator. A lag operator polynomial of degree m is just a linear
function of powers of L, up through the m-th power,
B(L) = b0 + b1 L + b2 L2 + ...bm Lm .
To take a very simple example of a lag operator polynomial operating on
a series, consider the m-th order lag operator polynomial Lm , for which
Lm yt = ytm .
A well-known operator, the first-difference operator , is actually a first-order
172
B(L) = b0 + b1 L + b2 L + ... =
bi Li .
i=0
Thus, for example, to denote an infinite distributed lag of current and past
shocks we might write
B(L)t = b0 t + b1 t1 + b2 t2 + ... =
bi ti .
i=0
At first sight, infinite distributed lags may seem esoteric and of limited practical interest, because models with infinite distributed lags have infinitely
many parameters (b0 , b1 , b2 , ...) and therefore cant be estimated with a finite
sample of data. On the contrary, and surprisingly, it turns out that models
involving infinite distributed lags are central to time series modeling. Wolds
theorem, to which we now turn, establishes that centrality.
11.4.2
Autoregressions
When building models, we dont want to pretend that the model we fit is
true. Instead, we want to be aware that were approximating a more complex
reality. Thats the modern view, and it has important implications for timeseries modeling. In particular, the key to successful time series modeling
is parsimonious, yet accurate, approximations. Here we emphasize a very
important class of approximations, the autoregressive (AR) model.
We begin by characterizing the autocorrelation function and related quantities under the assumption that the AR model is true.13 These characterizations have nothing to do with data or estimation, but theyre crucial
for developing a basic understanding of the properties of the models, which
is necessary to perform intelligent modeling. They enable us to make statements such as If the data were really generated by an autoregressive process,
then wed expect its autocorrelation function to have property x. Armed
with that knowledge, we use the sample autocorrelations and partial autocorrelations, in conjunction with the AIC and the SIC, to suggest candidate
models, which we then estimate.
The autoregressive process is a natural approximation to time-series dynamics. Its simply a stochastic difference equation, a simple mathematical
model in which the current value of a series is linearly related to its past
values, plus an additive stochastic shock. Stochastic difference equations are
a natural vehicle for discrete-time stochastic dynamic modeling.
The AR(1) Process
Sometimes, especially when characterizing population properties under the assumption that the models
are correct, we refer to them as processes, which is short for stochastic processes.
174
t W N (0, 2 ).
In lag operator form, we write
(1 L)yt = t.
In Figure *** we show simulated realizations of length 150 of two AR(1)
processes; the first is
yt = .4yt1 + t ,
and the second is
yt = .95yt1 + t ,
where in each case
t iidN (0, 1),
and the same innovation sequence underlies each realization. The fluctuations
in the AR(1) with parameter = .95 appear much more persistent that those
of the AR(1) with parameter = .4. Thus the AR(1) model is capable of
capturing highly persistent dynamics.
Certain conditions must be satisfied for an autoregressive process to be
covariance stationary. If we begin with the AR(1) process,
yt = yt1 + t ,
and substitute backward for lagged ys on the right side, we obtain
yt = t + t1 + 2 t2 + ...
In lag operator form we write
yt =
1
t .
1 L
; thus, || < 1 is the condition for covariance stationarity in the AR(1) case.
Equivalently, the condition for covariance stationarity is that the inverse of
the root of the autoregressive lag operator polynomial be less than one in
absolute value.
From the moving average representation of the covariance stationary AR(1)
process, we can compute the unconditional mean and variance,
E(yt ) = E(t + t1 + 2 t2 + ...)
= E(t ) + E(t1 ) + 2 E(t2 ) + ...
=0
and
var(yt ) = var(t + t1 + 2 t2 + ...)
= 2 + 2 2 + 4 2 + ...
= 2
2i
i=0
2
= 12 .
The conditional moments, in contrast, are
E(yt |yt1 ) = E(yt1 + t |yt1 )
= E(yt1 |yt1 ) + E(t |yt1 )
= yt1 + 0
= yt1
176
and
var(yt |yt1 ) = var((yt1 + t )|yt1 )
= 2 var(yt1 |yt1 ) + var(t |yt1 )
= 0 + 2
= 2.
Note in particular that the simple way that the conditional mean adapts to
the changing information set as the process evolves.
To find the autocovariances, we proceed as follows. The process is
yt = yt1 + t ,
so that multiplying both sides of the equation by yt we obtain
yt yt = yt1 yt + t yt .
For 1, taking expectations of both sides gives
( ) = ( 1).
This is called the Yule-Walker equation. It is a recursive equation; that is,
given ( ), for any , the Yule-Walker equation immediately tells us how to
get ( + 1). If we knew (0) to start things off (an initial condition), we
could use the Yule-Walker equation to determine the entire autocovariance
sequence. And we do know (0); its just the variance of the process, which
we already showed to be
2
(0) = 12 .
Thus we have
2
(0) = 12
(1) = 12
2
(2) = 2 12 ,
and so on. In general, then,
2
( ) = 12 , = 0, 1, 2, ....
Dividing through by (0) gives the autocorrelations,
( ) = , = 0, 1, 2, ....
Note the gradual autocorrelation decay, which is typical of autoregressive
processes. The autocorrelations approach zero, but only in the limit as the
displacement approaches infinity. In particular, they dont cut off to zero, as
is the case for moving average processes. If is positive, the autocorrelation
decay is one-sided. If is negative, the decay involves back-and-forth oscillations. The relevant case in business and economics is > 0, but either way,
the autocorrelations damp gradually, not abruptly. In Figure *** and ***
we show the autocorrelation functions for AR(1) processes with parameters
= .4 and = .95. The persistence is much stronger when = .95.
Finally, the partial autocorrelation function for the AR(1) process cuts off
abruptly; specifically,
, = 1
p( ) =
.
0, > 1.
Its easy to see why. The partial autocorrelations are just the last coefficients in a sequence of successively longer population autoregressions. If the
true process is in fact an AR(1), the first partial autocorrelation is just the
autoregressive coefficient, and coefficients on all longer lags are zero.
In Figures *** and *** we show the partial autocorrelation functions for
our two AR(1) processes. At displacement 1, the partial autocorrelations are
178
simply the parameters of the process (.4 and .95, respectively), and at longer
displacements, the partial autocorrelations are zero.
2
12 ,
|| < 1
11.4.3
1
t.
(L)
The autocorrelation function for the general AR(p) process, as with that of
the AR(1) process, decays gradually with displacement. Finally, the AR(p)
partial autocorrelation function has a sharp cutoff at displacement p, for
the same reason that the AR(1) partial autocorrelation function has a sharp
cutoff at displacement 1.
Lets discuss the AR(p) autocorrelation function in a bit greater depth.
The key insight is that, in spite of the fact that its qualitative behavior
(gradual damping) matches that of the AR(1) autocorrelation function, it
Pp
A necessary condition for covariance stationarity, which is often useful as a quick check, is i=1 i < 1.
If the condition is satisfied, the process may or may not be stationary, but if the condition is violated, the
process cant be stationary.
14
180
1
1 2
Using this formula, we can evaluate the autocorrelation function for the
process at hand; we plot it in Figure ***. Because the roots are complex,
the autocorrelation function oscillates, and because the roots are close to the
unit circle, the oscillation damps slowly.
Finally, lets step back once again to consider in greater detail the precise
way that finite-order autoregressive processes approximate the Wold repre15
1
t .
1 L
1
1L ,
a rational polyno-
1
t .
(L)
182
(L)t = vt
vt W N (0, 2 ).
We can estimate each model in identical fashion using nonlinear least
squares. Eviews and other packages proceed in precisely that way.16
This framework regression on a constant with serially correlated disturbances has a number of attractive features. First, the mean of the process
is the regression constant term.17 Second, it leads us naturally toward regression on more than just a constant, as other right-hand side variables can be
added as desired.
*************
Non-Zero Mean I (AR(1) Example): Regression on an Intercept and yt1 ,With
White Noise Disturbances
(yt ) = (yt1 ) + t
t iidN (0, 2 ), || < 1
= yt = c + yt1 + t , where c = (1 )
Back-substitution reveals that:
yt = +
j tj
j=0
= E(yt ) =
Non-Zero Mean II (AR(1) Example, Contd): Regression on an Intercept
Alone, with AR(1) Disturbances
16
Thats why, for example, information on the number of iterations required for convergence is presented
even for estimation of the autoregressive model.
17
Hence the notation for the intercept.
183
y t = + t
t = t1 + vt
vt iidN (0, 2 ), || < 1
11.5
184
11.6.
NOTES
185
11.6
Notes
186
11.6.
NOTES
187
188
11.6.
NOTES
189
190
11.6.
NOTES
191
192
11.6.
NOTES
193
194
11.6.
NOTES
195
196
11.6.
NOTES
197
198
11.6.
NOTES
199
200
Chapter 12
Serial Correlation in Time Series
Regression
Recall the full ideal conditions.
Here we deal with violation of the assumption that ***
Consider:
N (0, )
The FIC case is = 2 I. When is 6= 2 I?
Weve already seen heteroskedasticity.
Now we consider serial correlation or autocorrelation.
t is correlated with t
Can arise for many reasons, but they all boil down to:
The included X variables fail to capture all the dynamics in y.
No additional explanation needed!
On with Heteroskedasticity vs. Serial Correlation
201
202
12 0 . . .
0 22 . . .
=
... ... . . .
0
..
.
2
0 . . . N
(1)
. . . (T 1)
2
(1)
.
.
.
(T
2)
=
..
..
.
.
.
.
.
.
.
.
(T 1) (T 2) . . .
2
Consequences of Serial Correlation
OLS inefficient (no longer BLUE),
in finite samples and asymptotically
Standard errors biased and inconsistent. Hence t ratios do not have the t
distribution in finite samples and do not have the N (0, 1) distribution
asymptotically
Does this sound familiar?
Detection
Graphical autocorrelation diagnostics
Residual plot
203
Scatterplot of et against et
12.1
If a model has extracted all the systematic information from the data,
then whats left the residual should be iid random noise. Hence the
usefulness of various residual-based tests of the hypothesis that regression disturbances are white noise.
Formal autocorrelation tests and analyses
Durbin-Watson
Breusch-Godfrey
Residual correlogram
Liquor Sales Regression on Trend and Seasonals
Graphical Diagnostics - Residual Plot
Graphical Diagnostics - Scatterplot of et against et1
12.1.1
204
205
vt iid N (0, 2 )
We want to test H0 : = 0 against H1 : 6= 0
Regress y X and obtain the residuals et
PT
DW =
2
t=2 (et et1 )
PT 2
t=1 et
PT
2
t=2 (et et1 )
=
PT 2
e
t=1 t
DW =
1
T
PT
2
t=2 et +
1
T
1
T
PT
2
t=2 (et et1 )
PT 2
1
t=1 et
T
PT
2
t=2 et1 2
PT 2
1
t=1 et
T
1
T
PT
t=2 et et1
Hence as T :
2 + 2 2cov(et , et1 )
DW
= 2(1 corr(et , et1 ))
|
{z
}
2
e (1)
206
Following standard, if not strictly appropriate, practice, in this book we often report and examine the
Durbin-Watson statistic even when lagged dependent variables are included. We always supplement the
Durbin-Watson statistic, however, with other diagnostics such as the residual correlogram, which remain
valid in the presence of lagged dependent variables, and which almost always produce the same inference as
the Durbin-Watson statistic.
207
12.1.3
208
209
cov(e
c t , et )
e ( ) =
=
vd
ar(et )
1
T
P
t et et
P
1
2
t et
T
QBP = T
m
X
=1
QLB = T (T + 2)
m
X
=1
1
T
2e ( ) 2mK
12.2
2
T
210
211
Infeasible GLS
(Illustrated in the Durbin-Watson AR(1) Environment)
yt = x0t + t (1a)
t = t1 + vt (1b)
vt iid N (0, 2 ) (1c)
Suppose that you know . Then you could form:
yt1 = x0t1 + t1 (1a)
= (yt yt1 ) = (x0t x0t1 ) + (t t1 ) (just (1a) (1a))
= yt = yt1 + x0t x0t1 () + vt
Satisfies the classical conditions! Note the restriction.
12.2.2
212
213
214
215
Well model monthly U.S. liquor sales. We graphed a short span of the series
in Chapter *** and noted its pronounced seasonality sales skyrocket during
the Christmas season. In Figure ***, we show a longer history of liquor sales,
1968.01 - 1993.12. In Figure *** we show log liquor sales; we take logs to
216
stabilize the variance, which grows over time.2 The variance of log liquor
sales is more stable, and its the series for which well build models.3
Liquor sales dynamics also feature prominent trend and cyclical effects.
Liquor sales trend upward, and the trend appears nonlinear in spite of the
fact that were working in logs. To handle the nonlinear trend, we adopt a
quadratic trend model (in logs). The estimation results are in Table 1. The
residual plot (Figure ***) shows that the fitted trend increases at a decreasing
rate; both the linear and quadratic terms are highly significant. The adjusted
R2 is 89%, reflecting the fact that trend is responsible for a large part of the
variation in liquor sales. The standard error of the regression is .125; its
an estimate of the standard deviation of the error wed expect to make in
forecasting liquor sales if we accounted for trend but ignored seasonality and
serial correlation. The Durbin-Watson statistic provides no evidence against
the hypothesis that the regression disturbance is white noise.
The residual plot, however, shows obvious residual seasonality. The DurbinWatson statistic missed it, evidently because its not designed to have power
against seasonal dynamics.4 The residual plot also suggests that there may be
a cycle in the residual, although its hard to tell (hard for the Durbin-Watson
statistic as well), because the pervasive seasonality swamps the picture and
makes it hard to infer much of anything.
The residual correlogram (Table 2) and its graph (Figure ***) confirm the
importance of the neglected seasonality. The residual sample autocorrelation
function has large spikes, far exceeding the Bartlett bands, at the seasonal
displacements, 12, 24, and 36. It indicates some cyclical dynamics as well;
apart from the seasonal spikes, the residual sample autocorrelation and par2
The nature of the logarithmic transformation is such that it compresses an increasing variance. Make
a graph of log(x) as a function of x, and youll see why.
3
From this point onward, for brevity well simply refer to liquor sales, but remember that weve taken
logs.
4
Recall that the Durbin-Watson test is designed to detect simple AR(1) dynamics. It also has the ability
to detect other sorts of dynamics, but evidently not those relevant to the present application, which are very
different from a simple AR(1).
217
tial autocorrelation functions oscillate, and the Ljung-Box statistic rejects the
white noise null hypothesis even at very small, non-seasonal, displacements.
In Table 3 we show the results of regression on quadratic trend and a full set
of seasonal dummies. The quadratic trend remains highly significant. The
adjusted R2 rises to 99%, and the standard error of the regression falls to
.046, which is an estimate of the standard deviation of the forecast error we
expect to make if we account for trend and seasonality but ignore serial correlation. The Durbin-Watson statistic, however, has greater ability to detect
serial correlation now that the residual seasonality has been accounted for,
and it sounds a loud alarm.
The residual plot of Figure *** shows no seasonality, as thats now picked
up by the model, but it confirms the Durbin-Watsons warning of serial correlation. The residuals are highly persistent, and hence predictable. We
show the residual correlogram in tabular and graphical form in Table ***
and Figure ***. The residual sample autocorrelations oscillate and decay
slowly, and they exceed the Bartlett standard errors throughout. The LjungBox test strongly rejects the white noise null at all displacements. Finally,
the residual sample partial autocorrelations cut off at displacement 3. All
of this suggests that an AR(3) would provide a good approximation to the
disturbances Wold representation.
In Table 5, then, we report the results of estimating a liquor sales model
with quadratic trend, seasonal dummies, and AR(3) disturbances. The R2
is now 100%, and the Durbin-Watson is fine. One inverse root of the AR(3)
disturbance process is estimated to be real and close to the unit circle (.95),
and the other two inverse roots are a complex conjugate pair farther from
the unit circle. The standard error of this regression is an estimate of the
standard deviation of the forecast error wed expect to make after modeling
the residual serial correlation, as weve now done; that is, its an estimate
218
of the standard deviation of v.5 Its a very small .027, roughly half that
obtained when we ignored serial correlation.
We show the residual plot in Figure *** and the residual correlogram in
Table *** and Figure ***. The residual plot reveals no patterns; instead, the
residuals look like white noise, as they should. The residual sample autocorrelations and partial autocorrelations display no patterns and are mostly
inside the Bartlett bands. The Ljung-Box statistics also look good for small
and moderate displacements, although their p-values decrease for longer displacements.
All things considered, the quadratic trend, seasonal dummy, AR(3) specification seems tentatively adequate. We also perform a number of additional
checks. In Figure ***, we show a histogram and normality test applied to the
residuals. The histogram looks symmetric, as confirmed by the skewness near
zero. The residual kurtosis is a bit higher then three and causes Jarque-Bera
test to reject the normality hypothesis with a p-value of .02, but the residuals
nevertheless appear to be fairly well approximated by a normal distribution,
even if they may have slightly fatter tails.
12.3
Recall that v is the innovation that drives the AR process for the regression disturbance, .
219
a. Display the AIC and SIC for a variety of specifications of trend and
seasonality. Which would you select using the AIC? SIC? Do the AIC
and SIC select the same model? If not, which do you prefer?
b. Discuss the estimation results and residual plot from your preferred
model, and perform a correlogram analysis of the residuals. Discuss,
in particular, the patterns of the sample autocorrelations and partial
autocorrelations, and their statistical significance.
c. How, if at all, are your results different from those reported in the
text? Are the differences important? Why or why not?
3. (Diagnostic checking of model residuals)
The Durbin-Watson test is invalid in the presence of lagged dependent
variables. Breusch-Godfrey remains valid.
a. Durbins h test is an alternative to the Durbin-Watson test. As
with the Durbin-Watson test, its designed to detect first-order serial
correlation, but its valid in the presence of lagged dependent variables. Do some background reading as well on Durbins h test and
report what you learned.
b. Which do you think is likely to be most useful to you in assessing the
properties of residuals from time-series models: the residual correlogram, Durbins h test, or the Breusch-Godfrey test? Why?
4. (Assessing the adequacy of the liquor sales model trend specification)
Critique the liquor sales model that we adopted (log liquor sales with
quadratic trend, seasonal dummies, and AR(3) disturbances).
a. If the trend is not a good approximation to the actual trend in the
series, would it greatly affect short-run forecasts? Long-run forecasts?
b. Fit and assess the adequacy of a model with log-linear trend.
220
c. How might you fit and assess the adequacy of a broken linear trend?
How might you decide on the location of the break point?
d. Recall our assertion that best practice requires using a 2mk distribution rather than a 2m distribution to assess the significance of
Q-statistics for model residuals, where m is the number of autocorrelations included in the Box-Pierce statistic and k is the number of
parameters estimated. In several places in this chapter, we failed to
heed this advice when evaluating the liquor sales model. If we were
instead to compare the residual Q-statistic p-values to a 2mk distribution, how, if at all, would our assessment of the models adequacy
change?
e. Return to the log-quadratic trend model with seasonal dummies, allow
for AR(p) disturbances, and do a systematic selection of p and q using
the AIC and SIC. Do AIC and SIC select the same model? If not,
which do you prefer? If your preferred model differs from the AR(3)
that we used, replicate the analysis in the text using your preferred
model, and discuss your results.
5. Fixed X and lagged dependent variables.
In section 5.1 we claimed that its logically impossible to maintain the
assumption of fixed X in the presence of a lagged dependent variable.
Why?
12.4
Notes
The idea that regression models with serially correlated disturbances are more
restrictive than other sorts of transfer function models has a long history
in econometrics and engineering and is highlighted in a memorably-titled
paper, Serial Correlation as a Convenient Simplification, not a Nuisance,
by Hendry and Mizon (1978)***.
Chapter 13
Heteroskedasticity in Time Series
Recall the full ideal conditions.
The celebrated Wold decomposition makes clear that every covariance
stationary series may be viewed as ultimately driven by underlying weak
white noise innovations. Hence it is no surprise that every model discussed
in this book is driven by underlying white noise. To take a simple example, if
the series yt follows an AR(1) process, then yt = yt1 + t , where t is white
noise. In some situations it is inconsequential whether t is weak or strong
white noise, that is, whether t is independent, as opposed to merely serially
uncorrelated. Hence, to simplify matters we sometimes assume strong white
noise, t iid(0, 2 ). Throughout this book, we have thus far taken that
approach, sometimes explicitly and sometimes implicitly.
When t is independent, there is no distinction between the unconditional
distribution of t and the distribution of t conditional upon its past, by definition of independence. Hence 2 is both the unconditional and conditional
variance of t . The Wold decomposition, however, does not require that t be
serially independent; rather it requires only that t be serially uncorrelated.
If t is dependent, then its unconditional and conditional distributions will
differ. We denote the unconditional innovation distribution by t (0, 2 ).
We are particularly interested in conditional dynamics characterized by heteroskedasticity, or time-varying volatility. Hence we denote the conditional
221
222
13.1
bi Li
i=0
b2i <
i=0
1
In principle, aspects of the conditional distribution other than the variance, such as conditional skewness,
could also fluctuate. Conditional variance fluctuations are by far the most important in practice, however,
so we assume that fluctuations in the conditional distribution of are due exclusively to fluctuations in t2 .
223
b0 = 1
t W N (0, 2 ).
We will work with various cases of this process.
Suppose first that t is strong white noise, t iid(0, 2 ). Let us review
some results already discussed for the general linear process, which will prove
useful in what follows. The unconditional mean and variance of y are
E(yt ) = 0
and
E(yt2 )
b2i ,
i=0
which are both time-invariant, as must be the case under covariance stationarity. However, the conditional mean of y is time-varying:
E(yt |t1 ) =
bi ti ,
i=1
224
bh+i ti ,
i=0
yt+h E(yt+h |t ) =
h1
X
bi t+hi ,
i=0
E (yt+h E(yt+h |t )) |t =
h1
X
b2i .
i=0
The conditional prediction error variance is different from the unconditional variance, but it is not time-varying: it depends only on h, not on the
conditioning information t . In the process as presently specified, the conditional variance is not allowed to adapt to readily available and potentially
useful conditioning information.
So much for the general linear process with iid innovations. Now we extend
it by allowing t to be weak rather than strong white noise, with a particular
nonlinear dependence structure. In particular, suppose that, as before,
yt = B(L)t
B(L) =
bi Li
i=0
b2i <
i=0
b0 = 1,
225
p
X
i Li i 0f oralli
i < 1.
i=1
Note that we parameterize the innovation process in terms of its conditional density,
t |t1 ,
which we assume to be normal with a zero conditional mean and a conditional variance that depends linearly on p past squared innovations. t is
serially uncorrelated but not serially independent, because the current conditional variance t2 depends on the history of t .2 The stated regularity
conditions are sufficient to ensure that the conditional and unconditional
variances are positive and finite, and that yt is covariance stationary.
The unconditional moments of t are constant and are given by
E(t ) = 0
and
E(t E(t ))2 =
The important result is not the particular formulae for the unconditional
mean and variance, but the fact that they are fixed, as required for covariance
stationarity. As for the conditional moments of t , its conditional variance
2
226
is time-varying,
E (t E(t |t1 ))2 |t1 = + (L)2t ,
and of course its conditional mean is zero by construction.
Assembling the results to move to the unconditional and conditional moments of y as opposed to t , it is easy to see that both the unconditional mean
and variance of y are constant (again, as required by covariance stationarity),
but that both the conditional mean and variance are time-varying:
E(yt |t1 ) =
bi ti
i=1
E (yt E(yt |t1 ))2 |t1 = + (L)2t .
Thus, we now treat conditional mean and variance dynamics in a symmetric fashion by allowing for movement in each, as determined by the evolving
information set t1 . In the above development, t is called an ARCH(p)
process, and the full model sketched is an infinite-ordered moving average
with ARCH(p) innovations, where ARCH stands for autoregressive conditional heteroskedasticity. Clearly t is conditionally heteroskedastic, because
its conditional variance fluctuates. There are many models of conditional
heteroskedasticity, but most are designed for cross-sectional contexts, such
as when the variance of a cross-sectional regression disturbance depends on
one or more of the regressors.3 However, heteroskedasticity is often present as
well in the time-series contexts relevant for forecasting, particularly in financial markets. The particular conditional variance function associated with
the ARCH process,
t2 = + (L)2t ,
3
The variance of the disturbance in a model of household expenditure, for example, may depend on
income.
227
is tailor-made for time-series environments, in which one often sees volatility clustering, such that large changes tend to be followed by large changes,
and small by small, of either sign. That is, one may see persistence, or serial
correlation, in volatility dynamics (conditional variance dynamics), quite
apart from persistence (or lack thereof) in conditional mean dynamics. The
ARCH process approximates volatility dynamics in an autoregressive fashion;
hence the name autoregressiveconditional heteroskedasticity. To understand
why, note that the ARCH conditional variance function links todays conditional variance positively to earlier lagged 2t s, so that large 2t s in the
recent past produce a large conditional variance today, thereby increasing
the likelihood of a large 2t today. Hence ARCH processes are to conditional
variance dynamics precisely as standard autoregressive processes are to conditional mean dynamics. The ARCH process may be viewed as a model for
the disturbance in a broader model, as was the case when we introduced it
above as a model for the innovation in a general linear process. Alternatively,
if there are no conditional mean dynamics of interest, the ARCH process may
be used for an observed series. It turns out that financial asset returns often
have negligible conditional mean dynamics but strong conditional variance
dynamics; hence in much of what follows we will view the ARCH process as
a model for an observed series, which for convenience we will sometimes call
a return.
13.2
228
p
X
i Li , (L) =
i=1
q
X
i Li
i=1
> 0, i 0, i 0,
i +
i < 1.
The stated conditions ensure that the conditional variance is positive and
that yt is covariance stationary.
Back substitution on t2 reveals that the GARCH(p,q) process can be
represented as a restricted infinite-ordered ARCH process,
t2
X
(L) 2
P
i 2ti ,
+
t =
+
i 1 (L)
1 i i=1
which precisely parallels writing an ARMA process as a restricted infiniteordered AR. Hence the GARCH(p,q) process is a parsimonious approximation
to what may truly be infinite-ordered ARCH volatility dynamics.
It is important to note a number of special cases of the GARCH(p,q)
process. First, of course, the ARCH(p) process emerges when
(L) = 0.
Second, if both (L) and (L) are zero, then the process is simply iid Gaussian noise with variance . Hence, although ARCH and GARCH processes
may at first appear unfamiliar and potentially ad hoc, they are in fact much
more general than standard iid white noise, which emerges as a potentially
4
By pure we mean that we have allowed only for conditional variance dynamics, by setting yt = t . We
could of course also introduce conditional mean dynamics, but doing so would only clutter the discussion
while adding nothing new.
229
P ,
i i
230
231
.
1 (1) (1)
For finite h, the dependence of the prediction error variance on the current
information set t can be exploited to improve interval and density forecasts.
Fourth, consider the relationship between 2t and t2 . The relationship is
important: GARCH dynamics in t2 turn out to introduce ARMA dynamics
in 2t .5 More precisely, if t is a GARCH(p,q) process, then
2t
has the ARMA representation
2t = + ((L) + (L))2t (L)t + t ,
where
t = 2t t2
is the difference between the squared innovation and the conditional variance
at time t. To see this, note that if t is GARCH(p,q), then
t2 = + (L)2t + (L)t2 .
Adding and subtracting
(L)2t
5
Put differently, the GARCH process approximates conditional variance dynamics in the same way that
an ARMA process approximates conditional mean dynamics.
232
233
wj 2tj ,
where
wj = (1 )j .
Now compare this result to the GARCH(1,1) model, which gives the current volatility as a linear combination of lagged volatility and the lagged
2
squared return, t2 = + 2t1 + t1
.
234
normality under temporal aggregation is a feature of real-world financial asset returns. That is, although high-frequency (e.g., daily) returns tend to
be fat-tailed relative to the normal, the fat tails tend to get thinner under
temporal aggregation, and normality is approached. Convergence to normality under temporal aggregation is also a property of covariance stationary
GARCH processes. The key insight is that a low-frequency change is simply
the sum of the corresponding high-frequency changes; for example, an annual
change is the sum of the internal quarterly changes, each of which is the sum
of its internal monthly changes, and so on. Thus, if a Gaussian central limit
theorem can be invoked for sums of GARCH processes, convergence to normality under temporal aggregation is assured. Such theorems can be invoked
if the process is covariance stationary.
In closing this section, it is worth noting that the symmetry and leptokurtosis of the unconditional distribution of the GARCH process, as well as the
disappearance of the leptokurtosis under temporal aggregation, provide nice
independent confirmation of the accuracy of GARCH approximations to asset return volatility dynamics, insofar as GARCH was certainly not invented
with the intent of explaining those features of financial asset return data.
On the contrary, the unconditional distributional results emerged as unanticipated byproducts of allowing for conditional variance dynamics, thereby
providing a unified explanation of phenomena that were previously believed
unrelated.
13.3
There are numerous extensions of the basic GARCH model. In this section,
we highlight several of the most important. One important class of extensions
allows for asymmetric response; that is, it allows for last periods squared
235
Asymmetric Response
The simplest GARCH model allowing for asymmetric response is the threshold GARCH, or TGARCH, model.7 We replace the standard GARCH con-
2
ditional variance function, t2 = + 2t1 + t1
, with t2 = + 2t1 + 2t1 Dt1 +
1, if t < 0
where Dt =
.
0otherwise.
The dummy variable D keeps track of whether the lagged return is posi-
tive or negative. When the lagged return is positive (good news yesterday),
D=0, so the effect of the lagged squared return on the current conditional
variance is simply . In contrast, when the lagged return is negative (bad
news yesterday), D=1, so the effect of the lagged squared return on the current conditional variance is +. If =0, the response is symmetric and we
have a standard GARCH model, but if 6=0 we have asymmetric response
of volatility to news. Allowance for asymmetric response has proved useful for modeling leverage effects in stock returns, which occur when <0.8
Asymmetric response may also be introduced via the exponential GARCH
(EGARCH) model,
ln(t2 )
2
).
= + t1 + t1 + ln(t1
t1
t1
Note that volatility is driven by both size and sign of shocks; hence the model
allows for an asymmetric response depending on the sign of news.9 The
6
In the GARCH model studied thus far, only the square of last periods return affects the current conditional variance; hence its sign is irrelevant.
7
For expositional convenience, we will introduce all GARCH extensions in the context of GARCH(1,1),
which is by far the most important case for practical applications. Extensions to the GARCH(p,q) case are
immediate but notationally cumbersome.
8
Negative shocks appear to contribute more to stock market volatility than do positive shocks. This is
called the leverage effect, because a negative shock to the market value of equity increases the aggregate
debt/equity ratio (other things the same), thereby increasing leverage.
9
The absolute size of news is captured by |rt1 /t1 | , and the sign is captured by rt1 /t1 .
236
Just as ARMA models may be viewed as models for disturbances in regressions, so too may GARCH models. We write
yt = 0 + 1 xt + t
t |t1 N (0, t2 )
2
t2 = + 2t1 + t1
. Consider now a regression model with GARCH
disturbances of the usual sort, with one additional twist: the conditional
variance enters as a regressor, thereby affecting the conditional mean. We
10
237
write
yt = 0 + 1 xt + t2 + t
t |t1 N (0, t2 )
2
t2 = + 2t1 + t1
. This model, which is a special case of the gen-
Component GARCH
) +
) = (2t1
Note that the standard GARCH(1,1) process may be written as (t2
where
=
One may also allow the conditional standard deviation, rather than the conditional variance, to enter
the regression.
12
is sometimes called the long-run variance, referring to the fact that the unconditional variance is
the long-run average of the conditional variance.
13
It turns out, moreover, that under suitable conditions the component GARCH model introduced here is
covariance stationary, and equivalent to a GARCH(2,2) process subject to certain nonlinear restrictions on
its parameters.
238
13.3.5
In closing this section, we note that the different variations and extensions of
the GARCH process may of course be mixed. As an example, consider the fol-
lowing conditional variance function: (t2 qt ) = (2t1 qt1 ) + (2t1 qt1 )Dt1 + (
This is a component GARCH specification, generalized to allow for asymmetric response of volatility to news via the sign dummy D, as well as effects from
the exogenous variable x.
13.4
Recall that the likelihood function is the joint density function of the data,
viewed as a function of the model parameters, and that maximum likelihood
estimation finds the parameter values that maximize the likelihood function.
This makes good sense: we choose those parameter values that maximize
the likelihood of obtaining the data that were actually obtained. It turns
out that construction and evaluation of the likelihood function is easily done
for GARCH models, and maximum likelihood has emerged as the estimation
method of choice.14 No closed-form expression exists for the GARCH maximum likelihood estimator, so we must maximize the likelihood numerically.15
Construction of optimal forecasts of GARCH processes is simple. In fact,
we derived the key formula earlier but did not comment extensively on it.
Recall, in particular, that
2
t+h,t
h1
X
2
= E t+h |t =
[(1) + (1)]i
!
2
+ [(1) + (1)]h1 t+1
.
i=1
14
The precise form of the likelihood is complicated, and we will not give an explicit expression here, but
it may be found in various of the surveys mentioned in the Notes at the end of the chapter.
15
Routines for maximizing the GARCH likelihood are available in a number of modern software packages
such as Eviews. As with any numerical optimization, care must be taken with startup values and convergence
criteria to help insure convergence to a global, as opposed to merely local, maximum.
239
the obvious way. In financial applications, volatility forecasts are often of direct interest, and the GARCH model delivers the optimal h-step-ahead point
2
. Alternatively, and more generally, we might not be intrinforecast, t+h,t
240
related, how to assess the adequacy of a fitted GARCH model. A key and
simple device is the correlogram of squared returns, 2t . As discussed earlier,
2t is a proxy for the latent conditional variance; if the conditional variance
displays persistence, so too will 2t .16 Once can of course also fit a GARCH
model, and assess significance of the GARCH coefficients in the usual way.
Note that we can write the GARCH process for returns as t = t vt ,
2
where vt iidN (0, 1), t2 = + 2t1 + t1
. Equivalently, the standard-
13.5
We model and forecast the volatility of daily returns on *** from *** through
***, excluding holidays, for a total of *** observations. We estimate using
observations ***, and then we forecast observations ***.
In Figure *** we plot the daily returns, rt . There is no visual evidence
of serial correlation in the returns, but there is evidence of serial correlation in the amplitude of the returns. That is, volatility appears to cluster:
large changes tend to be followed by large changes, and small by small, of
either sign. In Figure *** we show the histogram and related statistics for
rt . The mean daily return is slightly positive. Moreover, the returns are
approximately symmetric (only slightly left skewed) but highly leptokurtic.
16
Note well, however, that the converse is not true. That is, if 2t displays persistence, it does not necessarily
follow that the conditional variance displays persistence. In particular, neglected serial correlation associated
with conditional mean dynamics may cause serial correlation in t and hence also in 2t . Thus, before
proceeding to examine and interpret the correlogram of 2t as a check for volatility dynamics, it is important
that any conditional mean effects be appropriately modeled, in which case t should be interpreted as the
disturbance in an appropriate conditional mean model.
241
In the Exercises, Problems and Complements at the end of this chapter we model the conditional mean,
as well as the conditional variance, of returns.
18
In the Exercises, Problems and Complements at the end of this chapter we also examine ARCH(p)
models with p > 5.
242
For comparability with the earlier-computed GARCH estimated conditional standard deviation, we
actually show the square root of exponentially smoothed rt2 .
243
244
245
246
Hedging
Trading
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:
t =
ln(S/K) + (r + 2 /2)
d2 =
ln(S/K) + (r 2 /2)
247
PC = BS(, ...)
(Standard Black-Scholes options pricing)
Completely different when varies!
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.
Linear Models (e.g., AR(1))
rt = rt1 + t
t iid(0, 2 ), || < 1
Uncond. mean: E(rt ) = 0 (constant)
Uncond. variance: E(rt2 ) = 2 /(1 2 ) (constant)
Cond. mean: E(rt | t1 ) = rt1 (varies)
248
E(rt ) = 0
E(rt 2 ) =
(1 )
E(rt |t1 ) = 0
2
E([rt E(rt |t1 )]2 |t1 ) = + rt1
rt | t1 N (0, ht )
2
ht = + rt1
+ ht1
E(rt ) = 0
E(rt 2 ) =
(1 )
E(rt |t1 ) = 0
2
E([rt E(rt | t1 )]2 | t1 ) = + rt1
+ ht1
249
t2 =
t1
+ (1 )rt2
t2
= (1 )
2
j rtj
2
+
j1 rtj
ht =
1
Unified Theoretical Framework
Volatility dynamics (of course, by construction)
Volatility clustering produces unconditional leptokurtosis
Temporal aggregation reduces the leptokurtosis
Tractable Empirical Framework
250
so
ln L = const
1 X rt2
1X
ln ht ()
2 t
2 t ht ()
2
ht = + rt1
+ ht1 + zt
251
So take:
p
rt = ht
td
std(td )
yt = x0t + t
t |t1 N (0, ht )
Time-Varying Risk Premia: GARCH-M
Standard GARCH regression model:
yt = x0t + t
252
t |t1 N (0, ht )
GARCH-M model is a special case:
yt = x0t + ht + t
t |t1 N (0, ht )
Back to Empirical Work Standard GARCH(1,1)
GARCH(1,1)
GARCH(1,1)
GARCH(1,1)
GARCH(1,1)
A Useful Specification Diagnostic
rt |t1 N (0, ht )
rt =
ht t , t iidN (0, 1)
253
254
Figure 13.8: Conditional Standard Deviation, History and Forecast, Daily NYSE Returns.
255
r
t = t , t iidN (0, 1)
ht
Infeasible: examine t . iid? Gaussian?
p
t . iid? Gaussian?
Feasible: examine t = rt / h
Key deviation from iid is volatility dynamics. So examine correlogram of
squared standardized returns, 2t
GARCH(1,1)
Fancy GARCH(1,1)
Fancy GARCH(1,1)
13.6
256
simple univariate plot, even when there are many right-hand side variables. Such plots feature prominently, for example, in tracking and
forecasting time-varying volatility.
2. (Removing conditional mean dynamics before modeling volatility dynamics)
In the application in the text we noted that NYSE stock returns appeared to have some weak conditional mean dynamics, yet we ignored
them and proceeded directly to model volatility.
a. Instead, first fit autoregressive models using the SIC to guide order
selection, and then fit GARCH models to the residuals. Redo the
entire empirical analysis reported in the text in this way, and discuss
any important differences in the results.
b. Consider instead the simultaneous estimation of all parameters of
AR(p)-GARCH models. That is, estimate regression models where
the regressors are lagged dependent variables and the disturbances
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)
C
R(-1)
0.083360
1.28E-05
0.073763
0.053138
0.000372
0.017611
1.568753
0.034443
4.188535
0.1167
0.9725
0.0000
Variance Equation
C
RESID(-1)^2
RESID(-1)^2*(RESID(1)<0)
GARCH(-1)
1.03E-06
0.014945
2.23E-07
0.009765
4.628790
1.530473
0.0000
0.1259
0.094014
0.922745
0.014945
0.009129
6.290700
101.0741
0.0000
0.0000
T-DIST. DOF
5.531579
0.478432
11.56188
0.0000
257
258
259
260
td
.
std(td )
t = t vt
What is the reason for dividing the Students t variable, td , by its
standard deviation, std(td ) ? How might such a model be estimated?
8. (Multivariate GARCH models)
In the multivariate case, such as when modeling a set of returns rather
than a single return, we need to model not only conditional variances,
but also conditional covariances.
a. Is the GARCH conditional variance specification introduced earlier,
2
say for the i th return, it2 = + 2i,t1 + i,t1
, still appealing in
13.7.
NOTES
261
b. Consider the following specification for the conditional covariance between i th and j-th returns: ij,t = + i,t1 j,t1 + ij,t1 . Is it
appealing? Why or why not?
c. Consider a fully general multivariate volatility model, in which every conditional variance and covariance may depend on lags of every
conditional variance and covariance, as well as lags of every squared
return and cross product of returns. What are the strengths and
weaknesses of such a model? Would it be useful for modeling, say, a
set of five hundred returns? If not, how might you proceed?
13.7
Notes
262
Part IV
More
263
Chapter 14
Binary Regression and Classification
14.1
Binary Regression
Binary Response
265
266
(
It (z) =
1 if event z occurs
0 otherwise.
(14.1)
That is, when the LHS variable is a 0-1 indicator variable, the model is effectively a model relating a conditional probability to the conditioning variables.
There are numerous events that fit the 0-1 paradigm. Leading examples
include recessions, bankruptcies, loan or credit card defaults, financial market
crises, and consumer choices.
But how should we fit a line when the LHS variable is binary? The
linear probability model does it by brute-force OLS regression It (z) xt .
There are several econometric problems associated with such regressions, but
the one of particular relevance is simply that the linear probability model fails
to constrain the fitted values of E(It (z)|xt ) = P (It (z) = 1|xt ) to lie in the unit
interval, in which probabilities must of course lie. We now consider models
that impose that constraint by running x0t through a monotone squashing
function, F (), that keeps P (It (z) = 1|xt ) in the unit interval. That is, we
move to models with
P (It (z) = 1|xt ) = F (x0t ),
where F () is monotone increasing, with limw F (w) = 1 and limw F (w) =
267
0. Many squashing functions can be entertained, and many have been entertained.
14.1.2
The most popular and useful squashing function for our purposes is the logistic function, which takes us to the so-called logit model. There are several
varieties and issues, to which we now turn.
Logit
ext
P (It (z) = 1|xt ) =
0 .
1 + e xt
At one level, theres little more to say; it really is that simple. The likelihood
function can be derived, and the model can be immediately estimated by
numerical maximization of the likelihood function.
But an alternative latent variable formulation yields deep and useful insights. In particular, consider a latent variable, yt , where
yt = x0t + t
t logistic(0, 1),
and let It (z) be It (yt > 0), or equivalently, It ( > x0t ). Interestingly, this
is the logit model. To see this, note that
E(It (yt > 0)|xt ) = P (yt > 0)|xt ) = P (t > x0t )
= P (t < x0t ) (by symmetry of the logistic density of )
268
ext
=
0 ,
1 + e xt
where the last equality holds because the logistic density has cdf is ew /(1+ew ).
This way of thinking about the logit DGP a continuously-evolving latent
variable yt with an observed indicator that turns on when yt > 0 is very
useful. For example, it helps us to think about consumer choice as a function of continuous underlying utility, business cycle regime as a function of
continuous underlying macroeconomic conditions, bond ratings as a function
of continuous underlying firm health, etc.
The latent-variable approach also leads to natural generalizations like ordered logit, to which we now turn.
Ordered Logit
269
0 if yt < c1
1 if c1 < yt < c2
It (yt ) =
2 if c2 < yt < c3
..
N if c < y .
N
Note that one or more of the x variables could be lagged dependent variables,
Iti (z), i = 1, 2, ...
Complications
In logit regression, both the marginal effects and the R2 are hard to determine
and/or interpret directly.
Marginal Effects
Logit marginal effects E(y|x)/xi are hard to determine directly; in particular, they are not simply given by the i s. Instead we have
E(y|x)
= f (x0 )i ,
xi
where f (x) = dF (x)/dx is the density corresponding the cdf f .1 So the
marginal effect is not simply i ; instead it is i weighted by f (x0 ), which
depends on all s and xs. However, signs of s are the signs of the effects,
1
In the leading logit case, f (x) would be the logistic density, given by ***.
270
R =1
1
lnL
,
R =1
0
lnL
2
Examples: Make loan or not, grant credit card or not, hire a worker or not,
will consumer buy or not
Classification maps probabilities into 0-1 forecasts. Bayes classifier uses
a cutoff of .5.
Decision boundary. Suppose we use a Bayes classifier.
271
We predict 1 when logit(x0 ) > 1/2. But thats the same as predicting
1 when x0 > 0. If there are 2 x variables (potentially plus an intercept),
then the condition x0 > 0 defines a line in R2 . Points on one side will be
classified as 0, and points on the other side will be classified as 1. That line
is the decision boundary.
We can also have non-linear decision boundaries. Suppose for example
that that x vector contains not only x1 and x2 , but also x21 and x22 . Now the
condition x0 > 0 defines a circle in R2 . Points inside will be classified as 0,
and points outside will be classified as 1. The circle is the decision boundary.
** Figures illustrating linear and non-linear decision boundaries
14.2
272
1
ext
P (It (z) = 1|xt ) =
=
0
0 .
1 + ext
1 + e xt
Hence the logit model is simply a linear regression model for log odds.
A full statement of the model is
yt Bern(pt )
pt
ln
1 pt
273
= x0t .
274
14.3
Notes
Chapter 15
Panel Data
We still work under the full ideal conditions, but we consider new aspects of
the regression model.
More use of dummy variables:
Cross-section dummies (individual effects)
Time-series dummies (time effects)
15.1
Panel Data
276
allowing for such individual and time effects is generally no problem. There
are N + T coefficients to be estimated (N individual effects and T time
effects), but we have N T observations!
In traditional panel situations, N >> T . In chapter ?? we deal with
a class of models called vector autoregressions, which also involve both
cross-section and time-series data, but for which T >> N .
15.2
15.2.1
Individual Effects
We write
yit = i + 2 xit + it .
Individual effects correspond to a different intercept (i ) for each person.
The estimation strategy, in principle, is to run
yit I(i = 1), I(i = 2), I(i = 3), ..., I(i = N ), xit .
Note that this regression is impossible in pure cross sections of size N , in
which case one could at best consider a middle ground in which individuals
are grouped into ui < N units. In the panel case the regression can be run
in principle, and it has the benefit of allowing one to examine the individual
effects (i s) and the common effect (2 ), but the cost of potentially significant
numerical/computational difficulty unless N is small. In panels of typical size,
the regression is infeasible.
How Really to do it
We eliminate the i by writing the model in deviations from means,
(yit yi ) = (i i ) + 2 (xit xi ) + (it i ) ,
where xi =
1
T
T
P
xit and i =
t=1
1
T
T
P
277
it . Because i is constant, i = i , so
t=1
We write
yit = i + t + 2 xit + it .
The estimation strategy, in principle, is to run
yit I(i = 1), I(i = 2), ..., I(i = N ), I(t = 1), I(t = 2), ..., I(t = T ), xit .
How Really to do it
15.3
15.4
Notes
Our panel effects are called fixed effects, for obvious reasons. We can also
entertain so-called random effects.
278
Chapter 16
Stochastic Regressors II: Endogeneity
Recall the full ideal conditions.
A host of complications can produce E(X 0 ) 6= 0.
In this chapter we confront those complications.
16.1
Causes of E(X 0) 6= 0
16.1.1
Omitted Variables
Simultaneity
279
280
16.1.3
Measurement Error
Sample Selection
16.2
Instrumental Variables
16.2.1
16.2.2
Nelson-Startz disease
Relevant but Slightly-Endogenous Instruments
16.2.3
Sources of Instruments
Randomized Experiments
281
Natural Experiments
Thought Experiments (Structural Econometric Models)
Require many assumptions. But if the assumptions are credible, they can be
used to assess the effects of a wide variety of treatments. Counterfactuals.
Time
16.3
16.3.1
16.3.2
Differences of Differences
16.3.3
Matching
16.4
Graphical Models
16.5
Even randomized experiments have issues. They reveal the treatment effect only for the precise experiment performed. Put differently, if done well,
they enjoy internal validity, but there is no guarantee of external validity.
Even slight differences in experiments can produce different results. For example, there can be large differences between open RCTs and doubleblind RCTs. See http://boringdevelopment.com/2014/04/09/a-torpedoaimed-straight-at-h-m-s-randomista/
282
16.6
16.7
Notes
Part V
Appendices
283
Appendix A
Probability and Statistics Review
Here we review a few aspects of probability and statistics that we will rely
upon at various times.
A.1
A.1.1
Univariate
A random
variable Y is simply a mapping from O to the real numbers. For example, the experiment might be flipping a coin twice, in which case O =
{(Heads, Heads), (T ails, T ails), (Heads, T ails), (T ails, Heads)}. We might
define a random variable Y to be the number of heads observed in the two
flips, in which case Y could assume three values, y = 0, y = 1 or y = 2.1
Discrete random variables, that is, random variables with discrete
probability distributions, can assume only a countable number of values
P
yi , i = 1, 2, ..., each with positive probability pi such that i pi = 1 . The
probability distribution f (y) assigns a probability pi to each such value yi .
In the example at hand, Y is a discrete random variable, and f (y) = 0.25 for
1
Note that, in principle, we use capitals for random variables (Y ) and small letters for their realizations
(y). We will often neglect this formalism, however, as the meaning will be clear from context.
285
286
pi y i .
Often we use the Greek letter to denote the mean, which measures the
location, or central tendency, of y.
The variance of y is its expected squared deviation from its mean,
var(y) = E(y )2 .
We use 2 to denote the variance, which measures the dispersion, or scale,
of y around its mean.
2
Often we assess dispersion using the square root of the variance, which is
called the standard deviation,
= std(y) =
p
E(y )2 .
The standard deviation is more easily interpreted than the variance, because
it has the same units of measurement as y. That is, if y is measured in dollars
(say), then so too is std(y). V ar(y), in contrast, would be measured in rather
hard-to-grasp units of dollars squared.
The skewness of y is its expected cubed deviation from its mean (scaled
by 3 for technical reasons),
E(y )3
S=
.
3
Skewness measures the amount of asymmetry in a distribution. The larger
the absolute size of the skewness, the more asymmetric is the distribution.
A large positive value indicates a long right tail, and a large negative value
indicates a long left tail. A zero value indicates symmetry around the mean.
The kurtosis of y is the expected fourth power of the deviation of y from
its mean (scaled by 4 , again for technical reasons),
E(y )4
K=
.
4
Kurtosis measures the thickness of the tails of a distribution. A kurtosis
above three indicates fat tails or leptokurtosis, relative to the normal,
or Gaussian distribution that you studied earlier. Hence a kurtosis above
three indicates that extreme events (tail events) are more likely to occur
than would be the case under normality.
288
A.1.2
Multivariate
Suppose now that instead of a single random variable Y , we have two random
variables Y and X.5 We can examine the distributions of Y or X in isolation,
which are called marginal distributions. This is effectively what weve
already studied. But now theres more: Y and X may be related and therefore
move together in various ways, characterization of which requires a joint
distribution. In the discrete case the joint distribution f (y, x) gives the
probability associated with each possible pair of y and x values, and in the
continuous case the joint density f (y, x) is such that the area in any region
under it gives the probability of (y, x) falling in that region.
We can examine the moments of y or x in isolation, such as mean, variance,
skewness and kurtosis. But again, now theres more: to help assess the
dependence between y and x, we often examine a key moment of relevance
in multivariate environments, the covariance. The covariance between y
and x is simply the expected product of the deviations of y and x from their
respective means,
cov(y, x) = E[(yt y )(xt x )].
A positive covariance means that y and x are positively related; that is, when
y is above its mean x tends to be above its mean, and when y is below its
mean x tends to be below its mean. Conversely, a negative covariance means
that y and x are inversely related; that is, when y is below its mean x tends
to be above its mean, and vice versa. The covariance can take any value in
the real numbers.
Frequently we convert the covariance to a correlation by standardizing
5
We could of course consider more than two variables, but for pedagogical reasons we presently limit
ourselves to two.
289
cov(y, x)
.
y x
The correlation takes values in [-1, 1]. Note that covariance depends on units
of measurement (e.g., dollars, cents, billions of dollars), but correlation does
not. Hence correlation is more immediately interpretable, which is the reason
for its popularity.
Note also that covariance and correlation measure only linear dependence;
in particular, a zero covariance or correlation between y and x does not necessarily imply that y and x are independent. That is, they may be non-linearly
related. If, however, two random variables are jointly normally distributed
with zero covariance, then they are independent.
Our multivariate discussion has focused on the joint distribution f (y, x).
In various chapters we will also make heavy use of the conditional distribution f (y|x), that is, the distribution of the random variable Y conditional
upon X = x. Conditional moments are similarly important. In particular, the conditional mean and conditional variance play key roles in
econometrics, in which attention often centers on the mean or variance of a
series conditional upon the past.
A.2
A.2.1
290
and we want to learn from the sample about various aspects of f , such as
its moments. To do so we use various estimators.6 We can obtain estimators by replacing population expectations with sample averages, because the
arithmetic average is the sample analog of the population expectation. Such
analog estimators turn out to have good properties quite generally. The
sample mean is simply the arithmetic average,
N
1 X
yi .
y =
N i=1
2 =
PN
i=1 (yi
y)2
.
N
It provides an empirical measure of the dispersion of y around its mean.
We commonly use a slightly different version of
2 , which corrects for the
one degree of freedom used in the estimation of y, thereby producing an
unbiased estimator of 2 ,
s2 =
PN
y)2
.
N 1
i=1 (yi
)2
i=1 (yi y
2
=
=
N
or
s=
s
s2
PN
y)2
.
N 1
i=1 (yi
An estimator is an example of a statistic, or sample statistic, which is simply a function of the sample
observations.
291
1
N
PN
i=1 (yi
y)3
1
N
PN
i=1 (yi
y)4
Multivariate
292
A.3
cov(y,
c
x)
.
y
x
Here we refresh your memory on the sampling distribution of the most important sample moment, the sample mean.
A.3.1
In your earlier studies you learned about statistical inference, such as how
to form confidence intervals for the population mean based on the sample
mean, how to test hypotheses about the population mean, and so on. Here
we partially refresh your memory.
Consider the benchmark case of Gaussian simple random sampling,
yi iid N (, 2 ), i = 1, ..., N,
which corresponds to a special case of what we will later call the full ideal
conditions for regression modeling. The sample mean y is the natural estimator of the population mean . In this case, as you learned earlier, y is
unbiased, consistent, normally distributed with variance 2 /N , and indeed
the minimum variance unbiased (MVUE) estimator. We write
2
y N ,
,
N
or equivalently
N (
y ) N (0, 2 ).
y 0
s
N
A.3.2
t1 2 (N 1).
2
y N ,
.
N
More precisely, as T ,
N (
y ) d N (0, 2 ).
294
This result forms the basis for asymptotic inference. It is a Gaussian central
limit theorem, and it also has a law of large numbers (
y p ) imbedded
within it.
We construct asymptotically-valid confidence intervals for as
y z1 2
w.p. ,
N
where z1 2 is the 1
A.4
N (0, 1).
295
296
c. Calculate and discuss the sample correlation between wage and years
of education.
A.5
Notes
Numerous good introductory probability and statistics books exist. Wonnacott and Wonnacott (1990) remains a time-honored classic, which you may
wish to consult to refresh your memory on statistical distributions, estimation and hypothesis testing. Anderson et al. (2008) is a well-written recent
text.
Appendix B
Construction of the Wage Datasets
We construct our datasets from randomly sampling the much-larger Current
Population Survey (CPS) datasets.1
We extract the data from the March CPS for 1995, 2004 and 2012 respectively, using the National Bureau of Economic Research (NBER) front end
(http://www.nber.org/data/cps.html) and NBER SAS, SPSS, and Stata
data definition file statements (http://www.nber.org/data/cps_progs.html).
We use both personal and family records. Here we focus our discussion on
1995.
There are many CPS observations for which earnings data are completely
missing. We drop those observations, as well as those that are not in the
universe for the eligible CPS earning items ( ERNEL=0), leaving 14363 observations. From those, we draw a random unweighted subsample with ten
percent selection probability. This results in 1348 observations.
We use seven variables. From the CPS we obtain AGE (age), FEMALE
(1 if female, 0 otherwise), NONWHITE (1 if nonwhite, 0 otherwise), and
UNION (1 if union member, 0 otherwise). We also create EDUC (years
of schooling) based on CPS variable PEEDUCA (educational attainment).
Because the CPS does not ask about years of experience, we create EXPER
1
297
298
299
Variable
Age
Labor force status
Class of worker
A CLSWKR
Selection Criteria
18-65
1 working (we exclude armed
forces)
1,2,3,4 (we exclude selfemployed and pro bono)
300
Variable
PEAGE (A AGE)
A LFSR
A CLSWKR
PEEDUCA (A HGA)
PERACE (PRDTRACE)
PESEX (A SEX)
PEERNLAB (A UNMEM)
PRERNWA (A GRSWK)
PEHRUSL1 (A USLHRS)
PEHRACTT (A HRS1)
PRERNHLY (A HRSPAY)
Description
Age
Labor force status
Class of worker
Educational attainment
RACE
SEX
UNION
Usual earnings per week
Usual hours worked weekly
Hours worked last week
Earnings per hour
AGE
Equals PEAGE
FEMALE
Equals 1 if PESEX=2, 0 otherwise
NONWHITE
Equals 0 if PERACE=1, 0 otherwise
UNION
Equals 1 if PEERNLAB=1, 0 otherwise
EDUC
Refers to the Table
EXPER
Equals AGE-EDUC-6
WAGE
Equals PRERNHLY or PRERNWA/ PEHRUSL1
NOTE: Variable names in parentheses are for 2004 and 2012.
Variable List
301
EDUC
0
1
5
7
9
10
11
12
12
12
14
14
16
18
PEEDUCA
(A HGA)
31
32
33
34
35
36
37
38
39
40
41
42
43
44
20
45
20
46
Description
Less than first grade
Frist, second, third or four grade
Fifth or sixth grade
Seventh or eighth grade
Ninth grade
Tenth grade
Eleventh grade
Twelfth grade no diploma
High school graduate
Some college but no degree
Associate degree-occupational/vocational
Associate degree-academic program
Bachelor degree (B.A., A.B., B.S.)
Master degree (M.A., M.S., M.Eng., M.Ed., M.S.W.,
M.B.A.)
Professional school degree (M.D., D.D.S., D.V.M.,
L.L.B., J.D.)
Doctorate degree (Ph.D., Ed.D.)
Definition of EDUC
302
Appendix C
Some Popular Books Worth
Encountering
I have cited many of these books elsewhere, typically in various end-of-chapter
complements. Here I list them collectively.
Lewis (2003) [Michael Lewis, Moneyball ]. Appearances may lie, but the
numbers dont, so pay attention to the numbers.
Gladwell (2000) [Malcolm Gladwell, The Tipping Point]. Nonlinear phenomena are everywhere.
Gladwell pieces together an answer to the puzzling question of why certain
things take off whereas others languish (products, fashions, epidemics, etc.)
More generally, he provides deep insights into nonlinear environments, in
which small changes in inputs can lead to small changes in outputs under
some conditions, and to huge changes in outputs under other conditions.
Taleb (2007) [Nassim Nicholas Taleb, The Black Swan] Warnings, and
more warnings, and still more warnings, about non-normality and much else.
See Chapter 7 EPC 1.
Angrist and Pischke (2009) [Joshua Angrist and Jorn-Steffen Pischke,
Mostly Harmless Econometrics]. Natural and quasi-natural experiments
suggesting instruments.
This is a fun and insightful treatment of instrumental-variables and related
303
304
Bibliography
Anderson, D.R., D.J. Sweeney, and T.A. Williams (2008), Statistics for Business and Economics, South-Western.
Angrist, J.D. and J.-S. Pischke (2009), Mostly Harmless Econometrics,
Princeton University Press.
Gladwell, M. (2000), The Tipping Point, Little, Brown and Company.
Harvey, A.C. (1991), Forecasting, Structural Time Series Models and the
Kalman Filter, Cambridge University Press.
Jarque, C.M. and A.K. Bera (1987), A Test for Normality of Observations
and Regression Residuals, International Statistical Review , 55, 163172.
Kiefer, N. and M. Salmon (1983), Testing Normality in Econometric Models, Economic Letters, 11, 123127.
Koenker, R. (2005), Quantile Regression, Econometric Society Monograph
Series, Cambridge University Press, 2005.
Lewis, M. (2003), Moneyball, Norton.
Nerlove, M., D.M. Grether, and J.L. Carvalho (1979), Analysis of Economic
Time Series: A Synthesis. New York: Academic Press. Second Edition.
Silver, N.. (2012), The Signal and the Noise, Penguin Press.
Taleb, N.N. (2007), The Black Swan, Random House.
305
306
BIBLIOGRAPHY
Index
F distribution, 34
Banking to 45 degrees, 19
F -statistic, 54
Binary data, 5
R-squared, 55
s-squared, 55
t distribution, 34
t-statistic, 51
2 distribution, 34
Calendar effects, 76
Fitted values, 44
Central tendency, 30
Holiday variation, 77
Chartjunk, 19
Cointegration, 280
Adjusted R-squared, 56
Akaike information criterion, 56
Analog principle, 161
Analysis of variance, 80
AR(p) process, 171
ARCH(p) process, 289
Aspect ratio, 19
Asymmetric response, 295
Asymmetry, 31
Asymptototic, 35
Autocorrelation function, 156
Autocovariance function, 154
Autoregressions, 156
Autoregressive (AR) model, 166
Common scales, 19
Conditional distribution, 32
Conditional expectation, 47
Conditional mean, 32
Conditional mean and variance, 160
Conditional mean function, 97
Conditional moment, 32
Conditional variance, 32
Constant term, 51
Continuous data, 5
Continuous random variable, 30
Correlation, 32
Correlogram, 162
Correlogram analysis, 164
307
308
Covariance, 31
Covariance stationary, 154
Cross correlation function, 242
Cross sectional data, 5
Cross sections, 6
Cross-variable dynamics, 235
CUSUM, 137
CUSUM plot, 137
Cycles, 153
INDEX
Durbin-Watson statistic, 57
Econometric modeling, 3
Error-correction, 281
Estimator, 33
Ex post smoothing, 119
Expected value, 30
Exploratory data analysis, 23
Exponential GARCH, 296
Exponential smoothing, 261
Data mining, 57
De-trending, 81
Deterministic seasonality, 74
Deterministic trend, 72, 249
Dickey-Fuller distribution, 255
Discrete probability distribution, 29
Discrete random variable, 29
age, 261
Feedback, 243
Financial econometrics, 286
First-order serial correlation, 178
Fourier series expansions, 123
Functional form, 107
Dispersion, 30
Distributed lag, 165
Gaussian distribution, 31
Goodness of fit, 56
Heteroskedasticity, 285
INDEX
309
Integrated, 248
Marginal distribution, 31
Intercept, 72
Intercept dummies, 70
Mean, 30
Interval data, 9
Leptokurtosis, 31
Likelihood function, 53
Nominal data, 9
Non-data ink, 19
Non-linearity, 97
Linear trend, 72
Non-normality, 97
Normal distribution, 31
310
INDEX
Odds, 336
QQ plots, 99
Panel data, 5
Regression function, 47
Panels, 6
Regression intercept, 47
Parameters, 47
Relational graphics, 15
Partial correlation, 21
Residual plot, 59
Residual scatter, 58
Residuals, 44
Population, 32
Population model, 47
Sample, 32
Sample correlation, 34
Sample covariance, 34
Prob(F -statistic), 54
Sample kurtosis, 33
Probability value, 52
able, 53
Sample partial autocorrelation, 164
INDEX
311
Statistic, 33
Sample skewness, 33
Stochastic seasonality, 74
Sample statistic, 33
Sample variance, 33
Scale, 30
Superconsistency, 253
Scatterplot matrix, 16
Schwarz information criterion, 57
Seasonal adjustment, 81
Seasonality, 72, 74
Second-order stationarity, 155
Serial correlation, 57
Serially uncorrelated, 158
Simple correlation, 21
Simple exponential smoothing, 261
Simple random sampling, 34
Simulating time series processes, 189
Single exponential smoothing, 261
Skewness, 31
Slope, 72
Slope dummies, 78
Smoothing, 118
Standard deviation, 30
Univariate, 13
Standard errors, 51
Standardized recursive residuals, 137
Variance, 30
Vector autoregression of order p, 235
312
INDEX