# Time series analysis

## Vocab/parlance

• Stochastic process
• Adjacent points in time are correlated
• Parsimonious explanation
• white noise - uncorrelated random
• dominated by oscillatory behavior
• random walk with drift
• signal-to-noise-ratio (SNR)

## General

• two approaches: time domain approach and frequency domain approach
• moving averages, smoothing, filtering
• autoregression - e.g. a prediction of the current value as a function of the last two values
• dependent on initial conditions

## Auto covariance and auto correlation

• Autocovariance
• Autocorrelation
• The lack of independence between two adjacent values x_s and x_t can be assessed numerically using the notions of covariance and correlation.

### Autocovariance function

• Auto covariance measures the linear depencence between two points on the same series observed at different times
• For s = t, the autocovariance reduces to the variance because ${\displaystyle \gamma _{x}(t,t)=E[(x_{t}-\mu )^{2}]={\textrm {var}}(x_{t})}$
• Autovariance function is independent of time

### ACF: Autocorrelation function

• ${\displaystyle \rho (s,t)={\frac {\gamma (s,t)}{\sqrt {\gamma (s,s)\gamma (t,t)}}}}$
• ACF measures linear predictability of the series at time t (i.e., x_t) using only the value x_s
• Because it is a correlation ${\displaystyle -1\leq \rho (s,t)\leq 1}$

### Cross-covariance function

• Cross-covariance function between two series x_t and y_t
• ${\displaystyle \gamma (s,t)={\textrm {cov}}(x_{s},y_{t})=E[(x_{s}-\mu _{xs})(y_{t}-\mu _{yt})]}$

### CCF: Cross-correlation function

• ${\displaystyle \rho _{xy}(s,t)={\frac {\gamma _{xy}(s,t)}{\sqrt {\gamma _{x}(s,s)\gamma _{y}(t,t)}}}}$

### Stationarity

• Mean is the is constant (does not depend on time) and autocovariance depends only on time *difference*
• A random walk is not stationary

### Lag

• Let h = time shift or lag where s = t + h
• autocovariance of stationary time series
• autocorrelation function of stationary time series
• ${\displaystyle \rho ={\frac {\gamma (h)}{\gamma (0)}}}$

### Trend stationarity

• e.g. for a function ${\displaystyle x_{t}=\beta _{t}+y_{t}}$

### Autoregressive models example

• ${\displaystyle AR(1)=\phi x_{t-1}+w_{t}}$ where w_t is white noise