Table Of ContentSpatio-Temporal
Statistics with R
Chapman & Hall/CRC
The R Series
Series Editors
John M. Chambers, Department of Statistics, Stanford University Stanford, California, USA
Torsten Hothorn, Division of Biostatistics, University of Zurich, Switzerland
Duncan Temple Lang, Department of Statistics, University of California, Davis, California, USA
Hadley Wickham, RStudio, Boston, Massachusetts, USA
Recently Published Titles
Using the R Commander: A Point-and-Click Interface for R
John Fox
Computational Actuarial Science with R
Arthur Charpentier
bookdown: Authoring Books and Technical Documents with R Markdown,
Yihui Xie
Testing R Code
Richard Cotton
R Primer, Second Edition
Claus Thorn Ekstrøm
Flexible Regression and Smoothing: Using GAMLSS in R
Mikis D. Stasinopoulos, Robert A. Rigby, Gillian Z. Heller, Vlasios Voudouris, and Fernanda De Bastiani
The Essentials of Data Science: Knowledge Discovery Using R
Graham J. Williams
blogdown: Creating Websites with R Markdown
Yihui Xie, Alison Presmanes Hill, and Amber Thomas
Handbook of Educational Measurement and Psychometrics Using R
Christopher D. Desjardins and Okan Bulut
Displaying Time Series, Spatial, and Space-Time Data with R, Second Edition
Oscar Perpinan Lamigueiro
Reproducible Finance with R: Code Flows and Shiny Apps for Portfolio Analysis
Jonathan K. Regenstein, Jr
R Markdown: The Definitive Guide
Yihui Xie, J.J. Allaire and Garrett Grolemund
R Graphics, Third Edition
Paul Murrell
Practical R for Mass Communication and Journalism
Sharon Machlis
Analyzing Baseball Data with R, Second Edition
Max Marchi, Jim Albert, and Benjamin S. Baumer
Spatio-Temporal Statistics with R
Christopher K. Wikle, Andrew Zammit-Mangion, and Noel Cressie
For more information about this series, please visit: https://www.crcpress.com/go/the-r-series
Spatio-Temporal
Statistics with R
CHRISTOPHER K. WIKLE
ANDREW ZAMMIT-MANGION
NOEL CRESSIE
Cover Illustration: Julinu (Julian Mallia)
www.julinu.com
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
© 2019 by Taylor & Francis Group, LLC
CRC Press is an imprint of Taylor & Francis Group, an Informa business
No claim to original U.S. Government works
Printed on acid-free paper
Version Date: 20181220
International Standard Book Number-13: 978-1-138-71113-6 (Hardback)
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been
made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity
of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright
holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this
form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may
rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized
in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying,
microfilming, and recording, or in any information storage or retrieval system, without written permission from the
publishers.
For permission to photocopy or use material electronically from this work, please access www.copyright.com
(http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers,
MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of
users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been
arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for
identification and explanation without intent to infringe.
Library of Congress Cataloging-in-Publication Data
Names: Wikle, Christopher K., 1963- author. | Zammit-Mangion, Andrew, author.
| Cressie, Noel A. C., author.
Title: Spatio-temporal statistics with R / Christopher K. Wikle, Andrew
Zammit-Mangion, Noel Cressie.
Description: Boca Raton, Florida : CRC Press, [2019] | Includes
bibliographical references and index.
Identifiers: LCCN 2018048440| ISBN 9781138711136 (hardback : alk. paper) |
ISBN 9781351769723 (e-book : alk. paper)
Subjects: LCSH: Spatial analysis (Statistics) | Statistics. | R (Computer
program language)
Classification: LCC QA278.2 .W55 2019 | DDC 519.5/37--dc23
LC record available at https://lccn.loc.gov/2018048440
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
and the CRC Press Web site at
http://www.crcpress.com
Contents
Acknowledgements ix
Preface xiii
1 IntroductiontoSpatio-TemporalStatistics 1
1.1 WhyShouldSpatio-TemporalModelsBeStatistical? . . . . . . . . . . . . 6
1.2 GoalsofSpatio-TemporalStatistics . . . . . . . . . . . . . . . . . . . . . 7
1.2.1 TheTwoDsofSpatio-TemporalStatisticalModeling . . . . . . . . 7
1.2.2 DescriptiveModeling . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.3 DynamicModeling . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 HierarchicalStatisticalModels . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4 StructureoftheBook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2 ExploringSpatio-TemporalData 17
2.1 Spatio-TemporalData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2 RepresentationofSpatio-TemporalDatainR . . . . . . . . . . . . . . . . 22
2.3 VisualizationofSpatio-TemporalData . . . . . . . . . . . . . . . . . . . . 24
2.3.1 SpatialPlots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.3.2 Time-SeriesPlots . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.3.3 HovmöllerPlots . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.3.4 InteractivePlots. . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.3.5 Animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.3.6 Trelliscope: VisualizingLargeSpatio-TemporalDataSets . . . . . 29
2.3.7 VisualizingUncertainty . . . . . . . . . . . . . . . . . . . . . . . 31
2.4 ExploratoryAnalysisofSpatio-TemporalData . . . . . . . . . . . . . . . 32
2.4.1 EmpiricalSpatialMeansandCovariances . . . . . . . . . . . . . . 33
2.4.2 Spatio-TemporalCovariogramsandSemivariograms . . . . . . . . 36
2.4.3 EmpiricalOrthogonalFunctions(EOFs) . . . . . . . . . . . . . . . 39
2.4.4 Spatio-TemporalCanonicalCorrelationAnalysis . . . . . . . . . . 47
2.5 Chapter2Wrap-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Lab2.1: DataWrangling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
v
vi Contents
Lab2.2: Visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Lab2.3: ExploratoryDataAnalysis . . . . . . . . . . . . . . . . . . . . . . . . 67
3 Spatio-TemporalStatisticalModels 77
3.1 Spatio-TemporalPrediction . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3.2 Regression(Trend-Surface)Estimation . . . . . . . . . . . . . . . . . . . . 84
3.2.1 ModelDiagnostics: DependentErrors . . . . . . . . . . . . . . . . 88
3.2.2 ParameterInferenceforSpatio-TemporalData . . . . . . . . . . . 93
3.2.3 VariableSelection . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.3 Spatio-TemporalForecasting . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.4 Non-GaussianErrors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.4.1 GeneralizedLinearModelsandGeneralizedAdditiveModels . . . 101
3.5 HierarchicalSpatio-TemporalStatisticalModels . . . . . . . . . . . . . . . 104
3.6 Chapter3Wrap-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Lab3.1: DeterministicPredictionMethods . . . . . . . . . . . . . . . . . . . . . 106
Lab3.2: TrendPrediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Lab3.3: RegressionModelsforForecasting . . . . . . . . . . . . . . . . . . . . 125
Lab3.4: GeneralizedLinearSpatio-TemporalRegression . . . . . . . . . . . . . 130
4 DescriptiveSpatio-TemporalStatisticalModels 137
4.1 AdditiveMeasurementErrorandProcessModels . . . . . . . . . . . . . . 138
4.2 PredictionforGaussianDataandProcesses . . . . . . . . . . . . . . . . . 139
4.2.1 Spatio-TemporalCovarianceFunctions . . . . . . . . . . . . . . . 143
4.2.2 Spatio-TemporalSemivariograms . . . . . . . . . . . . . . . . . . 150
4.2.3 GaussianSpatio-TemporalModelEstimation . . . . . . . . . . . . 151
4.3 Random-EffectsParameterizations . . . . . . . . . . . . . . . . . . . . . . 154
4.4 Basis-FunctionRepresentations. . . . . . . . . . . . . . . . . . . . . . . . 157
4.4.1 RandomEffectswithSpatio-TemporalBasisFunctions . . . . . . . 158
4.4.2 RandomEffectswithSpatialBasisFunctions . . . . . . . . . . . . 161
4.4.3 RandomEffectswithTemporalBasisFunctions . . . . . . . . . . . 162
4.4.4 ConfoundingofFixedEffectsandRandomEffects . . . . . . . . . 164
4.5 Non-GaussianDataModelswithLatentGaussianProcesses . . . . . . . . 165
4.5.1 GeneralizedAdditiveModels(GAMs) . . . . . . . . . . . . . . . . 166
4.5.2 InferenceforSpatio-TemporalHierarchicalModels . . . . . . . . . 167
4.6 Chapter4Wrap-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Lab4.1: Spatio-TemporalKrigingwithgstat . . . . . . . . . . . . . . . . . . . 172
Lab4.2: Spatio-TemporalBasisFunctionswithFRK . . . . . . . . . . . . . . . 175
Lab4.3: TemporalBasisFunctionswithSpatioTemporal . . . . . . . . . . . . . 180
Lab4.4: Non-GaussianSpatio-TemporalGAMswithmgcv . . . . . . . . . . . . 189
Lab4.5: Non-GaussianSpatio-TemporalModelswithINLA . . . . . . . . . . . 192
Contents vii
5 DynamicSpatio-TemporalModels 205
5.1 GeneralDynamicSpatio-TemporalModels . . . . . . . . . . . . . . . . . 206
5.1.1 DataModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
5.1.2 ProcessModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
5.1.3 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
5.2 LatentLinearGaussianDSTMs . . . . . . . . . . . . . . . . . . . . . . . 209
5.2.1 LinearDataModelwithAdditiveGaussianError . . . . . . . . . . 209
5.2.2 Non-GaussianandNonlinearDataModel . . . . . . . . . . . . . . 212
5.2.3 ProcessModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
5.3 ProcessandParameterDimensionReduction . . . . . . . . . . . . . . . . 218
5.3.1 ParameterDimensionReduction . . . . . . . . . . . . . . . . . . . 218
5.3.2 DimensionReductionintheProcessModel . . . . . . . . . . . . . 222
5.4 NonlinearDSTMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
5.5 Chapter5Wrap-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Lab5.1: ImplementinganIDEModelinOne-DimensionalSpace . . . . . . . . 229
Lab5.2: Spatio-TemporalInferenceusingtheIDEModel . . . . . . . . . . . . . 234
Lab5.3: Spatio-TemporalInferencewithUnknownEvolutionOperator . . . . . 244
6 EvaluatingSpatio-TemporalStatisticalModels 253
6.1 ComparingModelOutputtoData: WhatDoWeCompare? . . . . . . . . . 254
6.1.1 ComparisontoaSimulated“True”Process . . . . . . . . . . . . . 255
6.1.2 PredictiveDistributionsoftheData . . . . . . . . . . . . . . . . . 256
6.1.3 ValidationandCross-Validation . . . . . . . . . . . . . . . . . . . 258
6.2 ModelChecking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
6.2.1 ExtensionsofRegressionDiagnostics . . . . . . . . . . . . . . . . 260
6.2.2 GraphicalDiagnostics . . . . . . . . . . . . . . . . . . . . . . . . 262
6.2.3 SensitivityAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . 266
6.3 ModelValidation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
6.3.1 PredictiveModelValidation . . . . . . . . . . . . . . . . . . . . . 268
6.3.2 Spatio-TemporalValidationStatistics . . . . . . . . . . . . . . . . 269
6.3.3 Spatio-TemporalCross-ValidationMeasures . . . . . . . . . . . . 272
6.3.4 ScoringRules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
6.3.5 FieldComparison . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
6.4 ModelSelection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
6.4.1 ModelAveraging . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
6.4.2 ModelComparisonviaBayesFactors . . . . . . . . . . . . . . . . 283
6.4.3 ModelComparisonviaValidation . . . . . . . . . . . . . . . . . . 283
6.4.4 InformationCriteria . . . . . . . . . . . . . . . . . . . . . . . . . 284
6.5 Chapter6Wrap-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Lab6.1: Spatio-TemporalModelValidation . . . . . . . . . . . . . . . . . . . . 289
viii Contents
Pergimus(Epilogue) 303
Appendices 307
A SomeUsefulMatrix-AlgebraDefinitionsandProperties . . . . . . . . . . . 307
B GeneralSmoothingKernels . . . . . . . . . . . . . . . . . . . . . . . . . . 311
C EstimationandPredictionforDynamicSpatio-TemporalModels . . . . . . 312
C.1 Estimation in Vector Autoregressive Spatio-Temporal Models via
theMethodofMoments . . . . . . . . . . . . . . . . . . . . . . . 312
C.2 PredictionandEstimationinFullyParameterizedLinearDSTMs . 313
C.3 EstimationforNon-GaussianandNonlinearDSTMs . . . . . . . . 318
D MechanisticallyMotivatedDynamicSpatio-TemporalModels . . . . . . . 318
D.1 ExampleofaProcessModelMotivatedbyaPDE:FiniteDifferences318
D.2 ExampleofaProcessModelMotivatedbyaPDE:Spectral . . . . . 320
D.3 ExampleofaProcessModelMotivatedbyanIDE . . . . . . . . . 321
E Case Study: Physical-Statistical Bayesian Hierarchical Model for Predict-
ingMediterraneanSurfaceWinds . . . . . . . . . . . . . . . . . . . . . . 323
F Case Study: Quadratic Echo State Networks for Sea Surface Temperature
Long-LeadPrediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
ListofRPackages 351
References 355
SubjectIndex 367
AuthorIndex 373
RFunctionIndex 377
Acknowledgements
WhenNoelandIfinishedthemulti-yearprojectthatbecameStatisticsforSpatio-Temporal
Data in 2010, I’m pretty sure I didn’t think that I would be writing another book on this
topic! But, it’s eight years later and here we are .... It has been a great pleasure to work
with Andrew and Noel on this project and I thank them deeply for all of the stimulating
discussion,idea-sharing,advice,andhardworktheyputintothisproject. Ilearnedagreat
deal and it could never have happened without them! In particular, Andrew has worked
magictomaketheRLabsintegrateintothemethodologicalcontent,andthisisthefeature
ofthebookthatmakesitunique. Iwanttothankmyspatio-temporalcolleaguesatMizzou
(ScottHolan,SakisMicheas,andErinSchliep)aswellasstudentsandpostdocswhohave
continued to make this an exciting and fun topic in which to work. My eternal thanks
to Olivia, Nathan, and Andrea for their support of this project and all it entailed and for
enrichingmylifealways! Last,andmostimportantly,IwouldliketothankCarolyn,whois
onthe“frontlines”ofdealingwiththeeffectsofthesesortsofprojects,andalwaysprovides
tremendoussupport, sanity, andencouragement alongtheway. Icouldnotdowhat Idoif
itwerenotforher!
C.K.W.
More than ten years have passed since the day when I was sitting opposite my honors
thesis supervisor, Simon Fabri, at the University of Malta with a scholarship offer from
the University of Sheffield in my hand, and a pen in the other. “What is spatio-temporal
modeling,andisthereanyfutureinit?” Imumbledinquisitively. Itislargelythankstohis
reply and my PhD supervisor Visakan Kadirkamanathan that I took an interest in spatio-
temporal modeling, and in the field of statistics in general. Since then, I have had other
mentorsfromnumerousdisciplines,fromstatisticstocomputerscienceandgeography,and
Iwouldliketothankthemallfortheiradviceandfortheopportunitiestheyhaveprovided
me with; they include Guido Sanguinetti, Jonathan Rougier, Jonathan Bamber, and more
recentlyNoelCressie.
InthelasttenyearsIhavehadtheprivilegetoworkandhavediscussionswithseveral
other colleagues with similar interests. Some of these have inspired my work in several
ways;theyincludeTaraBaldacchino,ParhamAram,MichaelDewar,KennethScerri,Sean
ix