Welcome to the Course! ARIMA Modeling with R About Me Professor - - PowerPoint PPT Presentation

welcome to the course
SMART_READER_LITE
LIVE PREVIEW

Welcome to the Course! ARIMA Modeling with R About Me Professor - - PowerPoint PPT Presentation

ARIMA MODELING WITH R Welcome to the Course! ARIMA Modeling with R About Me Professor of Statistics Co-author of two texts on time series astsa- package ARIMA Modeling with R Time series are everywhere!


slide-1
SLIDE 1

ARIMA MODELING WITH R

Welcome to the Course!

slide-2
SLIDE 2

ARIMA Modeling with R

About Me

  • Professor of Statistics
  • Co-author of two texts on time series

  • astsa-package
slide-3
SLIDE 3

ARIMA Modeling with R

Time series…

  • … are everywhere!
  • Finance
  • Industrial Processes
  • Nature
  • Autoregressive (AR) & Moving Average (MA): ARMA
  • Integrated ARMA: ARIMA
slide-4
SLIDE 4

ARIMA Modeling with R

Course outline

  • Chapter 1: Time Series Data and Models
  • Chapter 2: Fiing ARMA models
  • Chapter 3: ARIMA models
  • Chapter 4: Seasonal ARIMA
slide-5
SLIDE 5

ARIMA Modeling with R

Prerequisites

  • Introduction to R
  • Intermediate R
  • Introduction to Time Series Analysis in R
slide-6
SLIDE 6

ARIMA MODELING WITH R

Let’s get started!

slide-7
SLIDE 7

ARIMA MODELING WITH R

First Things First

slide-8
SLIDE 8

ARIMA Modeling with R

About Me

  • Professor of Statistics
  • Co-author of two texts on time series

  • astsa-package
slide-9
SLIDE 9

ARIMA Modeling with R

Time Series Data - I

> library(astsa) > plot(jj, main = "Johnson & Johnson Quarterly Earnings per Share", type = "c") > text(jj, labels = 1:4, col = 1:4)

slide-10
SLIDE 10

ARIMA Modeling with R

Time Series Data - II

> library(astsa) > plot(globtemp, main = "Global Temperature Deviations", type= "o")

slide-11
SLIDE 11

ARIMA Modeling with R

Time Series Data - III

> library(xts) > plot(sp500w, main = "S&P 500 Weekly Returns")

slide-12
SLIDE 12

ARIMA Modeling with R

Time Series Regression Models

Regression: , where is white noise White Noise:

  • independent normals with common variance
  • is basic building block of time series

Moving Average: ( is white noise) AutoRegression: ( is white noise) ARMA:

slide-13
SLIDE 13

ARIMA MODELING WITH R

Let’s practice!

slide-14
SLIDE 14

ARIMA MODELING WITH R

Stationarity and Nonstationarity

slide-15
SLIDE 15

ARIMA Modeling with R

Stationarity

  • the mean is constant over time (no trend)
  • the correlation structure remains constant over time

A time series is stationary when it is “stable”, meaning:

slide-16
SLIDE 16

ARIMA Modeling with R

Stationarity

Given data, we can estimate by averaging For example, if the mean is constant, we can estimate it by the sample average Pairs can be used to estimate correlation on different lags: for lag 1 for lag 2

slide-17
SLIDE 17

ARIMA Modeling with R

Southern Oscillation Index

Reasonable to assume stationary, but perhaps some slight trend.

slide-18
SLIDE 18

ARIMA Modeling with R

Southern Oscillation Index

To estimate autocorrelation, compute the correlation coefficient between the time series and itself at various lags. Here you see how to get the correlation at lag 1 and lag 6.

slide-19
SLIDE 19

ARIMA Modeling with R

Random Walk Trend

Not stationary, but differenced data are stationary.

globtemp diff(globtemp)

slide-20
SLIDE 20

ARIMA Modeling with R

Trend Stationarity

Stationarity around a trend, differencing still works!

chicken diff(chicken)

slide-21
SLIDE 21

ARIMA Modeling with R

Nonstationarity in trend and variability

First log, then difference

slide-22
SLIDE 22

ARIMA MODELING WITH R

Let’s practice!

slide-23
SLIDE 23

ARIMA MODELING WITH R

Stationary Time Series: ARMA

slide-24
SLIDE 24

ARIMA Modeling with R

Note: Special case of MA( ) is already of this form, 
 where constants are aer -th term.

q

q

Wold Decomposition

Any ARMA model has this form, which means they are suited to modeling time series. For constants Wold proved that any stationary time series may be represented as a linear combination of white noise:

slide-25
SLIDE 25

ARIMA Modeling with R

Generating ARMA using arima.sim()

  • Basic syntax:

arima.sim(model, n, …)

Order of AR Order of MA

  • model is a list with order of the model as c(p, d, q)


and the coefficients

  • n is the length of the series
slide-26
SLIDE 26

ARIMA Modeling with R

Generate MA(1) given by

> x <- arima.sim(list(order = c(0, 0, 1), ma = 0.9), n = 100) > plot(x)

Generating and ploing MA(1)

slide-27
SLIDE 27

ARIMA Modeling with R

> x <- arima.sim(list(order = c(2, 0, 0), ar = c(0, -0.9)), n = 100) > plot(x)

Generating and ploing AR(2)

Generate AR(2) given by

slide-28
SLIDE 28

ARIMA MODELING WITH R

Let’s practice!