state Space-Time-Series-Analysis

state Space-Time-Series-Analysis

(Parte 1 de 5)

An Introduction to State Space Time Series Analysis

Practical Econometrics

Series Editors Jurgen Doornik and Bronwyn Hall

Practical econometrics is a series of books designed to provide accessible and practical introductions to various topics in econometrics. From econometric techniques to econometric modelling approaches, these short introductions are ideal for applied economists, graduate students, and researchers looking for a non-technical discussion on specific topics in econometrics.

An Introduction to State Space Time Series Analysis

Jacques J. F. Commandeur Siem Jan Koopman

3 Great Clarendon Street, Oxford ox2 6DP

Oxford University Press is a department of the University of Oxford. It furthers the University’s objective of excellence in research, scholarship, and education by publishing worldwide in

Oxford New York

Auckland Cape Town Dar es Salaam Hong Kong Karachi Kuala Lumpur Madrid Melbourne Mexico City Nairobi New Delhi Shanghai Taipei Toronto

With offices in

Argentina Austria Brazil Chile Czech Republic France Greece Guatemala Hungary Italy Japan Poland Portugal Singapore South Korea Switzerland Thailand Turkey Ukraine Vietnam

Oxford is a registered trademark of Oxford University Press in the UK and in certain other countries

Published in the United States by Oxford University Press Inc., New York

© Jacques J.F. Commandeur and Siem Jan Koopman 2007

The moral rights of the authors have been asserted Database right Oxford University Press (maker)

First published 2007

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, without the prior permission in writing of Oxford University Press, or as expressly permitted by law, or under terms agreed with the appropriate reprographics rights organization. Enquiries concerning reproduction outside the scope of the above should be sent to the Rights Department, Oxford University Press, at the address above

You must not circulate this book in any other binding or cover and you must impose the same condition on any acquirer

British Library Cataloguing in Publication Data Data available

Library of Congress Cataloging in Publication Data Data available

Typeset by SPI Publisher Services, Pondicherry, India Printed in Great Britain on acid-free paper by Biddles Ltd., King’s Lynn, Norfolk

Preface

This book provides an introductory treatment of state space methods applied to unobserved-component time series models which are also known as structural time series models. The book started as a collection of personal notes made by JJFC about what he discovered and understood while studying state space methods for the first time. When colleagues and friends also found these notes useful and helpful, the idea came up to make them publicly available. SJK started to cooperate with JJFC on this book project as part of the highly enjoyable joint projects for the SWOV Institute for Road Safety Research in Leidschendam, the Netherlands.

Harvey (1989) and Durbin and Koopman (2001) treat the topic of state space methods at an advanced level suitable for postgraduate and advanced graduate courses in time series analysis. Elementary time series books, on the other hand, provide only very limited space to the class of unobserved-component models. Most of the attention is given to the Box–Jenkins approach to time series analysis.

The intended audience for this book is practitioners and researchers working in areas other than statistics, but who use time series on a daily basis in areas such as the social sciences, quantitative history, biology and medicine. This book offers a step-by-step approach to the analysis of the salient features in time series such as the trend, seasonal and irregular components. Practical problems such as forecasting and missing values are treated in some detail. The book may also serve as an accompanying textbook for a basic time series course in econometrics and statistics, typically at an undergraduate level.

JJFC would like to acknowledge and thank the management and the colleagues of the SWOV Institute for Road Safety Research for their mental and financial contribution to this publication. The book is an important component of the SWOV Research Programme 2003–2006.

Among all SWOV colleagues, JJFC is especially indebted to Frits Bijleveld, whose never abating and infectious enthusiasm for state space

Preface methods was instrumental in stimulating JJFC to write this book. He was always willing to answer any questions JJFC had, and is a genius in exploiting the enormous flexibility that state space methods have to offer.

The authors are grateful to a referee for his positive remarks on an earlier draft of the book. His many constructive comments have improved the book considerably. Any mistakes and omissions remain the sole responsibility of the authors.

JJFC also wishes to thank members (some of them, former members) of the International Co-operation on Time Series Analysis (ICTSA): Peter Christens, Ruth Bergel, Joanna Zukowska, Filip Van den Bossche, Geert Wets, Stefan Hoeglinger, Ward Vanlaar, Phillip Gould, Max Cameron, and Stewart Newstead, for their inspiring contributions to our in-depth discussions on time series analysis, and for their encouraging response to earlier drafts of the book.

SJK would like to thank his colleagues at the Department of Econometrics, Vrije Universiteit Amsterdam, for giving him the opportunity to work on this book.

The book was written in LATEXusing the MiKTeX system http://www.miktex.org We thank Frits Bijleveld for his assistance in setting up the LATEXsystem. The Ox and SsfPack code for carrying out the analyses discussed in the book, as well as the data files, can be downloaded from http://staff.feweb.vu.nl/koopman and from http://www.ssfpack.com

Contents

List of Figures x List of Tables xiv

2. The local level model 9 2.1. Deterministic level 10 2.2. Stochastic level 15 2.3. The local level model and Norwegian fatalities 18

3. The local linear trend model 21 3.1. Deterministic level and slope 21 3.2. Stochastic level and slope 23 3.3. Stochastic level and deterministic slope 26 3.4. The local linear trend model and Finnish fatalities 28

4. The local level model with seasonal 32 4.1. Deterministic level and seasonal 34 4.2. Stochastic level and seasonal 38 4.3. Stochastic level and deterministic seasonal 42 4.4. The local level and seasonal model and UK inflation 43

5. The local level model with explanatory variable 47 5.1. Deterministic level and explanatory variable 48 5.2. Stochastic level and explanatory variable 52

6. The local level model with intervention variable 5 6.1. Deterministic level and intervention variable 56 6.2. Stochastic level and intervention variable 59

7. The UK seat belt and inflation models 62 7.1. Deterministic level and seasonal 63 7.2. Stochastic level and seasonal 64 7.3. Stochastic level and deterministic seasonal 67 7.4. The UK inflation model 70 vii

Contents

8. General treatment of univariate state space models 73 8.1. State space representation of univariate models∗ 73 8.2. Incorporating regression effects∗ 78 8.3. Confidence intervals 81 8.4. Filtering and prediction 84 8.5. Diagnostic tests 90 8.6. Forecasting 96 8.7. Missing observations 103

9. Multivariate time series analysis∗ 107 9.1. State space representation of multivariate models 107 9.2. Multivariate trend model with regression effects 108 9.3. Common levels and slopes 1 9.4. An illustration of multivariate state space analysis 113

10. State space and Box–Jenkins methods for time series analysis 122 10.1. Stationary processes and related concepts 122 10.1.1. Stationary process 122 10.1.2. Random process 123 10.1.3. Moving average process 125 10.1.4. Autoregressive process 126 10.1.5. Autoregressive moving average process 128 10.2. Non-stationary ARIMA models 129 10.3. Unobserved components and ARIMA 132 10.4. State space versus ARIMA approaches 133

1. State space modelling in practice 135 1.1. The STAMP program and SsfPack 135 1.2. State space representation in SsfPack∗ 136 1.3. Incorporating regression and intervention effects∗ 139 1.4. Estimation of a model in SsfPack∗ 142 1.4.1. Likelihood evaluation using SsfLikEx 144 1.4.2. The score vector 146 1.4.3. Numerical maximisation of likelihood in Ox 149 1.4.4. The EM algorithm 150 1.4.5. Some illustrations in Ox 151 1.5. Prediction, filtering, and smoothing∗ 154

APPENDIX A. UK drivers KSI and petrol price 162 viii

Contents

APPENDIX B. Road traffic fatalities in Norway and Finland 164 APPENDIX C. UK front and rear seat passengers KSI 165 APPENDIX D. UK price changes 167

Bibliography 171 Index 173

List of Figures

1.1. Scatter plot of the log of the number of UK drivers KSI against time (in months), including regression line. 2

1.2. Log of the number of UK drivers KSI plotted as a time series. 4

1.3. Residuals of classical linear regression of the log of the number of UK drivers KSI on time. 4

1.4. Correlogram of random time series. 5 1.5. Correlogram of classical regression residuals. 6 2.1. Deterministic level. 13 2.2. Irregular component for deterministic level model. 13 2.3. Stochastic level. 16 2.4. Irregular component for local level model. 17 2.5. Stochastic level for Norwegian fatalities. 18 2.6. Irregular component for Norwegian fatalities. 19 3.1. Trend of stochastic linear trend model. 24 3.2. Slope of stochastic linear trend model. 25 3.3. Irregular component of stochastic linear trend model. 25 3.4. Trend of stochastic level and deterministic slope model. 27

3.5. Trend of deterministic level and stochastic slope model for Finnish fatalities (top), and stochastic slope component (bottom). 29

3.6. Irregular component for Finnish fatalities. 30 4.1. Log of number of UK drivers KSI with time lines for years. 3 4.2. Combined deterministic level and seasonal. 35 4.3. Deterministic level. 36 4.4. Deterministic seasonal. 36 4.5. Irregular component for deterministic level and seasonal model. 37 4.6. Stochastic level. 39 4.7. Stochastic seasonal. 40

List of Figures

4.8. Stochastic seasonal for the year 1969. 40 4.9. Irregular component for stochastic level and seasonal model. 41 4.10. Stochastic level, seasonal and irregular in UK inflation series. 43 5.1. Deterministic level and explanatory variable ‘log petrol price’. 51

5.2. Conventional classical regression representation of deterministic level and explanatory variable ‘log petrol price’. 51

5.3. Irregular component for deterministic level model with explanatory variable ‘log petrol price’. 52

5.4. Stochastic level and deterministic explanatory variable ‘log petrol price’. 53

5.5. Irregular for stochastic level model with deterministic explanatory variable ‘log petrol price’. 53

6.1. Deterministic level and intervention variable. 57

6.2. Conventional classical regression representation of deterministic level and intervention variable. 58

6.3. Irregular component for deterministic level model with intervention variable. 59

6.4. Stochastic level and intervention variable. 60

6.5. Irregular component for stochastic level model with intervention variable. 60

7.1. Deterministic level plus variables log petrol price and seat belt law. 64 7.2. Stochastic level plus variables log petrol price and seat belt law. 65 7.3. Stochastic seasonal. 6 7.4. Irregular component for stochastic level and seasonal model. 6

7.5. Correlogram of irregular component of completely deterministic level and seasonal model. 68

7.6. Correlogram of irregular component of stochastic level and deterministic seasonal model. 69

7.7. Local level (including pulse interventions), local seasonal and irregular for UK inflation time series data. 71

8.1. Level estimation error variance for stochastic level and deterministic seasonal model applied to the log of UK drivers KSI. 82

8.2. Stochastic level and its 90% confidence interval for stochastic level and deterministic seasonal model applied to the log of UK drivers KSI. 83

List of Figures

8.3. Deterministic seasonal and its 90% confidence interval for stochastic level and deterministic seasonal model applied to the log of UK drivers KSI. 83

8.4. Stochastic level plus deterministic seasonal and its 90% confidence interval for stochastic level and deterministic seasonal model applied to the log of UK drivers KSI. 84

8.5. Smoothed and filtered state of the local level model applied to Norwegian road traffic fatalities. 86

8.6. Illustration of computation of the filtered state for the local level model applied to Norwegian road traffic fatalities. 86

8.7. One-step ahead prediction errors (top) and their variances (bottom) for the local level model applied to Norwegian road traffic fatalities. 8

8.8. Standardised one-step prediction errors of model in Section 7.3. 91

8.9. Correlogram of standardised one-step prediction errors in Figure 8.8, first 10 lags. 92

8.10. Histogram of standardised one-step prediction errors in Figure 8.8. 94

8.1. Standardised smoothed level disturbances (top) and standardised smoothed observation disturbances (bottom) for analysis of UK drivers KSI in Section 4.3. 95

8.12. Standardised smoothed level disturbances (top) and standardised smoothed observation disturbances (bottom) for analysis of UK drivers KSI in Section 7.3. 97

8.13. Filtered level, and five year forecasts for Norwegian fatalities, including their 90% confidence interval. 98

8.14. Filtered trend, and five-year forecasts for Finnish fatalities, including their 90% confidence limits. 9

8.16. Last four years (1981–1984) in the time series of the log of numbers of drivers KSI: observed series, forecasts obtained from the analysis up to February 1983, and modelled development for the complete series including an intervention variable for February 1983. 102

8.17. Stochastic level estimation error variance for log drivers KSI with observations at t =4 8,..., 62 and t = 120,..., 140 treated as missing. 103 xii

List of Figures

8.18. Stochastic level and its 90% confidence interval for log drivers

8.19. Seasonal estimation error variance for log drivers KSI with observations missing at t =4 8,..., 62 and t = 120,..., 140. 104

8.20. Deterministic seasonal and its 90% confidence interval for t =2 5,..., 72. 105

8.21. Irregular component. 105

9.1. Log of monthly numbers of front seat passengers (top) and rear seat passengers (bottom) killed or seriously injured in the UK in the period 1969–1984. 114

9.2. Level disturbances for rear seat (horizontal) versus front seat KSI (vertical) in a seemingly unrelated model. 115

9.3. Levels of treatment and control series in the seemingly unrelated model. 116

9.4. Level of treatment against level of control series in the seemingly unrelated model. 116

9.5. Level disturbances for rear (horizontal) against front seat KSI (vertical), rank one model. 118

9.6. Level of treatment against level of control series in rank one model. 118 9.7. Levels of treatment and control series, rank one model. 119

9.8. Level of treatment series plus intervention, and level of control series, rank one model. 119

9.9. Deterministic seasonal of treatment and control series, rank one model. 120

(Parte 1 de 5)

Comentários