Textbook Time Series Analysis and Its Applications With R Examples 4Th Edition Robert H Shumway Ebook All Chapter PDF

You might also like

You are on page 1of 53

Time Series Analysis and Its

Applications With R Examples 4th


Edition Robert H. Shumway
Visit to download the full and correct content document:
https://textbookfull.com/product/time-series-analysis-and-its-applications-with-r-exam
ples-4th-edition-robert-h-shumway/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Applied time series analysis with R Second Edition


Elliott

https://textbookfull.com/product/applied-time-series-analysis-
with-r-second-edition-elliott/

Nonlinear Time Series Analysis with R 1st Edition Ray


Huffaker

https://textbookfull.com/product/nonlinear-time-series-analysis-
with-r-1st-edition-ray-huffaker/

The Analysis of Time Series: An Introduction with R 7th


Edition Chris Chatfield

https://textbookfull.com/product/the-analysis-of-time-series-an-
introduction-with-r-7th-edition-chris-chatfield/

Time Series Analysis Methods and Applications for


Flight Data Zhang

https://textbookfull.com/product/time-series-analysis-methods-
and-applications-for-flight-data-zhang/
Displaying Time Series Spatial and Space Time Data with
R Second Edition Oscar Perpinan Lamigueiro

https://textbookfull.com/product/displaying-time-series-spatial-
and-space-time-data-with-r-second-edition-oscar-perpinan-
lamigueiro/

Time Series Analysis Methods and Applications for


Flight Data 1st Edition Jianye Zhang

https://textbookfull.com/product/time-series-analysis-methods-
and-applications-for-flight-data-1st-edition-jianye-zhang/

Time series analysis 1st Edition Palma

https://textbookfull.com/product/time-series-analysis-1st-
edition-palma/

Statistical Analysis of Financial Data: With Examples


In R 1st Edition James Gentle

https://textbookfull.com/product/statistical-analysis-of-
financial-data-with-examples-in-r-1st-edition-james-gentle/

Complex Analysis with Applications 1st Edition Nakhlé


H. Asmar

https://textbookfull.com/product/complex-analysis-with-
applications-1st-edition-nakhle-h-asmar/
Springer Texts in Statistics

Robert H. Shumway
David S. Stoffer

Time Series
Analysis and Its
Applications
With R Examples
Fourth Edition
Springer Texts in Statistics

Series Editors
Richard DeVeaux
Stephen E. Fienberg
Ingram Olkin

More information about this series at http://www.springer.com/series/417


Robert H. Shumway • David S. Stoffer

Time Series Analysis


and Its Applications
With R Examples

Fourth Edition

123
Robert H. Shumway David S. Stoffer
Department of Statistics Department of Statistics
University of California, Davis University of Pittsburgh
Davis, CA, USA Pittsburgh, PA, USA

ISSN 1431-875X ISSN 2197-4136 (electronic)


Springer Texts in Statistics
ISBN 978-3-319-52451-1 ISBN 978-3-319-52452-8 (eBook)
DOI 10.1007/978-3-319-52452-8

Library of Congress Control Number: 2017930675

© Springer International Publishing AG 1999, 2012, 2016, 2017


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of
the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology
now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book
are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, express or implied, with respect to the material contained herein or for any errors
or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims
in published maps and institutional affiliations.

Printed on acid-free paper

This Springer imprint is published by Springer Nature


The registered company is Springer International Publishing AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface to the Fourth Edition

The fourth edition follows the general layout of the third edition but includes some
modernization of topics as well as the coverage of additional topics. The preface to
the third edition—which follows—still applies, so we concentrate on the differences
between the two editions here. As in the third edition, R code for each example
is given in the text, even if the code is excruciatingly long. Most of the examples
with seemingly endless coding are in the latter chapters. The R package for the
text, astsa, is still supported and details may be found in Appendix R. The global
temperature deviation series have been updated to 2015 and are included in the newest
version of the package; the corresponding examples and problems have been updated
accordingly.
Chapter 1 of this edition is similar to the previous edition, but we have included
the definition of trend stationarity and the concept of prewhitening when using cross-
correlation. The New York Stock Exchange data set, which focused on an old financial
crisis, was replaced with a more current series of the Dow Jones Industrial Average,
which focuses on a newer financial crisis. In Chap. 2, we rewrote some of the
regression review, changing the smoothing examples from the mortality data example
to the Southern Oscillation Index and finding El Niño. We also expanded on the lagged
regression example and carried it on to Chap. 3.
In Chap. 3, we removed normality from definition of ARMA models; while the
assumption is not necessary for the definition, it is essential for inference and pre-
diction. We added a section on regression with ARMA errors and the corresponding
problems; this section was previously in Chap. 5. Some of the examples have been
modified and we added some examples in the seasonal ARMA section. Finally, we
included a discussion of lagged regression with autocorrelated errors.
In Chap. 4, we improved and added some examples. The idea of modulated
series is discussed using the classic star magnitude data set. We moved some of the
filtering section forward for easier access to information when needed. We removed
the reliance on spec.pgram (from the stats package) to mvspec (from the astsa
package) so we can avoid having to spend pages explaining the quirks of spec.pgram,

v
vi Preface to the Fourth Edition

which tended to take over the narrative. The section on wavelets was removed because
there are so many accessible texts available. The spectral representation theorems are
discussed in a little more detail using examples based on simple harmonic processes.
The general layout of Chap. 5 and of Chap. 7 is the same, although we have
revised some of the examples. As previously mentioned, we moved regression with
ARMA errors to Chap. 3.
Chapter 6 sees the biggest change in this edition. We have added a section on
smoothing splines, and a section on hidden Markov models and switching autore-
gressions. The Bayesian section is completely rewritten and is on linear Gaussian
state space models only. The nonlinear material in the previous edition is removed
because it was old, and the newer material is in Douc, Moulines, and Stoffer [53].
Many of the examples have been rewritten to make the chapter more accessible.
The appendices are similar, with some minor changes to Appendix A and
Appendix B. We added material to Appendix C, including a discussion of Riemann–
Stieltjes and stochastic integration, a proof of the fact that the spectra of autoregressive
processes are dense in the space of spectral densities, and a proof of the fact that spec-
tra are approximately the eigenvalues of the covariance matrix of a stationary process.
We tweaked, rewrote, improved, or revised some of the exercises, but the overall
ordering and coverage is roughly the same. And, of course, we moved regression with
ARMA errors problems to Chap. 3 and removed the Chap. 4 wavelet problems. The
exercises for Chap. 6 have been updated accordingly to reflect the new and improved
version of the chapter.

Davis, CA, USA Robert H. Shumway


Pittsburgh, PA, USA David S. Stoffer
December 2016
Preface to the Third Edition

The goals of this book are to develop an appreciation for the richness and versatility
of modern time series analysis as a tool for analyzing data, and still maintain a
commitment to theoretical integrity, as exemplified by the seminal works of Brillinger
[33] and Hannan [86] and the texts by Brockwell and Davis [36] and Fuller [66]. The
advent of inexpensive powerful computing has provided both real data and new
software that can take one considerably beyond the fitting of simple time domain
models, such as have been elegantly described in the landmark work of Box and
Jenkins [30]. This book is designed to be useful as a text for courses in time series on
several different levels and as a reference work for practitioners facing the analysis of
time-correlated data in the physical, biological, and social sciences.
We have used earlier versions of the text at both the undergraduate and gradu-
ate levels over the past decade. Our experience is that an undergraduate course can
be accessible to students with a background in regression analysis and may include
Sects. 1.1–1.5, Sects. 2.1–2.3, the results and numerical parts of Sects. 3.1–3.9,
and briefly the results and numerical parts of Sects. 4.1–4.4. At the advanced un-
dergraduate or master’s level, where the students have some mathematical statistics
background, more detailed coverage of the same sections, with the inclusion of extra
topics from Chaps. 5 or 6, can be used as a one-semester course. Often, the extra
topics are chosen by the students according to their interests. Finally, a two-semester
upper-level graduate course for mathematics, statistics, and engineering graduate stu-
dents can be crafted by adding selected theoretical appendices. For the upper-level
graduate course, we should mention that we are striving for a broader but less rigorous
level of coverage than that which is attained by Brockwell and Davis [36], the classic
entry at this level.
The major difference between this third edition of the text and the second edition is
that we provide R code for almost all of the numerical examples. An R package called
astsa is provided for use with the text; see Sect. R.2 for details. R code is provided
simply to enhance the exposition by making the numerical examples reproducible.

vii
viii Preface to the Third Edition

We have tried, where possible, to keep the problem sets in order so that an
instructor may have an easy time moving from the second edition to the third edition.
However, some of the old problems have been revised and there are some new
problems. Also, some of the data sets have been updated. We added one section in
Chap. 5 on unit roots and enhanced some of the presentations throughout the text. The
exposition on state-space modeling, ARMAX models, and (multivariate) regression
with autocorrelated errors in Chap. 6 have been expanded. In this edition, we use
standard R functions as much as possible, but we use our own scripts (included in
astsa) when we feel it is necessary to avoid problems with a particular R function;
these problems are discussed in detail on the website for the text under R Issues.
We thank John Kimmel, Executive Editor, Springer Statistics, for his guidance
in the preparation and production of this edition of the text. We are grateful to Don
Percival, University of Washington, for numerous suggestions that led to substantial
improvement to the presentation in the second edition, and consequently in this
edition. We thank Doug Wiens, University of Alberta, for help with some of the
R code in Chaps. 4 and 7, and for his many suggestions for improvement of the
exposition. We are grateful for the continued help and advice of Pierre Duchesne,
University of Montreal, and Alexander Aue, University of California, Davis. We also
thank the many students and other readers who took the time to mention typographical
errors and other corrections to the first and second editions. Finally, work on this
edition was supported by the National Science Foundation while one of us (D.S.S.)
was working at the Foundation under the Intergovernmental Personnel Act.

Davis, CA, USA Robert H. Shumway


Pittsburgh, PA, USA David S. Stoffer
September 2010
Contents

Preface to the Fourth Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v

Preface to the Third Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii

1 Characteristics of Time Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1


1.1 The Nature of Time Series Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Time Series Statistical Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3 Measures of Dependence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.4 Stationary Time Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.5 Estimation of Correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.6 Vector-Valued and Multidimensional Series . . . . . . . . . . . . . . . . . . . . . 33
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

2 Time Series Regression and Exploratory Data Analysis . . . . . . . . . . . . . 45


2.1 Classical Regression in the Time Series Context . . . . . . . . . . . . . . . . . 45
2.2 Exploratory Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.3 Smoothing in the Time Series Context . . . . . . . . . . . . . . . . . . . . . . . . . 65
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

3 ARIMA Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.1 Autoregressive Moving Average Models . . . . . . . . . . . . . . . . . . . . . . . 75
3.2 Difference Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.3 Autocorrelation and Partial Autocorrelation . . . . . . . . . . . . . . . . . . . . . 94
3.4 Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.5 Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3.6 Integrated Models for Nonstationary Data . . . . . . . . . . . . . . . . . . . . . . 131
3.7 Building ARIMA Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
3.8 Regression with Autocorrelated Errors . . . . . . . . . . . . . . . . . . . . . . . . 142
3.9 Multiplicative Seasonal ARIMA Models . . . . . . . . . . . . . . . . . . . . . . . 145
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

ix
x Contents

4 Spectral Analysis and Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165


4.1 Cyclical Behavior and Periodicity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
4.2 The Spectral Density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
4.3 Periodogram and Discrete Fourier Transform . . . . . . . . . . . . . . . . . . . 179
4.4 Nonparametric Spectral Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
4.5 Parametric Spectral Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
4.6 Multiple Series and Cross-Spectra . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
4.7 Linear Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
4.8 Lagged Regression Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
4.9 Signal Extraction and Optimum Filtering . . . . . . . . . . . . . . . . . . . . . . . 222
4.10 Spectral Analysis of Multidimensional Series . . . . . . . . . . . . . . . . . . . 226
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

5 Additional Time Domain Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241


5.1 Long Memory ARMA and Fractional Differencing . . . . . . . . . . . . . . 241
5.2 Unit Root Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
5.3 GARCH Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
5.4 Threshold Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
5.5 Lagged Regression and Transfer Function Modeling . . . . . . . . . . . . . 266
5.6 Multivariate ARMAX Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285

6 State Space Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289


6.1 Linear Gaussian Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
6.2 Filtering, Smoothing, and Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . 294
6.3 Maximum Likelihood Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
6.4 Missing Data Modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
6.5 Structural Models: Signal Extraction and Forecasting . . . . . . . . . . . . 318
6.6 State-Space Models with Correlated Errors . . . . . . . . . . . . . . . . . . . . . 321
6.6.1 ARMAX Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
6.6.2 Multivariate Regression with Autocorrelated Errors . . . . . . . 324
6.7 Bootstrapping State Space Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
6.8 Smoothing Splines and the Kalman Smoother . . . . . . . . . . . . . . . . . . . 333
6.9 Hidden Markov Models and Switching Autoregression . . . . . . . . . . . 336
6.10 Dynamic Linear Models with Switching . . . . . . . . . . . . . . . . . . . . . . . 348
6.11 Stochastic Volatility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
6.12 Bayesian Analysis of State Space Models . . . . . . . . . . . . . . . . . . . . . . 367
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378

7 Statistical Methods in the Frequency Domain . . . . . . . . . . . . . . . . . . . . . 385


7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
7.2 Spectral Matrices and Likelihood Functions . . . . . . . . . . . . . . . . . . . . 388
7.3 Regression for Jointly Stationary Series . . . . . . . . . . . . . . . . . . . . . . . . 390
7.4 Regression with Deterministic Inputs . . . . . . . . . . . . . . . . . . . . . . . . . 399
7.5 Random Coefficient Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Contents xi

7.6 Analysis of Designed Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409


7.7 Discriminant and Cluster Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
7.8 Principal Components and Factor Analysis . . . . . . . . . . . . . . . . . . . . . 439
7.9 The Spectral Envelope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466

Appendix A Large Sample Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473


A.1 Convergence Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
A.2 Central Limit Theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
A.3 The Mean and Autocorrelation Functions . . . . . . . . . . . . . . . . . . . . . . 484

Appendix B Time Domain Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493


B.1 Hilbert Spaces and the Projection Theorem . . . . . . . . . . . . . . . . . . . . . 493
B.2 Causal Conditions for ARMA Models . . . . . . . . . . . . . . . . . . . . . . . . . 497
B.3 Large Sample Distribution of the AR Conditional Least Squares
Estimators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
B.4 The Wold Decomposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502

Appendix C Spectral Domain Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505


C.1 Spectral Representation Theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
C.2 Large Sample Distribution of the Smoothed Periodogram . . . . . . . . . 509
C.3 The Complex Multivariate Normal Distribution . . . . . . . . . . . . . . . . . 519
C.4 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
C.4.1 Riemann–Stieltjes Integration . . . . . . . . . . . . . . . . . . . . . . . . . . 524
C.4.2 Stochastic Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
C.5 Spectral Analysis as Principal Component Analysis . . . . . . . . . . . . . . 528
C.6 Parametric Spectral Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531

Appendix R R Supplement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533


R.1 First Things First . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
R.2 astsa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
R.3 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
R.4 Time Series Primer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
R.4.1 Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Biography

Robert H. Shumway is Professor Emeritus of Statistics at the University of California,


Davis. He is a Fellow of the American Statistical Association and a member of the
International Statistical Institute. He won the 1986 American Statistical Association
Award for Outstanding Statistical Application and the 1992 Communicable Diseases
Center Statistics Award; both awards were for joint papers on time series applications.
He is the author of a previous 1988 Prentice-Hall text on applied time series analysis
and served as a Departmental Editor for the Journal of Forecasting and Associate
Editor for the Journal of the American Statistical Association.

David S. Stoffer is Professor of Statistics at the University of Pittsburgh. He is a


Fellow of the American Statistical Association. He has made seminal contributions
to the analysis of categorical time series and won the 1989 American Statistical
Association Award for Outstanding Statistical Application in a joint paper analyzing
categorical time series arising in infant sleep-state cycling. He is also coauthor of
the highly acclaimed text, Nonlinear Time Series: Theory, Methods and Applications
with R Examples. He is currently Co-Editor of the Journal of Time Series Analysis,
Departmental Editor of the Journal of Forecasting, and an Associate Editor of the
Annals of Statistical Mathematics. He has served as a Program Director in the Division
of Mathematical Sciences at the National Science Foundation and as an Associate
Editor for the Journal of Business and Economic Statistics and the Journal of the
American Statistical Association.

xiii
Chapter 1
Characteristics of Time Series

The analysis of experimental data that have been observed at different points in time
leads to new and unique problems in statistical modeling and inference. The obvi-
ous correlation introduced by the sampling of adjacent points in time can severely
restrict the applicability of the many conventional statistical methods traditionally
dependent on the assumption that these adjacent observations are independent and
identically distributed. The systematic approach by which one goes about answer-
ing the mathematical and statistical questions posed by these time correlations is
commonly referred to as time series analysis.
The impact of time series analysis on scientific applications can be partially doc-
umented by producing an abbreviated listing of the diverse fields in which important
time series problems may arise. For example, many familiar time series occur in the
field of economics, where we are continually exposed to daily stock market quota-
tions or monthly unemployment figures. Social scientists follow population series,
such as birthrates or school enrollments. An epidemiologist might be interested in
the number of influenza cases observed over some time period. In medicine, blood
pressure measurements traced over time could be useful for evaluating drugs used
in treating hypertension. Functional magnetic resonance imaging of brain-wave time
series patterns might be used to study how the brain reacts to certain stimuli under
various experimental conditions.
In our view, the first step in any time series investigation always involves careful
examination of the recorded data plotted over time. This scrutiny often suggests
the method of analysis as well as statistics that will be of use in summarizing the
information in the data. Before looking more closely at the particular statistical
methods, it is appropriate to mention that two separate, but not necessarily mutually
exclusive, approaches to time series analysis exist, commonly identified as the time
domain approach and the frequency domain approach. The time domain approach
views the investigation of lagged relationships as most important (e.g., how does
what happened today affect what will happen tomorrow), whereas the frequency

© Springer International Publishing AG 2017 1


R.H. Shumway, D.S. Stoffer, Time Series Analysis and Its Applications,
Springer Texts in Statistics, DOI 10.1007/978-3-319-52452-8_1
2 1 Characteristics of Time Series

l l

Quarterly Earnings per Share


15
l l
l
l
lll l
l
10 l l
l
l l l
l
ll l
l ll l l
l l
ll l l
lll
5

lll l
llll
l ll l
l l
l ll l l
l llllll lll l
llllllllllllllllll l
0

1960 1965 1970 1975 1980


Time

Fig. 1.1. Johnson & Johnson quarterly earnings per share, 84 quarters, 1960-I to 1980-IV

domain approach views the investigation of cycles as most important (e.g., what is
the economic cycle through periods of expansion and recession). We will explore
both types of approaches in the following sections.

1.1 The Nature of Time Series Data


Some of the problems and questions of interest to the prospective time series analyst
can best be exposed by considering real experimental data taken from different subject
areas. The following cases illustrate some of the common kinds of experimental time
series data as well as some of the statistical questions that might be asked about such
data.

Example 1.1 Johnson & Johnson Quarterly Earnings


Figure 1.1 shows quarterly earnings per share for the U.S. company Johnson &
Johnson, furnished by Professor Paul Griffin (personal communication) of the
Graduate School of Management, University of California, Davis. There are 84
quarters (21 years) measured from the first quarter of 1960 to the last quarter
of 1980. Modeling such series begins by observing the primary patterns in the time
history. In this case, note the gradually increasing underlying trend and the rather
regular variation superimposed on the trend that seems to repeat over quarters.
Methods for analyzing data such as these are explored in Chaps. 2 and 6. To plot
the data using the R statistical package, type the following1:
library(astsa) # SEE THE FOOTNOTE
plot(jj, type="o", ylab="Quarterly Earnings per Share")

1 Throughout the text, we assume that the R package for the book, astsa, has been installed and loaded.
See Sect. R.2 for further details.
1.1 The Nature of Time Series Data 3

Global Temperature Deviations


0.8
l
l l
l ll ll l lll
l l l
l
l l ll
0.4
l l
ll l ll
l l l
ll
l ll ll
l
l l l l
ll l l ll l l
0.0

lll l ll l l ll l
ll l l ll
ll l l l l l l ll l l l ll
l ll
l l l
l ll l l l l ll
ll l l l l ll l
lll l l l lll lll l
l ll
ll l
−0.4

l l l
l l
l llll

1880 1900 1920 1940 1960 1980 2000 2020


Time

Fig. 1.2. Yearly average global temperature deviations (1880–2015) in degrees centigrade

Example 1.2 Global Warming


Consider the global temperature series record shown in Fig. 1.2. The data are the
global mean land–ocean temperature index from 1880 to 2015, with the base period
1951–1980. In particular, the data are deviations, measured in degrees centigrade,
from the 1951–1980 average, and are an update of Hansen et al. [89]. We note an
apparent upward trend in the series during the latter part of the twentieth century
that has been used as an argument for the global warming hypothesis. Note also
the leveling off at about 1935 and then another rather sharp upward trend at about
1970. The question of interest for global warming proponents and opponents is
whether the overall trend is natural or whether it is caused by some human-induced
interface. Problem 2.8 examines 634 years of glacial sediment data that might be
taken as a long-term temperature proxy. Such percentage changes in temperature
do not seem to be unusual over a time period of 100 years. Again, the question of
trend is of more interest than particular periodicities. The R code for this example
is similar to the code in Example 1.1:
plot(globtemp, type="o", ylab="Global Temperature Deviations")

Example 1.3 Speech Data


Figure 1.3 shows a small .1 second (1000 point) sample of recorded speech for
the phrase aaa · · · hhh, and we note the repetitive nature of the signal and the
rather regular periodicities. One current problem of great interest is computer
recognition of speech, which would require converting this particular signal into
the recorded phrase aaa · · · hhh. Spectral analysis can be used in this context to
produce a signature of this phrase that can be compared with signatures of various
library syllables to look for a match. One can immediately notice the rather regular
repetition of small wavelets. The separation between the packets is known as the
pitch period and represents the response of the vocal tract filter to a periodic
sequence of pulses stimulated by the opening and closing of the glottis. In R, you
can reproduce Fig. 1.3 using plot(speech).
4 1 Characteristics of Time Series

4000
3000
speech
2000
1000
0

0 200 400 600 800 1000


Time

Fig. 1.3. Speech recording of the syllable aaa · · · hhh sampled at 10,000 points per second
with n = 1020 points
0.10
0.05
DJIA Returns
0.00
−0.05

Apr 21 2006 Apr 01 2008 Apr 01 2010 Apr 02 2012 Apr 01 2014 Mar 31 2016

Fig. 1.4. The daily returns of the Dow Jones Industrial Average (DJIA) from April 20, 2006 to
April 20, 2016

Example 1.4 Dow Jones Industrial Average


As an example of financial time series data, Fig. 1.4 shows the daily returns (or per-
cent change) of the Dow Jones Industrial Average (DJIA) from April 20, 2006 to
April 20, 2016. It is easy to spot the financial crisis of 2008 in the figure. The data
shown in Fig. 1.4 are typical of return data. The mean of the series appears to be
stable with an average return of approximately zero, however, highly volatile (vari-
able) periods tend to be clustered together. A problem in the analysis of these type
of financial data is to forecast the volatility of future returns. Models such as ARCH
and GARCH models (Engle [57]; Bollerslev [28]) and stochastic volatility models
(Harvey, Ruiz and Shephard [94]) have been developed to handle these problems.
We will discuss these models and the analysis of financial data in Chaps. 5 and
6. The data were obtained using the Technical Trading Rules (TTR) package to
download the data from YahooTM and then plot it. We then used the fact that if
xt is the actual value of the DJIA and rt = (xt − xt−1 )/xt−1 is the return, then
1.1 The Nature of Time Series Data 5

1 + rt = xt /xt−1 and log(1 + rt ) = log(xt /xt−1 ) = log(xt ) − log(xt−1 ) ≈ rt .2 The


data set is also available in astsa, but xts must be loaded.
# library(TTR)
# djia = getYahooData("^DJI", start=20060420, end=20160420, freq="daily")
library(xts)
djiar = diff(log(djia$Close))[-1] # approximate returns
plot(djiar, main="DJIA Returns", type="n")
lines(djiar)

Example 1.5 El Niño and Fish Population


We may also be interested in analyzing several time series at once. Figure 1.5
shows monthly values of an environmental series called the Southern Oscillation
Index (SOI) and associated Recruitment (number of new fish) furnished byDr. Roy
Mendelssohn of the Pacific Environmental Fisheries Group (personal communica-
tion). Both series are for a period of 453 months ranging over the years 1950–1987.
The SOI measures changes in air pressure, related to sea surface temperatures in
the central Pacific Ocean. The central Pacific warms every three to seven years due
to the El Niño effect, which has been blamed for various global extreme weather
events. Both series in Fig. 1.5 exhibit repetitive behavior, with regularly repeating
cycles that are easily visible. This periodic behavior is of interest because under-
lying processes of interest may be regular and the rate or frequency of oscillation
characterizing the behavior of the underlying series would help to identify them.
The series show two basic oscillations types, an obvious annual cycle (hot in the
summer, cold in the winter), and a slower frequency that seems to repeat about
every 4 years. The study of the kinds of cycles and their strengths is the subject of
Chap. 4. The two series are also related; it is easy to imagine the fish population is
dependent on the ocean temperature. This possibility suggests trying some version
of regression analysis as a procedure for relating the two series. Transfer function
modeling, as considered in Chap. 5, can also be applied in this case. The following
R code will reproduce Fig. 1.5:
par(mfrow = c(2,1)) # set up the graphics
plot(soi, ylab="", xlab="", main="Southern Oscillation Index")
plot(rec, ylab="", xlab="", main="Recruitment")

Example 1.6 fMRI Imaging


A fundamental problem in classical statistics occurs when we are given a collection
of independent series or vectors of series, generated under varying experimental
conditions or treatment configurations. Such a set of series is shown in Fig. 1.6,
where we observe data collected from various locations in the brain via functional
magnetic resonance imaging (fMRI). In this example, five subjects were given pe-
riodic brushing on the hand. The stimulus was applied for 32 seconds and then
stopped for 32 seconds; thus, the signal period is 64 seconds. The sampling rate

p2 p3
2 log(1 + p) = p − 2 + 3 − · · · for −1 < p ≤ 1. If p is near zero, the higher-order terms in the
expansion are negligible.
6 1 Characteristics of Time Series

Southern Oscillation Index

1.0
0.5
0.0
−0.5
−1.0

1950 1960 1970 1980

Recruitment
100
80
60
40
20
0

1950 1960 1970 1980


Time

Fig. 1.5. Monthly SOI and Recruitment (estimated new fish), 1950–1987

was one observation every 2 seconds for 256 seconds (n = 128). For this exam-
ple, we averaged the results over subjects (these were evoked responses, and all
subjects were in phase). The series shown in Fig. 1.6 are consecutive measures of
blood oxygenation-level dependent (bold) signal intensity, which measures areas
of activation in the brain. Notice that the periodicities appear strongly in the mo-
tor cortex series and less strongly in the thalamus and cerebellum. The fact that
one has series from different areas of the brain suggests testing whether the areas
are responding differently to the brush stimulus. Analysis of variance techniques
accomplish this in classical statistics, and we show in Chap. 7 how these classical
techniques extend to the time series case, leading to a spectral analysis of variance.
The following R commands can be used to plot the data:
par(mfrow=c(2,1))
ts.plot(fmri1[,2:5], col=1:4, ylab="BOLD", main="Cortex")
ts.plot(fmri1[,6:9], col=1:4, ylab="BOLD", main="Thalamus & Cerebellum")

Example 1.7 Earthquakes and Explosions


As a final example, the series in Fig. 1.7 represent two phases or arrivals along the
surface, denoted by P (t = 1, . . . , 1024) and S (t = 1025, . . . , 2048), at a seismic
1.1 The Nature of Time Series Data 7

Cortex

0.6
0.2
BOLD
−0.2
−0.6

0 20 40 60 80 100 120

Thalamus & Cerebellum


0.6
0.2
BOLD
−0.2
−0.6

0 20 40 60 80 100 120
Time (1 pt = 2 sec)

Fig. 1.6. fMRI data from various locations in the cortex, thalamus, and cerebellum; n = 128
points, one observation taken every 2 s

recording station. The recording instruments in Scandinavia are observing earth-


quakes and mining explosions with one of each shown in Fig. 1.7. The general
problem of interest is in distinguishing or discriminating between waveforms gen-
erated by earthquakes and those generated by explosions. Features that may be
important are the rough amplitude ratios of the first phase P to the second phase S,
which tend to be smaller for earthquakes than for explosions. In the case of the
two events in Fig. 1.7, the ratio of maximum amplitudes appears to be somewhat
less than .5 for the earthquake and about 1 for the explosion. Otherwise, note a
subtle difference exists in the periodic nature of the S phase for the earthquake.
We can again think about spectral analysis of variance for testing the equality of
the periodic components of earthquakes and explosions. We would also like to be
able to classify future P and S components from events of unknown origin, leading
to the time series discriminant analysis developed in Chap. 7.
To plot the data as in this example, use the following commands in R:
par(mfrow=c(2,1))
plot(EQ5, main="Earthquake")
plot(EXP6, main="Explosion")
8 1 Characteristics of Time Series

Earthquake

0.4
0.2
EQ5
0.0
−0.4

0 500 1000 1500 2000

Explosion
0.4
0.2
EXP6
0.0
−0.4

0 500 1000 1500 2000


Time

Fig. 1.7. Arrival phases from an earthquake (top) and explosion (bottom) at 40 points per
second

1.2 Time Series Statistical Models


The primary objective of time series analysis is to develop mathematical models that
provide plausible descriptions for sample data, like that encountered in the previous
section. In order to provide a statistical setting for describing the character of data
that seemingly fluctuate in a random fashion over time, we assume a time series can
be defined as a collection of random variables indexed according to the order they are
obtained in time. For example, we may consider a time series as a sequence of random
variables, x1, x2, x3, . . . , where the random variable x1 denotes the value taken by
the series at the first time point, the variable x2 denotes the value for the second
time period, x3 denotes the value for the third time period, and so on. In general, a
collection of random variables, {xt }, indexed by t is referred to as a stochastic process.
In this text, t will typically be discrete and vary over the integers t = 0, ±1, ±2, . . ., or
some subset of the integers. The observed values of a stochastic process are referred
to as a realization of the stochastic process. Because it will be clear from the context
of our discussions, we use the term time series whether we are referring generically to
the process or to a particular realization and make no notational distinction between
the two concepts.
1.2 Time Series Statistical Models 9

It is conventional to display a sample time series graphically by plotting the values


of the random variables on the vertical axis, or ordinate, with the time scale as the
abscissa. It is usually convenient to connect the values at adjacent time periods to
reconstruct visually some original hypothetical continuous time series that might
have produced these values as a discrete sample. Many of the series discussed in
the previous section, for example, could have been observed at any continuous point
in time and are conceptually more properly treated as continuous time series. The
approximation of these series by discrete time parameter series sampled at equally
spaced points in time is simply an acknowledgment that sampled data will, for the
most part, be discrete because of restrictions inherent in the method of collection.
Furthermore, the analysis techniques are then feasible using computers, which are
limited to digital computations. Theoretical developments also rest on the idea that a
continuous parameter time series should be specified in terms of finite-dimensional
distribution functions defined over a finite number of points in time. This is not to
say that the selection of the sampling interval or rate is not an extremely important
consideration. The appearance of data can be changed completely by adopting an
insufficient sampling rate. We have all seen wheels in movies appear to be turning
backwards because of the insufficient number of frames sampled by the camera. This
phenomenon leads to a distortion called aliasing (see Sect. 4.1).
The fundamental visual characteristic distinguishing the different series shown
in Example 1.1–Example 1.7 is their differing degrees of smoothness. One possible
explanation for this smoothness is that it is being induced by the supposition that
adjacent points in time are correlated, so the value of the series at time t, say,
xt , depends in some way on the past values xt−1, xt−2, . . .. This model expresses a
fundamental way in which we might think about generating realistic-looking time
series. To begin to develop an approach to using collections of random variables to
model time series, consider Example 1.8.

Example 1.8 White Noise (3 Flavors)


A simple kind of generated series might be a collection of uncorrelated random
variables, wt , with mean 0 and finite variance σw2 . The time series generated from
uncorrelated variables is used as a model for noise in engineering applications,
where it is called white noise; we shall denote this process as wt ∼ wn(0, σw2 ). The
designation white originates from the analogy with white light and indicates that
all possible periodic oscillations are present with equal strength.
We will sometimes require the noise to be independent and identically dis-
tributed (iid) random variables with mean 0 and variance σw2 . We distinguish this
by writing wt ∼ iid(0, σw2 ) or by saying white independent noise or iid noise.
A particularly useful white noise series is Gaussian white noise, wherein the wt
are independent normal random variables, with mean 0 and variance σw2 ; or more
succinctly, wt ∼ iid N(0, σw2 ). Figure 1.8 shows in the upper panel a collection of
500 such random variables, with σw2 = 1, plotted in the order in which they were
drawn. The resulting series bears a slight resemblance to the explosion in Fig. 1.7
but is not smooth enough to serve as a plausible model for any of the other experi-
10 1 Characteristics of Time Series

white noise

4
3
2
1
w
−1 0
−3

0 100 200 300 400 500


Time
moving average
3
2
1
0
v
−3 −2 −1

0 100 200 300 400 500


Time

Fig. 1.8. Gaussian white noise series (top) and three-point moving average of the Gaussian
white noise series (bottom)

mental series. The plot tends to show visually a mixture of many different kinds of
oscillations in the white noise series.

If the stochastic behavior of all time series could be explained in terms of the
white noise model, classical statistical methods would suffice. Two ways of intro-
ducing serial correlation and more smoothness into time series models are given in
Example 1.9 and Example 1.10.

Example 1.9 Moving Averages and Filtering


We might replace the white noise series wt by a moving average that smooths
the series. For example, considerreplacing wt in Example 1.8 by an average of its
current value and its immediate neighbors in the past and future. That is, let
 
vt = 13 wt−1 + wt + wt+1 , (1.1)

which leads to the series shown in the lower panel of Fig. 1.8. Inspecting the series
shows a smoother version of the first series, reflecting the fact that the slower
oscillations are more apparent and some of the faster oscillations are taken out. We
begin to notice a similarity to the SOI in Fig. 1.5, or perhaps, to some of the fMRI
series in Fig. 1.6.
1.2 Time Series Statistical Models 11

A linear combination of values in a time series such as in (1.1) is referred to,


generically, as a filtered series; hence the command filter in the following code
for Fig. 1.8.
w = rnorm(500,0,1) # 500 N(0,1) variates
v = filter(w, sides=2, filter=rep(1/3,3)) # moving average
par(mfrow=c(2,1))
plot.ts(w, main="white noise")
plot.ts(v, ylim=c(-3,3), main="moving average")

The speech series in Fig. 1.3 and the Recruitment series in Fig. 1.5, as well as
some of the MRI series in Fig. 1.6, differ from the moving average series because one
particular kind of oscillatory behavior seems to predominate, producing a sinusoidal
type of behavior. A number of methods exist for generating series with this quasi-
periodic behavior; we illustrate a popular one based on the autoregressive model
considered in Chap. 3.
Example 1.10 Autoregressions
Suppose we consider the white noise series wt of Example 1.8 as input and calculate
the output using the second-order equation

xt = xt−1 − .9xt−2 + wt (1.2)

successively for t = 1, 2, . . . , 500. Equation (1.2) represents a regression or predic-


tion of the current value xt of a time series as a function of the past two values of the
series, and, hence, the term autoregression is suggested for this model. A problem
with startup values exists here because (1.2) also depends on the initial conditions
x0 and x−1 , but assuming we have the values, we generate the succeeding values by
substituting into (1.2). The resulting output series is shown in Fig. 1.9, and we note
the periodic behavior of the series, which is similar to that displayed by the speech
series in Fig. 1.3. The autoregressive model above and its generalizations can be
used as an underlying model for many observed series and will be studied in detail
in Chap. 3.
As in the previous example, the data are obtained by a filter of white noise.
The function filter uses zeros for the initial values. In this case, x1 = w1 , and
x2 = x1 + w2 = w1 + w2 , and so on, so that the values do not satisfy (1.2). An easy
fix is to run the filter for longer than needed and remove the initial values.
w = rnorm(550,0,1) # 50 extra to avoid startup problems
x = filter(w, filter=c(1,-.9), method="recursive")[-(1:50)] # remove first 50
plot.ts(x, main="autoregression")

Example 1.11 Random Walk with Drift


A model for analyzing trend such as seen in the global temperature data in Fig. 1.2,
is the random walk with drift model given by

xt = δ + xt−1 + wt (1.3)

for t = 1, 2, . . ., with initial condition x0 = 0, and where wt is white noise. The


constant δ is called the drift, and when δ = 0, (1.3) is called simply a random walk.
12 1 Characteristics of Time Series

autoregression

5
0
x
−5

0 100 200 300 400 500


Time

Fig. 1.9. Autoregressive series generated from model (1.2)

The term random walk comes from the fact that, when δ = 0, the value of the time
series at time t is the value of the series at time t − 1 plus a completely random
movement determined by wt . Note that we may rewrite (1.3) as a cumulative sum
of white noise variates. That is,

t
xt = δ t + wj (1.4)
j=1

for t = 1, 2, . . .; either use induction, or plug (1.4) into (1.3) to verify this statement.
Figure 1.10 shows 200 observations generated from the model with δ = 0 and .2,
and with σw = 1. For comparison, we also superimposed the straight line .2t on
the graph. To reproduce Fig. 1.10 in R use the following code (notice the use of
multiple commands per line using a semicolon).
set.seed(154) # so you can reproduce the results
w = rnorm(200); x = cumsum(w) # two commands in one line
wd = w +.2; xd = cumsum(wd)
plot.ts(xd, ylim=c(-5,55), main="random walk", ylab='')
lines(x, col=4); abline(h=0, col=4, lty=2); abline(a=0, b=.2, lty=2)

Example 1.12 Signal in Noise


Many realistic models for generating time series assume an underlying signal with
some consistent periodic variation, contaminated by adding a random noise. For
example, it is easy to detect the regular cycle fMRI series displayed on the top of
Fig. 1.6. Consider the model

xt = 2 cos(2π t+15
50 ) + wt (1.5)

for t = 1, 2, . . . , 500, where the first term is regarded as the signal, shown in the
upper panel of Fig. 1.11. We note that a sinusoidal waveform can be written as

A cos(2πωt + φ), (1.6)


1.2 Time Series Statistical Models 13

random walk

50
40
30
20
10
0

0 50 100 150 200


Time

Fig. 1.10. Random walk, σw = 1, with drift δ = .2 (upper jagged line), without drift, δ = 0
(lower jagged line), and straight (dashed) lines with slope δ

where A is the amplitude, ω is the frequency of oscillation, and φ is a phase shift.


In (1.5), A = 2, ω = 1/50 (one cycle every 50 time points), and φ = 2π15/50 = .6π.
An additive noise term was taken to be white noise with σw = 1 (middle panel)
and σw = 5 (bottom panel), drawn from a normal distribution. Adding the two
together obscures the signal, as shown in the lower panels of Fig. 1.11. Of course,
the degree to which the signal is obscured depends on the amplitude of the signal
and the size of σw . The ratio of the amplitude of the signal to σw (or some function
of the ratio) is sometimes called the signal-to-noise ratio (SNR); the larger the
SNR, the easier it is to detect the signal. Note that the signal is easily discernible in
the middle panel of Fig. 1.11, whereas the signal is obscured in the bottom panel.
Typically, we will not observe the signal but the signal obscured by noise.
To reproduce Fig. 1.11 in R, use the following commands:
cs = 2*cos(2*pi*1:500/50 + .6*pi); w = rnorm(500,0,1)
par(mfrow=c(3,1), mar=c(3,2,2,1), cex.main=1.5)
plot.ts(cs, main=expression(2*cos(2*pi*t/50+.6*pi)))
plot.ts(cs+w, main=expression(2*cos(2*pi*t/50+.6*pi) + N(0,1)))
plot.ts(cs+5*w, main=expression(2*cos(2*pi*t/50+.6*pi) + N(0,25)))

In Chap. 4, we will study the use of spectral analysis as a possible technique for
detecting regular or periodic signals, such as the one described in Example 1.12. In
general, we would emphasize the importance of simple additive models such as given
above in the form
xt = st + vt , (1.7)
where st denotes some unknown signal and vt denotes a time series that may be white
or correlated over time. The problems of detecting a signal and then in estimating or
extracting the waveform of st are of great interest in many areas of engineering and
the physical and biological sciences. In economics, the underlying signal may be a
trend or it may be a seasonal component of a series. Models such as (1.7), where the
14 1 Characteristics of Time Series

2cos(2πt 50 + 0.6π)

2
1
0
−1
−2

0 100 200 300 400 500

2cos(2πt 50 + 0.6π) + N(0, 1)


4
2
0
−4 −2

0 100 200 300 400 500

2cos(2πt 50 + 0.6π) + N(0, 52


)
20
10
0
−10

0 100 200 300 400 500


Time

Fig. 1.11. Cosine wave with period 50 points (top panel) compared with the cosine wave
contaminated with additive white Gaussian noise, σw = 1 (middle panel) and σw = 5 (bottom
panel); see (1.5)

signal has an autoregressive structure, form the motivation for the state-space model
of Chap. 6.
In the above examples, we have tried to motivate the use of various combinations
of random variables emulating real time series data. Smoothness characteristics of
observed time series were introduced by combining the random variables in vari-
ous ways. Averaging independent random variables over adjacent time points, as in
Example 1.9, or looking at the output of difference equations that respond to white
noise inputs, as in Example 1.10, are common ways of generating correlated data.
In the next section, we introduce various theoretical measures used for describing
how time series behave. As is usual in statistics, the complete description involves
the multivariate distribution function of the jointly sampled values x1, x2, . . . , xn ,
whereas more economical descriptions can be had in terms of the mean and autocor-
relation functions. Because correlation is an essential feature of time series analysis,
the most useful descriptive measures are those expressed in terms of covariance and
correlation functions.
1.3 Measures of Dependence 15

1.3 Measures of Dependence

A complete description of a time series, observed as a collection of n random variables


at arbitrary time points t1, t2, . . . , tn , for any positive integer n, is provided by the joint
distribution function, evaluated as the probability that the values of the series are
jointly less than the n constants, c1, c2, . . . , cn ; i.e.,
 
Ft1,t2,...,tn (c1, c2, . . . , cn ) = Pr xt1 ≤ c1, xt2 ≤ c2, . . . , xtn ≤ cn . (1.8)

Unfortunately, these multidimensional distribution functions cannot usually be writ-


ten easily unless the random variables are jointly normal, in which case the joint
density has the well-known form displayed in (1.33).
Although the joint distribution function describes the data completely, it is an
unwieldy tool for displaying and analyzing time series data. The distribution func-
tion (1.8) must be evaluated as a function of n arguments, so any plotting of the
corresponding multivariate density functions is virtually impossible. The marginal
distribution functions
Ft (x) = P{xt ≤ x}
or the corresponding marginal density functions

∂Ft (x)
ft (x) = ,
∂x
when they exist, are often informative for examining the marginal behavior of a
series.3 Another informative marginal descriptive measure is the mean function.

Definition 1.1 The mean function is defined as


∫ ∞
μxt = E(xt ) = x ft (x) dx, (1.9)
−∞

provided it exists, where E denotes the usual expected value operator. When no
confusion exists about which time series we are referring to, we will drop a subscript
and write μxt as μt .

Example 1.13 Mean Function of a Moving Average Series


If wt denotes a white noise series, then μwt = E(wt ) = 0 for all t. The top series in
Fig. 1.8 reflects this, as the series clearly fluctuates around a mean value of zero.
Smoothing the series as in Example 1.9 does not change the mean because we can
write
μvt = E(vt ) = 13 [E(wt−1 ) + E(wt ) + E(wt+1 )] = 0.

3 If x t is Gaussian with mean μt and


 variance σt , abbreviated as x t ∼ N(μt , σt ), the marginal density
2 2

1
is given by ft (x) = √ exp − 2σ 1
2 (x − μt )
2 , x ∈ R.
σt 2π t
16 1 Characteristics of Time Series

Example 1.14 Mean Function of a Random Walk with Drift


Consider the random walk with drift model given in (1.4),

t
xt = δ t + wj, t = 1, 2, . . . .
j=1

Because E(wt ) = 0 for all t, and δ is a constant, we have



t
μxt = E(xt ) = δ t + E(w j ) = δ t
j=1

which is a straight line with slope δ. A realization of a random walk with drift can
be compared to its mean function in Fig. 1.10.

Example 1.15 Mean Function of Signal Plus Noise


A great many practical applications depend on assuming the observed data have
been generated by a fixed signal waveform superimposed on a zero-mean noise
process, leading to an additive signal model of the form (1.5). It is clear, because
the signal in (1.5) is a fixed function of time, we will have

μxt = E(xt ) = E 2 cos(2π t+15
50 ) + wt

50 ) + E(wt )
= 2 cos(2π t+15
50 ),
= 2 cos(2π t+15
and the mean function is just the cosine wave.
The lack of independence between two adjacent values xs and xt can be assessed
numerically, as in classical statistics, using the notions of covariance and correlation.
Assuming the variance of xt is finite, we have the following definition.
Definition 1.2 The autocovariance function is defined as the second moment product
γx (s, t) = cov(xs, xt ) = E[(xs − μs )(xt − μt )], (1.10)
for all s and t. When no possible confusion exists about which time series we are
referring to, we will drop the subscript and write γx (s, t) as γ(s, t). Note that γx (s, t) =
γx (t, s) for all time points s and t.
The autocovariance measures the linear dependence between two points on the
same series observed at different times. Very smooth series exhibit autocovariance
functions that stay large even when the t and s are far apart, whereas choppy series
tend to have autocovariance functions that are nearly zero for large separations. Recall
from classical statistics that if γx (s, t) = 0, xs and xt are not linearly related, but there
still may be some dependence structure between them. If, however, xs and xt are
bivariate normal, γx (s, t) = 0 ensures their independence. It is clear that, for s = t,
the autocovariance reduces to the (assumed finite) variance, because
γx (t, t) = E[(xt − μt )2 ] = var(xt ). (1.11)
1.3 Measures of Dependence 17

Example 1.16 Autocovariance of White Noise


The white noise series wt has E(wt ) = 0 and

σw2 s = t,
γw (s, t) = cov(ws, wt ) = (1.12)
0 s  t.

A realization of white noise with σw2 = 1 is shown in the top panel of Fig. 1.8.

We often have to calculate the autocovariance between filtered series. A useful


result is given in the following proposition.

Property 1.1 Covariance of Linear Combinations


If the random variables

m 
r
U= a j Xj and V = bk Yk
j=1 k=1

are linear combinations of (finite variance) random variables {X j } and {Yk }, respec-
tively, then
m r
cov(U, V) = a j bk cov(X j , Yk ). (1.13)
j=1 k=1

Furthermore, var(U) = cov(U, U).

Example 1.17 Autocovariance of a Moving Average


Consider applying a three-point moving average to the white noise series wt of the
previous example as in Example 1.9. In this case,

γv (s, t) = cov(vs, vt ) = cov 1


3 (ws−1 + ws + ws+1 ) , 13 (wt−1 + wt + wt+1 ) .

When s = t we have

γv (t, t) = 19 cov{(wt−1 + wt + wt+1 ), (wt−1 + wt + wt+1 )}


= 19 [cov(wt−1, wt−1 ) + cov(wt , wt ) + cov(wt+1, wt+1 )]
= 39 σw2 .

When s = t + 1,

γv (t + 1, t) = 19 cov{(wt + wt+1 + wt+2 ), (wt−1 + wt + wt+1 )}


= 19 [cov(wt , wt ) + cov(wt+1, wt+1 )]
= 29 σw2 ,

using (1.12). Similar computations give γv (t − 1, t) = 2σw2 /9, γv (t + 2, t) = γv (t −


2, t) = σw2 /9, and 0 when |t − s| > 2. We summarize the values for all s and t as
Another random document with
no related content on Scribd:
celebrate their mysteries with trembling and terror. Such appalling
accounts of these frightful regions, probably originated with the
Druids themselves, who wished to deter the multitude, by every sort
of dreadful description, from penetrating into the secrets of their
superstitious practices.
Plutarch informs us that a Roman commander named Demetrius
was sent by one of the emperors to an island of the Druids, for the
purpose of making discoveries, but that the Roman adventurers
were repulsed by a strange phenomenon. Immediately on their
arrival, says the account, the heavens grew black; the winds arose;
strange apparitions were seen in the sky; a dreadful tempest sprung
up, and the heavens were filled with fiery spouts and whirlwinds. The
Romans desisted from their attempt, in the dread of being destroyed
for their sacrilegious invasion of a consecrated spot. Probably all this
was nothing more than an ordinary thunder-storm, which the fright of
the Romans magnified into a supernatural occurrence.
The Druids were also addicted to the horrid practice of sacrificing
human victims. These were sometimes criminals who had offended
either the laws or the religious prejudices of the Druids. It often
happened that, when a man’s life was in danger, from sickness or
any other cause, the Druids undertook to secure his safety by a
human sacrifice to their false deities. When criminals could not be
found, innocent persons were taken for victims. Huge hollow piles of
osier twigs, bark or hay were erected, and filled with these unhappy
wretches; after which the whole was set on fire and consumed.
Under the guidance of the Druids, the people at their funerals burnt
the bodies of the dead, and threw into the blazing pile all their most
valuable property, and even their servants and slaves. Sometimes
the near relatives of the deceased burnt themselves with their
friends, in the manner practised at the present day by the Hindoo
widows.
The Druids extended their worship over the greater part of the
modern kingdom of France, which was then named Gaul, the
southern part of the island of Great Britain, and the island of
Hibernia, now Ireland. Their most celebrated abode was the island of
Mona, now called Anglesey, on the coast of Wales. In this island are
some remains of the Druidical superstition, consisting of immense
blocks of stone, supposed to have been altars. The celebrated
structure in the south of England, known by the name of
Stonehenge, is also considered a remnant of Druidical architecture,
though we are not positive that the Druids ever performed their
worship in temples.
From all the accounts transmitted to us by the ancient writers, it is
pretty evident that the Druids were possessed of considerable
knowledge for so barbarous an age, and that they made all possible
use of this knowledge to perpetuate their authority and keep the rest
of the people in ignorance of the true character of their religious
mysteries. Their influence, wherever they prevailed, was very great.
When the Romans invaded Britain, they found the inhabitants almost
entirely subject to their control. The Druids offered an obstinate
resistance to the Romans, and incited the Britons, on many
occasions, to revolt against them. The Romans perceived at length
that the subjugation of the island would never be effected until the
Druids were entirely extirpated. They therefore waged a war of
extermination against them, put them to death in every quarter, and
the last of the race having fled for shelter to Anglesey, the Romans
crossed over to that island, destroyed their idols, cut down their
groves, and burnt the priests to death, as they had been accustomed
to burn their victims. Such was the end of the race and religion of the
Druids.

Plain Dealing.—An impertinent fellow asked Lord Guilford, who


that plain lady was before him. “That lady,” said his lordship, “is my
wife. It is true, she is a plain woman, I am a plain man, you are a
plain dealer, and that is the plain truth.”
Hospital of the Invalides, where Napoleon’s body is now entombed.
Paris.
The Re-entombment of Napoleon.

Of all the great and remarkable men of modern times, Napoleon


Bonaparte was the most wonderful. He was a son of a lawyer of
Corsica, an island in the Mediterranean sea, belonging to France.
From a humble station he rose to be the emperor of France, and the
greatest general of modern times. He hurled kings from their
thrones, and put others in their places. He dismembered empires,
and created new ones. He made the whole earth ring with his mighty
deeds. But one thing he could not do—he could not conquer himself.
His ambition led him on from one step of injustice to another, till the
embattled armies of Europe appeared in the field against him. He
was defeated, dethroned, and taken on board a British ship to the
rocky and lonely island of St. Helena, where he died in 1821.
After being entombed for almost twenty years, the king, Louis
Philippe, sent out a ship to bring back his body to France, to be re-
entombed in the capital of the empire of which he once swayed the
sceptre. The hearts of many of the French people adore the name of
Napoleon; and the ceremony of his re-entombment, which has just
taken place at Paris, is the theme of the fallowing lines.
Sound the trumpet, roll the drum!
Come in long procession, come!
Come with sword and come with lance,
Children of heroic France;
Come from castle’s frowning wall,
Come from the ancestral hall,
Come, poor peasant, from thy shed,
Cowled monk and crowned head!
From the hamlet’s green retreat,
From the city’s crowded street,
From the proud Tuilleries’ door
Let the royal escort pour;
Duke and baron, king and queen,
Gather to the august scene;
In your purple pomp arrayed,
Haste to swell the grand parade.
Brow of snow and locks of gold,
Matron, maiden, young and old!
Sound the trumpets, roll the drum,
For Napoleon’s ashes come!

Sound the trumpet, roll the drum!


Let the cannon be not dumb;
Charge your black guns to the brim,
Invalides! to welcome him!
War-worn veterans, onward march
To Etoiles’ towering arch.
Let the column of Vendome,
Let the Pantheon’s soaring dome,
Champs de Mars and Elysees,
Hear the clang of arms to-day;
Let the Luxembourg once more
Hear Napoleon’s cannon roar.
Bring the eagles forth that flew
O’er the field of Waterloo,
Bring his tattered banners, red
With the blood at Jena shed,
Scorched with fire and torn with steel,
Rent by battle’s crushing heel,
When the fight o’er Moscow pealed,
And Marengo’s sanguine field;
Sound the clarion’s wildest strain,
For the conqueror comes again!

Sound a sad funereal wail


For the warrior stark and pale!
Hussar and dark cuirassier,
Lancer and fierce grenadier;
Soldiers of the Seine and Rhone,
Join the universal moan.
Conscripts who have never yet
In the front of battle met,
Join your sorrows to the grief
Of these veterans for their chief!
Veterans, raise your brows the while,
As of yore by Rhine and Nile;
Show the frequent ghastly scar
Won in following him to war;
Tell the fields where you have bled,
Left a limb, or heart’s-blood shed;
And remembering each brave year,
March on proudly by his bier——
Forth with drooping weapons come
To the rolling of the drum!

Let the city’s busy hum


Cease when rolls the muffled drum;
Let no light laugh, no rude sound,
E’er disturb the hush profound!
Only let the swinging bell
Of St. Roche peal out its knell.
Silence! on his rolling car
Comes the favored Child of war!
Not as in the olden days,
With his forehead bound with bays,
With the bright sword in his hand,
Encircled with his ancient band.
Long the sceptre and the crown
At the grave hath he laid down.
Now with coffin and with shroud
Comes the chieftain once so proud.
On his pale brow, on his cheek,
Death hath set his signet bleak,
And the dead alone doth crave
Rest and silence in the grave.
Sound the trumpet, roll the drum,
Bear his ashes to the tomb!
What is Truth?

Truth is conformity to fact, in a statement or representation. If I


say that London is the largest city in the world, my statement
conforms to fact, and is therefore true. If I say that Boston has more
inhabitants than New York, my statement does not conform to fact,
and therefore is not true. There is one thing more to be considered,
which is, that the statement must conform to fact in the sense in
which it is meant to be understood. If I say a thing which is literally
true, but which is not true in the sense in which I mean it to be
understood, then I am guilty of falsehood, because I intend to
deceive. The following story will illustrate this.
Two boys, who had been studying geography, were walking
together one evening, when one of them exclaimed, “How bright the
sun shines!” The other boy immediately replied that, as it was
evening, the sun did not shine. The first boy insisted that it did shine;
whereupon a dispute arose, one of the boys insisting that the sun did
shine, the other that it did not. At last, they agreed to leave the point
to their father, and accordingly they went to him and stated the case.
They both agreed that it was nine o’clock at night; that the stars were
glittering in the sky; that the sun had been down for nearly two hours;
and yet John, the elder of the boys, maintained that, at that moment,
the sun was shining as bright as at noon-day.
When his father demanded an explanation, John said that the
geography he had just been studying, stated that when it was night
here, it was day in China—“and now,” said he, “of course the sun is
shining there, though it is night here. I said that the sun shines, and
so it does.”
To this the father replied as follows: “What you say now, John, is
true, but still, what you said to James was a falsehood. You knew
that he understood you to say that the sun shone here—you meant
that he should so understand you; you meant to convey a statement
to his mind that did not conform to fact, and which was therefore
untrue. You had a reservation in your own mind, which you withheld
from James. You did not say to him that you restricted your
statement to China—that was no part of your assertion. Truth
requires us not only to watch over our words, but the ideas we
communicate. If we intentionally communicate ideas which are false,
then we are guilty of falsehood. Now you said to James that which
was untrue, according to the sense in which you knew he would, and
in which you intended he should, receive it, and therefore you meant
to violate the truth. I must accordingly decide against John, and in
favor of James. John was wrong, and James is right. The sun did not
shine as John said it did, and as James understood him to say it
did.”
There are many other cases which illustrate this “truth to the letter
and lie to the sense.” Some years since, during the laws against
travelling on the Sabbath, a man was riding on horseback near
Worcester, in Massachusetts. It chanced to be of a Sunday morning,
and the traveller was soon stopped by a tythingman, who demanded
his reason for riding on the Lord’s day, and thus violating the law.
“My father lies dead in Sutton,” said the other, “and I hope you will
not detain me.”
“Certainly not,” said the tythingman, “under these circumstances;”
and accordingly he allowed the man to proceed. About two days
after, the traveller was returning, and happened to meet the
tythingman in the road. The two persons recognised each other, and
accordingly the following conversation ensued:
“You passed here on Sunday morning, I think, sir,” said the
tythingman.
“Yes, sir,” said the traveller.
“And you told me you were going to your father’s funeral—pray
when did he die?”
“I did not say I was going to my father’s funeral—I said he lay
dead in Sutton, and so he did; but he has been dead for fifteen
years.”
Thus you perceive that while the words of the traveller were
literally true, they conveyed an intentional falsehood to the
tythingman, and therefore the traveller was guilty of deception. I
know that people sometimes think these tricks very witty, but they
are very wicked. Truth would be of no value, if it might be used for
the purposes of deception; it is because truth forbids all deception,
and requires open dealing, that it is so much prized. It is always a
poor bargain to give away truth for the sake of a momentary
advantage, or for the purpose of playing off an ingenious trick. To
barter truth for fun or mischief is giving away gold for dross. Every
time a person tells a lie, or practises a deception, he inflicts an injury
upon his mind, not visible to the eye of man, but as plain to the eye
of God as a scar upon the flesh. By repeated falsehoods, a person
may scar over his whole soul, so as to make it offensive in the sight
of that Being, whose love and favor we should seek, for his
friendship is the greatest of all blessings.
Varieties.

A Child’s Affection for a Kitten.—A short time since, a little


girl, daughter of Mr. Alexander Rice, lost her life through her affection
for a kitten. She had followed a small boy to the river, weeping
bitterly because he was about to drown a kitten for which she had
formed a strong attachment; and no sooner was it tossed into the
water, than the agonized child took off its shoes, and, raising its
clothes, walked into the river with a firm and determined step,
towards the object of her affection; but, before reaching it, she
suddenly sank into deep water, and her gentle spirit returned to the
God who gave it.

A Musical Mouse. —One evening, as some officers on board a


British man-of-war were seated round the fire, one of them began to
play a plaintive air on a violin. He had scarcely played ten minutes,
when a mouse, apparently frantic, made its appearance in the centre
of the floor. The strange gestures of the little animal strongly excited
the attention of the officers, who, with one consent, resolved to let it
continue its singular actions unmolested. Its exertions now appeared
to be greater every moment; it shook its head, leaped about the
table, and exhibited signs of the most ecstatic delight. It was
observed, that in proportion to the gradation of the tones to the soft
point, the feelings of the animal appeared to be increased. After
performing actions, which so diminutive an animal would, at first
sight, seem incapable of, the little creature, to the astonishment of
the spectators, suddenly ceased to move, fell down, and expired,
without any symptoms of pain.

Travelling Cats.—A lady residing in Glasgow, Scotland, had a


handsome cat sent to her from Edinburgh. It was conveyed to her in
a close basket, and in a carriage. She was carefully watched for two
months, but, having produced a pair of young ones at the end of that
time, she was left at her own discretion, which she very soon
employed in disappearing with both her kittens. The lady at Glasgow
wrote to her friend in Edinburgh, deploring her loss; and the cat was
supposed to have formed some new attachment, with as little
reflection as men and women sometimes do.
About a fortnight, however, after her disappearance at Glasgow,
her well-known mew was heard at the street-door of her old mistress
in Edinburgh, and there she was, with both her kittens! they in the
best state, but she very thin. It is clear, that she could carry only one
kitten at a time. The distance from Glasgow to Edinburgh is forty
miles; so that, if she brought one kitten part of the way, and then
went back for the other, and thus conveyed them alternately, she
must have travelled one hundred and twenty miles at least. Her
prudence must likewise have suggested the necessity of journeying
in the night, with many other precautions for the safety of her young.

A Musical Pigeon.—Bertoni, a famous instructor in music, while


residing in Venice, took a pigeon for his companion, and, being very
fond of birds, made a great pet of it. The pigeon, by being constantly
in his master’s company, obtained so perfect an ear for music, that
no one who saw his behavior could doubt for a moment of the
pleasure the bird took in hearing him play and sing.

Swiftness of Birds.—A vulture can fly at the rate of one


hundred and fifty miles an hour. Observations on the coast of
Labrador convinced Major Arkwright, that wild geese could travel at
the rate of ninety miles an hour. The common crow can fly twenty-
five miles, and swallows ninety-two miles, an hour. It is said, that a
falcon, belonging to Henry the Fourth, was discovered at Malta,
twenty-four hours after its departure from Fontainebleau. If true, this
bird must have flown, for twenty-four hours, at the rate of fifty-seven
miles an hour, not allowing him to rest a moment during the whole
time.
A Brave Irishman.—An Irishman, who was a soldier of the
Revolution, and of Warren’s brigade, was suddenly stopped near
Boston by a party, during a dark night; a horseman’s pistol was
presented to his breast, and he was asked to which side he
belonged. The supposition that it might be a British party, rendered
his situation extremely critical. He replied, “I think it would be more in
the way of civility, just to drop a hint which side you are pleased to
favor.” “No,” testily said the first speaker; “declare your sentiments,
or die!” “Then I will not die with a lie in my mouth. American, to
extremity! Do your worst, you spalpeen!” The officer replied, “We are
your friends; and I rejoice to meet with a man so faithful to the cause
of his country.”

Searching for hidden Gold.—Kidd was a famous sea robber


on the American coast, and many people believe that he buried large
pots or chests of gold, somewhere along the shore. A number of
laborers, believers of this legend, at work in a field, accidentally
discovered, upon the top of a large stone, an inscription in ancient
characters, which, on deciphering, read as follows:
“Take me up, and I will tell you more.”
Eager for the money, and entertaining no doubt of their being
close upon it, they immediately set about raising the stone. After
tugging and toiling several hours, they finally succeeded, and with
some difficulty read on the bottom,
“Lay me down as I was before.”

Ready Wit.—A countryman the other day, for information, asked


an Hibernian, who was busily engaged in the street driving down
stones, “Pat, when will you get this street done?” “How did you know
my name was Pat?” inquired the Irishman. “Why, I guessed as
much.” “Then,” replied Pat, “since you are good at guessing, you
may guess when the street will be finished.”
Monument of Affection.—There is a monument near
Copenhagen, erected by Count Schimmelman, called “The Weeping
Eye.” That nobleman’s grief for the death of his wife was so
excessive, that he caused a statue to be erected over a spring, and
made the water spout from the eye, as a continual flood of tears.
JACK FROST, A SONG
the words and music composed for
merry’s museum.
Andante.

Who hath killed the pretty flow’rs,


Born and bred in summer bowers;
Who hath ta’en away their bloom
Who hath swept them to the tomb?
Jack Frost, Jack Frost.

Who hath chased the birds so gay,


Lark and linnet, all away?
Who hath hushed their joyous breath,
And made the woodland still as death?
Jack Frost—Jack Frost.

Who hath chilled the laughing river?


Who doth make the old oak shiver?
Who hath wrapped the world in snow?
Who doth make the wild winds blow?
Jack Frost—Jack Frost.

Who doth ride on snowy drift


When the night wind’s keen and swift—
O’er the land and o’er the sea—
Bent on mischief—who is he?
Jack Frost—Jack Frost.

Who doth strike with icy dart,


The way-worn traveller to the heart?
Who doth make the ocean-wave—
The seaman’s home—the seaman’s grave?
Jack Frost—Jack Frost.

Who doth prowl at midnight hour


Like a thief around the door,
Through each crack and crevice creeping,
Through the very key-hole peeping?
Jack Frost—Jack Frost.

7
Who doth pinch the traveller’s toes?
Who doth wring the school-boy’s nose?
Who doth make your fingers tingle?
Who doth make the sleigh bells jingle?
Jack Frost—Jack Frost.
ROBERT MERRY’S MUSEUM.

You might also like