Time series analysis of activity and temperature data of four healthy individuals

Similar documents
Time Series I Time Domain Methods

Time Series Analysis -- An Introduction -- AMS 586

A time series is called strictly stationary if the joint distribution of every collection (Y t

Lesson 13: Box-Jenkins Modeling Strategy for building ARMA models

{ } Stochastic processes. Models for time series. Specification of a process. Specification of a process. , X t3. ,...X tn }

MCMC analysis of classical time series algorithms.

Advanced Econometrics

Chapter 3: Regression Methods for Trends

AR, MA and ARMA models

TIME SERIES ANALYSIS AND FORECASTING USING THE STATISTICAL MODEL ARIMA

Forecasting Area, Production and Yield of Cotton in India using ARIMA Model

Elements of Multivariate Time Series Analysis

Circle a single answer for each multiple choice question. Your choice should be made clearly.

MODELING INFLATION RATES IN NIGERIA: BOX-JENKINS APPROACH. I. U. Moffat and A. E. David Department of Mathematics & Statistics, University of Uyo, Uyo

Using Analysis of Time Series to Forecast numbers of The Patients with Malignant Tumors in Anbar Provinc

Circle the single best answer for each multiple choice question. Your choice should be made clearly.

FORECASTING SUGARCANE PRODUCTION IN INDIA WITH ARIMA MODEL

FE570 Financial Markets and Trading. Stevens Institute of Technology

Estimation and application of best ARIMA model for forecasting the uranium price.

STAT 443 Final Exam Review. 1 Basic Definitions. 2 Statistical Tests. L A TEXer: W. Kong

Time Series Modeling. Shouvik Mani April 5, /688: Practical Data Science Carnegie Mellon University

of seasonal data demonstrating the usefulness of the devised tests. We conclude in "Conclusion" section with a discussion.

Analysis of Violent Crime in Los Angeles County

A SEASONAL TIME SERIES MODEL FOR NIGERIAN MONTHLY AIR TRAFFIC DATA

Review Session: Econometrics - CLEFIN (20192)

Time Series Examples Sheet

Forecasting using R. Rob J Hyndman. 2.4 Non-seasonal ARIMA models. Forecasting using R 1

Statistics 349(02) Review Questions

Exercises - Time series analysis

Forecasting Egyptian GDP Using ARIMA Models

Minitab Project Report - Assignment 6

Lab: Box-Jenkins Methodology - US Wholesale Price Indicator

Time Series Analysis. James D. Hamilton PRINCETON UNIVERSITY PRESS PRINCETON, NEW JERSEY

CHAPTER 8 FORECASTING PRACTICE I

A SARIMAX coupled modelling applied to individual load curves intraday forecasting

Module 3. Descriptive Time Series Statistics and Introduction to Time Series Models

Chapter 4: Models for Stationary Time Series

A Comparison of the Forecast Performance of. Double Seasonal ARIMA and Double Seasonal. ARFIMA Models of Electricity Load Demand

Time Series: Theory and Methods

TIME SERIES DATA PREDICTION OF NATURAL GAS CONSUMPTION USING ARIMA MODEL

Seasonal Autoregressive Integrated Moving Average Model for Precipitation Time Series

Chapter 6: Model Specification for Time Series

INTRODUCTION TO TIME SERIES ANALYSIS. The Simple Moving Average Model

Time Series Analysis. James D. Hamilton PRINCETON UNIVERSITY PRESS PRINCETON, NEW JERSEY

3. ARMA Modeling. Now: Important class of stationary processes

Applied Time. Series Analysis. Wayne A. Woodward. Henry L. Gray. Alan C. Elliott. Dallas, Texas, USA

TMA4285 December 2015 Time series models, solution.

Lesson 2: Analysis of time series

Problem Set 2 Solution Sketches Time Series Analysis Spring 2010

2. An Introduction to Moving Average Models and ARMA Models

4. MA(2) +drift: y t = µ + ɛ t + θ 1 ɛ t 1 + θ 2 ɛ t 2. Mean: where θ(l) = 1 + θ 1 L + θ 2 L 2. Therefore,

STAT 436 / Lecture 16: Key

Kernel-based portmanteau diagnostic test for ARMA time series models

Lesson 15: Building ARMA models. Examples

Estimating AR/MA models

EASTERN MEDITERRANEAN UNIVERSITY ECON 604, FALL 2007 DEPARTMENT OF ECONOMICS MEHMET BALCILAR ARIMA MODELS: IDENTIFICATION

Introduction to Signal Processing

University of Oxford. Statistical Methods Autocorrelation. Identification and Estimation

X random; interested in impact of X on Y. Time series analogue of regression.

Design of Time Series Model for Road Accident Fatal Death in Tamilnadu

Econometrics I: Univariate Time Series Econometrics (1)

A Data-Driven Model for Software Reliability Prediction

Part 1. Multiple Choice (50 questions, 1 point each) Part 2. Problems/Short Answer (10 questions, 5 points each)

Basics: Definitions and Notation. Stationarity. A More Formal Definition

Forecasting using R. Rob J Hyndman. 2.5 Seasonal ARIMA models. Forecasting using R 1

Forecasting. Simon Shaw 2005/06 Semester II

Time Series Forecasting: A Tool for Out - Sample Model Selection and Evaluation

IDENTIFICATION OF ARMA MODELS

Empirical Market Microstructure Analysis (EMMA)

at least 50 and preferably 100 observations should be available to build a proper model

Univariate Time Series Analysis; ARIMA Models

STAT Financial Time Series

Transformations for variance stabilization

Modelling Monthly Rainfall Data of Port Harcourt, Nigeria by Seasonal Box-Jenkins Methods

Econometría 2: Análisis de series de Tiempo

Marcel Dettling. Applied Time Series Analysis SS 2013 Week 05. ETH Zürich, March 18, Institute for Data Analysis and Process Design

Lecture 1: Fundamental concepts in Time Series Analysis (part 2)

Forecasting. This optimal forecast is referred to as the Minimum Mean Square Error Forecast. This optimal forecast is unbiased because

FORECASTING OF COTTON PRODUCTION IN INDIA USING ARIMA MODEL

UNIVARIATE TIME SERIES ANALYSIS BRIEFING 1970

ARIMA modeling to forecast area and production of rice in West Bengal

8.2 Harmonic Regression and the Periodogram

Econ 623 Econometrics II Topic 2: Stationary Time Series

Problem Set 2: Box-Jenkins methodology

Forecasting using R. Rob J Hyndman. 3.2 Dynamic regression. Forecasting using R 1

Autoregressive Moving Average (ARMA) Models and their Practical Applications

Forecasting Bangladesh's Inflation through Econometric Models

Time Series Examples Sheet

Empirical Approach to Modelling and Forecasting Inflation in Ghana

Scenario 5: Internet Usage Solution. θ j

Chapter 9: Forecasting

Estadística Oficial. Transfer Function Model Identication

ECON/FIN 250: Forecasting in Finance and Economics: Section 8: Forecast Examples: Part 1

Moving Average (MA) representations

5 Autoregressive-Moving-Average Modeling

2 Time Series Regression and Exploratory Data Analysis

Short-term electricity demand forecasting in the time domain and in the frequency domain

Multiplicative Sarima Modelling Of Nigerian Monthly Crude Oil Domestic Production

3 Theory of stationary random processes

Chapter 8: Model Diagnostics

Transcription:

Time series analysis of activity and temperature data of four healthy individuals B.Hadj-Amar N.Cunningham S.Ip March 11, 2016 B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 1 / 26

Aims Fit time series models to activity data Identify periodicity in the data Produce a 24-hr ahead forecast for activity and temperature Medical applications B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 2 / 26

Data Healthy individuals wore devices recording physical activity and skin temperature Four individuals recorded for approximately four days Physical activity recorded minutely, skin temperature every ten minutes hourly median taken Missing data B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 3 / 26

Data 60 Rest Activity 40 20 0 2013 10 04 2013 10 05 2013 10 06 2013 10 07 37 Temperature 36 35 34 33 2013 10 04 2013 10 05 2013 10 06 2013 10 07 B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 4 / 26

Autocorrelation function Activity Temperature ACF 0.5 0.0 0.5 1.0 0.4 0.0 0.2 0.4 0.6 0.8 1.0 0 10 20 30 40 50 60 70 Lag 0 10 20 30 40 50 60 70 Lag B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 5 / 26

ARMA {Y 1, Y 2,, Y T } is a time series with zero mean. ɛ t is some noise with zero mean and variance σ 2. B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 6 / 26

ARMA {Y 1, Y 2,, Y T } is a time series with zero mean. ɛ t is some noise with zero mean and variance σ 2. ARMA ARMA(p, q) model has the form Y t = p q φ i Y t i + ɛ t θ j ɛ t j (1) i=1 j=1 B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 6 / 26

Backshift Backshift Operator B k Y t = Y t k (2) B k ɛ t = ɛ t k (3) B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 7 / 26

Backshift Backshift Operator B k Y t = Y t k (2) B k ɛ t = ɛ t k (3) Y t = p q φ Bi i Y t + ɛ t θ Bj j ɛ t i=1 j=1 B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 7 / 26

ARMA Characteristic Equations Y t = p q φ Bi i Y t + ɛ t θ Bj j ɛ t i=1 j=1 B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 8 / 26

ARMA Characteristic Equations Y t = p φ Bi i Y t + ɛ t i=1 φ ( B q θ Bj j ɛ t j=1 ) ( ) Y t = θ B ɛ t (4) B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 8 / 26

ARMA Characteristic Equations Y t = p φ Bi i Y t + ɛ t i=1 φ ( B q θ Bj j ɛ t j=1 ) ( ) Y t = θ B ɛ t (4) ARMA Characteristic Equations φ(x) = 1 θ(x) = 1 p φ i x i (5) i=1 q θ j x j (6) j=1 B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 8 / 26

SARMA Characteristic Equations Introduce seasonality of lag s. B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 9 / 26

SARMA Characteristic Equations Introduce seasonality of lag s. SARMA Characteristic Equations Φ(x) = 1 Θ(x) = 1 P Φ i x is (7) i=1 Q Θ j x js (8) j=1 B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 9 / 26

SARMA SARMA SARMA(p, q) (P, Q) s model has the form ( ) ( ) ( φ B Φ B Y t = θ B ) Θ ( B ) ɛ t (9) B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 10 / 26

SARMA SARMA SARMA(p, q) (P, Q) s model has the form ( ) ( ) ( φ B Φ B Y t = θ B ) Θ ( B ) ɛ t (9) Assume Normal noise, parameters can be estimated using maximum log likelihood. B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 10 / 26

Information Criterions AIC and BIC can be used to select what p, q, P, Q, s to use. B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 11 / 26

Information Criterions AIC and BIC can be used to select what p, q, P, Q, s to use. AIC and BIC Select p, q, P, Q, s which minimizes one of these AIC = T ln σ 2 + (p + q + P + Q)2 (10) BIC = T ln σ 2 + (p + q + P + Q) ln T (11) B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 11 / 26

Experiment 3 day fit, 1 day forecast Select s = 24 hours. Fit ARMA(p, q) and select the best p, q pair. Fix p, q, fit SARMA(p, q) (P, Q) 24 and select the best P, Q pair. Fit and then assess 24 hour forecast B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 12 / 26

Results Figure: Fit SARMA on activity time series B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 13 / 26

Results Figure: Fit SARMA on temperature time series B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 14 / 26

Results AIC Data p q P Q MSE ( C 2 ) Temp2 2 4 2 0 1.71 ± 0.09 Temp8 2 1 2 0 1.4 ± 0.1 Temp24 4 4 1 1 0.43 ± 0.04 Temp26 5 2 2 0 0.7 ± 0.1 BIC Data p q P Q MSE ( C 2 ) Temp2 0 2 2 0 1.72 ± 0.08 Temp8 2 1 2 0 1.4 ± 0.1 Temp24 2 4 1 1 0.36 ± 0.03 Temp26 2 0 2 0 0.69 ± 0.06 Table: Selected SARMA models for temperature with mean squared error B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 15 / 26

Harmonic Regression Let us consider the periodic model: X t = Acos(2πωt + φ) + Z t, where A amplitude, φ phase shift, ω fixed frequency, Z t WN(0, σ 2 ) B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 16 / 26

Harmonic Regression Let us consider the periodic model: X t = Acos(2πωt + φ) + Z t, where A amplitude, φ phase shift, ω fixed frequency, Z t WN(0, σ 2 ) Using, trigonometric identities we re-write: X t = β 1 cos(2πωt) + β 2 sin(2πωt) + Z t where β 1 = Acos(φ) and β 2 = Asin(φ). B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 16 / 26

Harmonic Regression Let us consider the periodic model: X t = Acos(2πωt + φ) + Z t, where A amplitude, φ phase shift, ω fixed frequency, Z t WN(0, σ 2 ) Using, trigonometric identities we re-write: X t = β 1 cos(2πωt) + β 2 sin(2πωt) + Z t where β 1 = Acos(φ) and β 2 = Asin(φ). Linear in β 1 and β 2 Linear regression B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 16 / 26

Harmonic Regression Spectral Representation Theorem states that any (weakly) stationary time series can be approximated: X t = µ + K { βk1 cos(2πω k t) + β k2 sin(2πω k t) } k=1 B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 17 / 26

Harmonic Regression Spectral Representation Theorem states that any (weakly) stationary time series can be approximated: X t = µ + K { βk1 cos(2πω k t) + β k2 sin(2πω k t) } k=1 Issue: Find this collection of frequencies {ω k } K k=1 that drive the data Therefore, we use the periodogram I (ω j ), estimator of the frequency spectrum f (ω j ) E[I (ω j )] = f (ω j ) B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 17 / 26

Periodogram However, the periodogram is not a consistent estimator. Generating periodogram of AR(1), for different values of T : Figure: Showing not consistency of the periodogram: black line is the periodogram, red line is the true spectrum. B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 18 / 26

Smoothed Periodogram The smoothed periodogram is instead a consistent estimator of the frequency spectrum: 1 M ˆf (ω j ) = h k I (ω j + k 2M + 1 T ) k= M B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 19 / 26

Temperature: Finding the frequencies that drive the data Figure: Periodogram and smoothed periodograms (uniform and Daniell weights) for temperature of patient 8. This figure is best viewed in colours. B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 20 / 26

Periodogram and Spectrum: AR(p) approach The spectrum of any (weakly) stationary time series can be approximated by the spectrum of an AR(p) process. (a) AIC and BIC (b) Spectrum AR(2), AR(9) Figure: AR(p) approach to obtain the correct frequency representation. Main frequencies that drive the data are around 1/24, and 1/8 B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 21 / 26

Harmonic Regression: Temperature Figure: Harmonic regression for temperature of patient 8, using 5 different harmonics. Dotted lines represent the fitting for single harmonics; thick red line is the superposition of the dotted harmonics, which is the final fit B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 22 / 26

Forecasting: Temperature Figure: 24 hour forecast for temperature of patient 8, given by averaging the fitted model of 4 days. B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 23 / 26

Harmonic Regression: Rest Activity Figure: Harmonic regression for rest activity of patient 8, using 5 harmonics. On top it is shown the classic harmonic fitting, whereas on the bottom the alternative model, where negative values are taken to be zero. B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 24 / 26

Conclusions and future work Harmonic regression provided a better fit for the data In both cases skin temperature was more accurately modeled Further work Examine larger datasets Consider weekday vs weekend effects Model dependence structure between skin temperature and activity levels B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 25 / 26

References Mark Fiecas - Spectral Analysis of Time Series Data University of Warwick - ST414 2015 Jenkins, GM and Reinsel, GC - Time series analysis: forecasting and control Holden-Day, San Francisco 1976 Shumway, Robert H and Stoffer, David S - Time series analysis and its applications Springer Science & Business Media 2013 B.Hadj-Amar, N.Cunningham, S.Ip Time Series Analysis March 11, 2016 26 / 26