Time Series Analysis. Eric Feigelson 2011 Summer School



Similar documents
Outline. Time Series Analysis. Difficulties in astronomical time series

Univariate and Multivariate Methods PEARSON. Addison Wesley

Time Series Analysis

Software Review: ITSM 2000 Professional Version 6.0.

11. Time series and dynamic linear models

Introduction to Time Series Analysis. Lecture 1.

Summary Nonstationary Time Series Multitude of Representations Possibilities from Applied Computational Harmonic Analysis Tests of Stationarity

STA 4273H: Statistical Machine Learning

Threshold Autoregressive Models in Finance: A Comparative Approach

Advanced Signal Processing and Digital Noise Reduction

Time Series - ARIMA Models. Instructor: G. William Schwert

Time Series Analysis

State Space Time Series Analysis

Rob J Hyndman. Forecasting using. 11. Dynamic regression OTexts.com/fpp/9/1/ Forecasting using R 1

Short-time FFT, Multi-taper analysis & Filtering in SPM12

Sales forecasting # 2

9th Russian Summer School in Information Retrieval Big Data Analytics with R

Statistics Graduate Courses

Time Series Analysis in Economics. Klaus Neusser

Analysis and Computation for Finance Time Series - An Introduction

Studying Achievement

Java Modules for Time Series Analysis

Time Series Analysis

Chapter 10 Introduction to Time Series Analysis

A course in Time Series Analysis. Suhasini Subba Rao

Univariate Time Series Analysis; ARIMA Models

Forecasting model of electricity demand in the Nordic countries. Tone Pedersen

NRZ Bandwidth - HF Cutoff vs. SNR

TIME SERIES ANALYSIS

Time Series Analysis in WinIDAMS

Analysis of Financial Time Series

ADVANCED FORECASTING MODELS USING SAS SOFTWARE

Lecture 4: Seasonal Time Series, Trend Analysis & Component Model Bus 41910, Time Series Analysis, Mr. R. Tsay

How To Understand The Theory Of Probability

Time Series HILARY TERM 2010 PROF. GESINE REINERT

Time-Series Analysis of Variable Star Data

How To Model A Series With Sas

Overview of Violations of the Basic Assumptions in the Classical Normal Linear Regression Model

5 Signal Design for Bandlimited Channels

ITSM-R Reference Manual

Advanced Forecasting Techniques and Models: ARIMA

Time Series Analysis

Time Series Analysis 1. Lecture 8: Time Series Analysis. Time Series Analysis MIT 18.S096. Dr. Kempthorne. Fall 2013 MIT 18.S096

Time Series Analysis by Higher Order Crossings. Benjamin Kedem Department of Mathematics & ISR University of Maryland College Park, MD

Master s Theory Exam Spring 2006

NONLINEAR TIME SERIES ANALYSIS

Time Series Analysis and Forecasting Methods for Temporal Mining of Interlinked Documents

Linear regression methods for large n and streaming data

Introduction to Time Series Analysis and Forecasting. 2nd Edition. Wiley Series in Probability and Statistics

Statistics in Retail Finance. Chapter 6: Behavioural models

Probability and Random Variables. Generation of random variables (r.v.)

Logistic Regression (1/24/13)

ANALYZER BASICS WHAT IS AN FFT SPECTRUM ANALYZER? 2-1

Master of Mathematical Finance: Course Descriptions

Time Series Analysis of Aviation Data

Examples. David Ruppert. April 25, Cornell University. Statistics for Financial Engineering: Some R. Examples. David Ruppert.

Autocovariance and Autocorrelation

COMP6053 lecture: Time series analysis, autocorrelation.

Time Series Analysis

Springer Texts in Statistics

Analysis of algorithms of time series analysis for forecasting sales

A Regime-Switching Model for Electricity Spot Prices. Gero Schindlmayr EnBW Trading GmbH

CS Introduction to Data Mining Instructor: Abdullah Mueen

Christfried Webers. Canberra February June 2015

Traffic Safety Facts. Research Note. Time Series Analysis and Forecast of Crash Fatalities during Six Holiday Periods Cejun Liu* and Chou-Lin Chen

Financial TIme Series Analysis: Part II

TIME SERIES ANALYSIS

BayesX - Software for Bayesian Inference in Structured Additive Regression

NAG C Library Chapter Introduction. g13 Time Series Analysis

Booth School of Business, University of Chicago Business 41202, Spring Quarter 2015, Mr. Ruey S. Tsay. Solutions to Midterm

Forecasting methods applied to engineering management

Functional Data Analysis of MALDI TOF Protein Spectra

Statistical Modeling by Wavelets

Time Series Analysis and Forecasting

Promotional Analysis and Forecasting for Demand Planning: A Practical Time Series Approach Michael Leonard, SAS Institute Inc.

Operations Research and Financial Engineering. Courses

A Wavelet Based Prediction Method for Time Series

Time Series Analysis

Internet Traffic Variability (Long Range Dependency Effects) Dheeraj Reddy CS8803 Fall 2003

Network Traffic Modeling and Prediction with ARIMA/GARCH

T = 1 f. Phase. Measure of relative position in time within a single period of a signal For a periodic signal f(t), phase is fractional part t p

SPSS TRAINING SESSION 3 ADVANCED TOPICS (PASW STATISTICS 17.0) Sun Li Centre for Academic Computing lsun@smu.edu.sg

4. Simple regression. QBUS6840 Predictive Analytics.

Lecture 2: ARMA(p,q) models (part 3)

UNDERGRADUATE DEGREE DETAILS : BACHELOR OF SCIENCE WITH

Gaussian Processes in Machine Learning

IBM SPSS Forecasting 22

PATTERN RECOGNITION AND MACHINE LEARNING CHAPTER 4: LINEAR MODELS FOR CLASSIFICATION

Integrated Resource Plan

Transcription:

Time Series Analysis Eric Feigelson 2011 Summer School

Outline 1 Time series in astronomy 2 Frequency domain methods 3 Time domain methods 4 References

Time series in astronomy Periodic phenomena: binary orbits (stars, extrasolar planets); stellar rotation (radio pulsars); pulsation (helioseismology, Cepheids) Stochastic phenomena: accretion (CVs, X-ray binaries, Seyfert gals, quasars); scintillation (interplanetary & interstellar media); jet variations (blazars) Single events and explosive phenomena: thermonuclear (novae, X-ray bursts), magnetic reconnection (solar/stellar flares), star death (supernovae, gamma-ray bursts), microlensing and occultation events

Difficulties in astronomical time series Gapped data streams: Diurnal & monthly cycles; satellite orbital cycles; telescope allocations Heteroscedastic measurement errors: Signal-to-noise ratio differs from point to point Poisson processes: Individual photon/particle events in high-energy astronomy

Concepts of time series Goal: Represent behaviors exhibited over many datapoints in a parsimonious model. Types of models: Trends such as a linear model X t = α+βt+ǫ t, arbitrary deterministic function with covariates X t = f(t,z), or local regressions. n k t=1 (xt x)(x t+k x) n t=1 (xt x)2 Autocorrelation ACF(k) = where k is the lag time. Models many non-random stochastic behaviors. Stationarity Temporal behavior is statistically unchanged by a shift in time: constant, noise, periodic, autocorrelated. No change points or trends. Periodic Signal is concentrated into a few parameters after transformation from time to frequency domain. Variously called spectral, harmonic or Fourier analysis. Requires homoscedasticity and stationarity.

Fourier Analysis I Finite Fourier series of a time series: n/2 1 x t = a 0 + [a p cos(2πpt/n)+b p sin(2πpt/n)]+a n/2 cos(πt) p=1 The least squares parameter expected values are a 0 = x a n/2 = ( 1) t x t /n ] a p = 2[ xt cos(2πpt/n) /n ] b p = 2[ xt sin(2πpt/n) /n for the p harmonics p = 1,2,...,n/2 1.

Fourier Analysis II Spectra are calculated at increments of 2π/n,4π/n,...,π between the low fundamental frequency 2π/(n t) and the high Nyquist frequency π/ t. The spectrum is often plotted as a histogram of the quantity I(ω) I(ω p ) S = n a 2 p +b2 p /4π against frequency ω. This is the periodogram developed by Schuster in 1898 and very widely used since.

Fourier Analysis III Fourier analysis reveals nothing of the evolution in time, but rather reveals the variance of the signal at different frequencies. It can be proved that the classical periodogram is an estimator of the spectral density, the Fourier transform of the autocovariance function. Fourier analysis has restrictive assumptions: an infinitely long dataset of equally-spaced observations; homoscedastic Gaussian noise with purely periodic signals; sinusoidal shape Formally, the probability of a periodic signal in Gaussian noise is P e d(ω j)/σ 2. But this formula is often not applicable, and probabilities are difficult to infer.

Ginga observations of X-ray binary GX 5-1 GX 5-1 is a binary star system with gas from a normal companion accreting onto a neutron star. Highly variable X-rays are produced in the inner accretion disk. XRB time series often show red noise and quasi-periodic oscillations, probably from inhomogeneities in the disk. We plot below the first 5000 of 65,536 count rates from Ginga satellite observations during the 1980s. gx=scan( /Desktop/CASt/SumSch/TSA/GX.dat ) t=1:5000 plot(t,gx[1:5000],pch=20)

Fast Fourier Transform of the GX 5-1 time series reveals the red noise (high spectral amplitude at small frequencies), the QPO (broadened spectral peak around 0.35), and white noise. f = 0:32768/65536 I = (4/65536)*abs(fft(gx)/sqrt(65536))ˆ 2 plot(f[2:60000],i[2:60000],type= l,xlab= Frequency )

Limitations of the spectral density But the classical periodogram is not a good estimator! It is formally inconsistent because the number of parameters grows with the number of datapoints. The discrete Fourier transform and its probabilities also depends on several strong assumptions which are rarely achieved in real astronomical data: evenly spaced data of infinite duration with a high sampling rate (Nyquist frequency), Gaussian (white) noise, single frequency periodicity with sinusoidal shape, and stationary behavior. Each of these constraints is violated in various astronomical problems. Data spacing may be affected by daily/monthly/orbital cycles. Period may be comparable to the sampling time. Noise may be Poissonian or quasi-gaussian with heavy tails. Several periods may be present (e.g. helioseismology). Shape may be non-sinusoidal (e.g. elliptical orbits, eclipses). Periods may not be constant (e.g. QPOs in an accretion disk).

Improving the spectral density I The estimator can be improved with smoothing, ˆf(ω j ) = 1 m I(ω j k ). 2m 1 k= m This reduces variance but introduces bias. It is not obvious how to choose the smoothing bandwidth m or the smoothing function (e.g. Daniell or boxcar kernel). Tapering reduces the signal amplitude at the ends of the dataset to alleviate the bias due to leakage between frequencies in the spectral density produced by the finite length of the dataset. Consider for example the cosine taper h t = 0.5[1+cos(2π(t t)/n)] applied to downweight the initial and terminal n datapoints. The Fourier transform of the taper function is known as the spectral window. Optons: cosine, Fejer, Parzen windows and multitapering. Tapering decreases bias but increases variance in the spectrum.

0.0 0.1 0.2 0.3 0.4 0.5 Series: x Smoothed Periodogram spectrum 0 100 200 300 400 500 600 700 frequency bandwidth = 7.54e 05 postscript(file= /Desktop/GX sm tap fft.eps ) k = kernel( modified.daniell, c(7,7)) spec = spectrum(gx, k, method= pgram, taper=0.3, fast=true, detrend=true, log= no ) dev.off()

Improving the spectral density II Pre-whitening is another bias reduction technique based on removing (filtering) strong signals from the dataset. It is widely used in radio astronomy imaging where it is known as the CLEAN algorithm, and has been adapted to astronomical time series (Roberts et al. 1987). A variety of linear filters can be applied to the time domain data prior to spectral analysis. When aperiodic long-term trends are present, they can be removed by spline fitting (high-pass filter). A kernel smoother, such as the moving average, will reduce the high-frequency noise (low-pass filter). Use of a parametric autoregressive model instead of a nonparametric smoother allows likelihood-based model selection (e.g. BIC).

Improving the spectral density III Harmonic analysis of unevenly spaced data is problematic due to the loss of information and increase in aliasing. The Lomb-Scargle periodogram is widely used in astronomy to alleviate aliasing from unevenly spaced observations: d LS (ω) = 1 ( [ n t=1 x tcosω(x t τ)] 2 2 n + [ n t=1 x tsinω(x t τ)] 2 ) i=1 cos2 ω(x t τ) n i=1 sin2 ω(x t τ) where tan(2ωτ) = ( n i=1 sin2ωx t)( n i=1 cos2ωx t) 1 d LS reduces to the classical periodogram d for evenly-spaced data. Bretthorst (2003) demonstrates that the Lomb-Scargle periodogram is the unique sufficient statistic for a single stationary sinusoidal signal in Gaussian noise based on Bayes theorem assuming simple priors.

Some other methods for periodicity searching Phase dispersion measure (Stellingwerf 1972) Data are folded modulo many periods, grouped into phase bins, and intra-bin variance is compared to inter-bin variance using χ 2. Non-parametric procedure well-adapted to unevenly spaced data and non-sinusoidal shapes (e.g. eclipses). Very widely used in variable star research, although there is difficulty in deciding which periods to search (Collura et al. 1987). Minimum string length (Dworetsky 1983) Similar to PDM but simpler: plots length of string connecting datapoints for each period. Related to the Durbin-Watson roughness statistic in econometrics. Rayleigh and Z 2 n tests (Leahy et al. 1983) for periodicity search Poisson distributed photon arrival events. Equivalent to Fourier spectrum at high count rates. Bayesian periodicity search (Gregory & Loredo 1992) Designed for non-sinusoidal periodic shapes observed with Poisson events. Calculates odds ratio for periodic over constant model and most probable shape.

Conclusions on spectral analysis For challenging problems, smoothing, multitapering, linear filtering, (repeated) pre-whitening and Lomb-Scargle can be used together. Beware that aperiodic but autoregressive processes produce peaks in the spectral densities. Harmonic analysis is a complicated art rather than a straightforward procedure. It is extremely difficult to derive the significance of a weak periodicity from harmonic analysis. Do not believe analytical estimates (e.g. exponential probability), as they rarely apply to real data. It is essential to make simulations, typically permuting or bootstrapping the data keeping the observing times fixed. Simulations of the final model with the observation times is also advised.

Nonstationary time series Non-stationary periodic behaviors can be studied using time-frequency Fourier analysis. Here the spectral density is calculated in time bins and displayed in a 3-dimensional plot. Wavelets are now well-developed for non-stationary time series, either periodic or aperiodic. Here the data are transformed using a family of non-sinusoidal orthogonal basis functions with flexibility both in amplitude and temporal scale. The resulting wavelet decomposition is a 3-dimensional plot showing the amplitude of the signal at each scale at each time. Wavelet analysis is often very useful for noise threshholding and low-pass filtering.

Nonparametric time domain methods Autocorrelation function ˆρ(h) = ˆγ(h) ˆγ0 where n h i=1 ˆγ(h) = (x t+h x)(x t x) n This sample ACF is an estimator of the correlation between the x t and x t h in an evenly-spaced time series lags. For zero mean, the ACF variance is Varˆρ = [n h]/[n(n+2)]. The partial autocorrelation function (PACF) estimates the correlation with the linear effect of the intermediate observations, x t 1,...,x t h+1, removed. Calculate with the Durbin-Levinson algorithm based on an autoregressive model.

Kernel smoothing of GX 5+1 time series Normal kernel, bandwidth = 7 bins

Autocorrelation functions acf(gx, lwd=3) pacf(gx, lwd=3)

Stochastic autoregressive models The simplest autocorrelated model is the random walk ( drunkard s walk ) x i = x i 1 +ǫ i where ǫ i = N(0,σ 2 ) Its behavior is simply dependent on past noise values, x i = ǫ 1 +ǫ 2 +...+ǫ i and its ACF slowly decreases with lag time as ACF(i,k) = 1/ 1+k/i. This stochastic (i.e. noise-dominated) process can be combined with a deterministic smoothing process where the current value is partly determined by the immediate past value ( exponentially weighted moving average ), ˆx i,ewma = αx i +(1 α)x i 1 where 0 α 1, x 1,EWMA = x 1

ARMA models I This gives the autoregressive (AR) model x i = α 1 x i 1 +α 2 x i 2 +...+α p x i p +ǫ i. For AR(1), the ACF(k) = α k 1 and PACF(k) = 0 for k > 1. In another class of stochastic autoregressive models, the moving average (MA), the current value depends only on past noise values, x i = ǫ i +β 1 ǫ i 1 +...+β q ǫ i q The combined ARMA model, with both memory of and averaging over recent past values, is ARMA(p,q) = x i = α 1 x i 1 +...+α p x i p +ǫ t +β 1 ǫ i i +...+β q x i q

ARMA models II ARMA models have been very successful for parametrizing a wide range of human and natural autoregressive behaviors. For ARMA(1,1), ACF = α k 1 (α+β)(1+α/β)/(1+αβ +β 2 ) and is more complicated for higher-order processes. Best-fit parameters are easily obtained by least squares or maximum-likelihood. For MLE, the model order p and q chosen (i.e. nested model selection) by maximizing the AIC penalized likelihood criterion. Parameter confidence intervals are estimated by bootstrap resampling. The parameter values may be difficult to interpret physically. Note that standard statistics, e.g. variance of the mean, are wrong for autocorrelated processes.

ARMA models III Many extensions to ARMA models have been developed, particularly in econometrics: ARIMA (i = integrated ) models allow the average level to vary by random walk, giving a nonstationary time series FARIMA (f = fractional ) models allow autocorrelations at very long lags, known as long-memory processes ARCH, GARCH (ch = conditional heteroscedasticity, g = generalized ) models allow the variance to be nonstationary.

ARMA model for GX 5+1 Figure: Smoothed periodogram of the GX 5-1 time series and its AR(27) model (red curve).

Modeling long-memory processes I The GX5+1 time series shows a rising signal at the lowest frequencies. This demonstrated a strong dependence of current values on distant-past values; this cannot be treated by low-order ARMA(p,q) models, although ARIMA or FARIMA models may work. Astronomers typically call this behavior 1/f (or 1/f α ) or red noise and model it in the frequency domain. A common model is a power law decay of the ACF, ACF(k) k 2d 1 where 0 d 1/2. Economists define H = d+1/2.

Modeling long-memory processes II The physicist s 1/f noise corresponds to d = 1/2. Estimation of the slope d or H is not easy. Astronomers typically make a least-squares fit to the periodogram (known in statistics as the Geweke-Porter-Hudak estimator), but this has difficulties (e..g choice of maximum frequency). Standard MLE methods cannot be applied due to the divergence at zero frequency, but variants can be tried. A fashionable alternative in physics and biology is detrended fluctuation analysis. Wavelet analysis can be applied.

State space models Often we cannot directly detect x t, the system variable, but rather indirectly with an observed variable y t. This commonly occurs in astronomy where y is observed with measurement error (errors-in-variable or EIV model). For AR(1) and errors v t = N(µ,σ) and w t = N(ν,τ), y t = Ax t +v t x t = φ 1 x t 1 +w t This is a state space model where the goal is to estimate x t from y t, p(x t y t,...,y 1 ). Parameters are estimated by maximum likelihood, Bayesian estimation, Kalman filtering, or prediction.

Other time domain models Extended ARMA models: VAR (vector autoregressive), ARFIMA (ARIMA with long-memory component), GARCH (generalized autoregressive conditional heteroscedastic for stochastic volatility) Extended state space models: non-stationarity, hidden Markov chains, etc. MCMC evaluation of nonlinear and non-normal (e.g. Poisson) models

Statistical texts and monographs D. Brillinger, Time Series: Data Analysis and Theory, 2001 C. Chatfield, The Analysis of Time Series: An Introduction, 6th ed., 2003 G. Kitagawa & W. Gersch, Smoothness Priors Analysis of Time Series, 1996 J. F. C. Kingman, Poisson Processes, 1993 J. K. Lindsey, Statistical Analysis of Stochastic Processes in Time, 2004 S. Mallat, A Wavelet Tour of Signal Processing, 2nd ed, 1999 M. B. Priestley, Spectral Analysis and Time Series, 2 vol, 1981 R. H. Shumway and D. S. Stoffer, Time Series Analysis and Its Applications (with R examples), 2nd Ed., 2006

Astronomical references Bretthorst 2003, Frequency estimation and generalized Lomb-Scargle periodograms, in Statistical Challenges in Modern Astronomy Collura et al 1987, Variability analysis in low count rate sources, ApJ 315, 340 Dworetsky 1983, A period-finding method for sparse randomly spaced observations..., MNRAS 203, 917 Gregory & Loredo 1992, A new method for the detection of a periodic signal of unknown shape and period, ApJ 398, 146 Kovacs et al. 2002, A box-fitting algorithm in the search for periodic transits, A&A 391, 369 Leahy et al. 1983, On searches for periodic pulsed emission: The Rayleigh test compared to epoch folding,. ApJ 272, 256 Roberts et al. 1987, Time series analysis with CLEAN..., AJ 93, 968 Scargle 1982, Studies in astronomical time series, II. Statistical aspects of spectral analysis of unevenly spaced data, ApJ 263, 835 Scargle 1998, Studies in astronomical time series, V. Bayesian Blocks, a new method to analyze structure in photon counting data, ApJ 504, 405

Stellingwerf 1972, Period determination using phase dispersion measure, ApJ 224, 953 Vio et al. 2005, Time series analysis in astronomy: Limits and potentialities, A&A 435, 773