Longitudinal Analysis CSE545 - Fall2017 Supplemental Presentation - - PowerPoint PPT Presentation

longitudinal analysis
SMART_READER_LITE
LIVE PREVIEW

Longitudinal Analysis CSE545 - Fall2017 Supplemental Presentation - - PowerPoint PPT Presentation

Longitudinal Analysis CSE545 - Fall2017 Supplemental Presentation Introduction Time Series Analysis Goal: Understanding temporal patterns of data (or real world events) Common tasks: Trend Analysis: Extrapolate patterns over time (typically


slide-1
SLIDE 1

Longitudinal Analysis

CSE545 - Fall2017 Supplemental Presentation

slide-2
SLIDE 2

Introduction Time Series Analysis

Goal: Understanding temporal patterns of data (or real world events) Common tasks:

  • Trend Analysis: Extrapolate patterns over time (typically descriptive).
  • Forecasting: Predicting a future event (predictive).

(contrasts with “cross-sectional” prediction -- predicting a different group)

slide-3
SLIDE 3

Introduction to Causal Inference (Revisited)

X causes Y as opposed to X is associated with Y

Changing X will change the distribution of Y. X causes Y Y causes X

slide-4
SLIDE 4

Spurious Correlations

Extremely common in time-series analysis.

slide-5
SLIDE 5

Spurious Correlations

Extremely common in time-series analysis. http://tylervigen.com/spurious-correlations

slide-6
SLIDE 6

Introduction to Causal Inference (Revisited)

X causes Y as opposed to X is associated with Y

Changing X will change the distribution of Y. X causes Y Y causes X Counterfactual Model: Exposed or Not Exposed: X = 1 or 0 Causal Odds Ratio:

slide-7
SLIDE 7

Autocorrelation

“(a.k.a. Serial correlation).” Quantifying the strength of a temporal pattern in serial data. Requirements:

  • Assume regular measurement (hourly, daily, monthly...etc..)
slide-8
SLIDE 8

Autocorrelation

Quantifying the strength of a temporal pattern in serial data.

Which have temporal patterns?

slide-9
SLIDE 9

Autocorrelation

Quantifying the strength of a temporal pattern in serial data.

Which have temporal patterns?

white noise strong autocorrelation weak autocorrelation sinusoidal

slide-10
SLIDE 10

Autocorrelation

Quantifying the strength of a temporal pattern in serial data. Q: HOW?

slide-11
SLIDE 11

Autocorrelation

Quantifying the strength of a temporal pattern in serial data. Q: HOW? A: Correlate with a copy of self, shifted slightly. ….

slide-12
SLIDE 12

Autocorrelation

Quantifying the strength of a temporal pattern in serial data. Q: HOW? A: Correlate with a copy of self, shifted slightly. Y = [3, 4, 4, 5, 6, 7, 7, 8] correlate(Y[0:7], Y[1:8]) #lag=1 correlate(Y[0:-2], Y[2:8]) #lag=2 ….

slide-13
SLIDE 13

Autocorrelation

Quantifying the strength of a temporal pattern in serial data. Q: HOW? A: Correlate with a copy of self, shifted slightly. Y = [3, 4, 4, 5, 6, 7, 7, 8] correlate(Y[0:7], Y[1:8]) #lag=1 correlate(Y[0:-2], Y[2:8]) #lag=2 ….

slide-14
SLIDE 14

Autoregressive Model

AR Models: Linear AR model:

slide-15
SLIDE 15

Autoregressive Model

AR Models: Linear AR model: Notation:

slide-16
SLIDE 16

Autoregressive Model

AR Models: Linear AR model: Notation:

slide-17
SLIDE 17

Moving Average

Based on error; (a “smoothing” technique). Q: Best estimator of random data (i.e. white noise)?

slide-18
SLIDE 18

Moving Average

Based on error; (a “smoothing” technique). Q: Best estimator of random data (i.e. white noise)? A: The mean

slide-19
SLIDE 19

Moving Average

Based on error; (a “smoothing” technique). Q: Best estimator of random data (i.e. white noise)? A: The mean Simple Moving Average

slide-20
SLIDE 20

Moving Average Model

In a regression model (ARMA or ARIMA), we consider error terms

slide-21
SLIDE 21

Moving Average Model

In a regression model (ARMA or ARIMA), we consider error terms

slide-22
SLIDE 22

Moving Average Model

In a regression model (ARMA or ARIMA), we consider error terms Notation:

attributed to “shocks” -- independent, from a normal distribution

slide-23
SLIDE 23

ARMA Models

AutoRegressive (AR) Moving Average (MA) Model ARMA(p, q): ARMA(1, 1): example: Y is sales; error may be effect from coupon or advertising (credit: Ben Lambert)

slide-24
SLIDE 24

ARIMA

I = Integrated Makes a time series stationary:

  • Removes trends (“detrending”)
  • Makes “mean reverting” = tendency to always revert back to the mean over

the long run.

  • Removes changes in variance
slide-25
SLIDE 25

Time-series Applications

  • ARMA

○ Economic indicators ○ System performance ○ Trend analysis (often situations where there is a general trend and random “shocks”)

  • Univariate Models in General

○ Anomaly Detection ○ Forecasting ○ Season Trends ○ Signal Processing

  • Integration as predictors within multivariate models

statsmodels.tsa.arima_model