Welcome to the co u rse ! TIME SE R IE S AN ALYSIS IN R Da v id S - - PowerPoint PPT Presentation

welcome to the co u rse
SMART_READER_LITE
LIVE PREVIEW

Welcome to the co u rse ! TIME SE R IE S AN ALYSIS IN R Da v id S - - PowerPoint PPT Presentation

Welcome to the co u rse ! TIME SE R IE S AN ALYSIS IN R Da v id S . Ma eson Associate Professor at Cornell Uni v ersit y Introd u ction Time Series : A seq u ence of data in chronological order . Data is commonl y recorded seq u entiall y, o


slide-1
SLIDE 1

Welcome to the course!

TIME SE R IE S AN ALYSIS IN R

David S. Maeson

Associate Professor at Cornell University

slide-2
SLIDE 2

TIME SERIES ANALYSIS IN R

Introduction

Time Series: A sequence of data in chronological order. Data is commonly recorded sequentially, over time. Time series data is everywhere.

slide-3
SLIDE 3

TIME SERIES ANALYSIS IN R

Time series example

Monthly values of the Consumer Price Index (CPI):

slide-4
SLIDE 4

TIME SERIES ANALYSIS IN R

Time series data

Time series data is dated or time stamped in R.

print(BMW_data) ... 1996-07-08 0.002 1996-07-09 -0.006 1996-07-10 -0.016 1996-07-11 -0.020 1996-07-14 -0.006 1996-07-15 -0.014 1996-07-16 0.002 1996-07-17 -0.001 ...

slide-5
SLIDE 5

TIME SERIES ANALYSIS IN R

Time series plots

plot(Time_Series)

slide-6
SLIDE 6

TIME SERIES ANALYSIS IN R

Basic time series models

White Noise (WN) Random Walk (RW) Autoregression (AR) Simple Moving Average (MA)

Throughout this course, you will not only be learning how to use R for time series analysis and forecasting, you will also learn several models for time

1

slide-7
SLIDE 7

Time series plots

TIME SE R IE S AN ALYSIS IN R

slide-8
SLIDE 8

Sampling frequency

TIME SE R IE S AN ALYSIS IN R

David S. Maeson

Associate Professor at Cornell University

slide-9
SLIDE 9

TIME SERIES ANALYSIS IN R

Sampling frequency: exact

Some time series data is exactly evenly spaced.

slide-10
SLIDE 10

TIME SERIES ANALYSIS IN R

Sampling frequency: approximate

Some time series data is only approximately evenly spaced.

slide-11
SLIDE 11

TIME SERIES ANALYSIS IN R

Sampling frequency: missing values

Some time series data is evenly spaced, but with missing values.

slide-12
SLIDE 12

TIME SERIES ANALYSIS IN R

Basic assumptions

Simplifying assumptions for time series: Consecutive observations are equally spaced. Apply a discrete-time observation index. This may only hold approximately.

  • Ex. Daily log returns on stock may only be available for

weekdays.

  • Ex. Monthly CPI values are equally spaced by month, not by

days.

slide-13
SLIDE 13

TIME SERIES ANALYSIS IN R

Sampling frequency: R functions

R functions: start() ,

end() , frequency() , deltat() start(Hourly_series) 1 1 end(Hourly_series) 1 24 frequency(Hourly_series) 24 deltat(Hourly_series) 0.0417

slide-14
SLIDE 14

Let's practice!

TIME SE R IE S AN ALYSIS IN R

slide-15
SLIDE 15

Basic time series

  • bjects

TIME SE R IE S AN ALYSIS IN R

David S. Maeson

Associate Professor at Cornell University

slide-16
SLIDE 16

TIME SERIES ANALYSIS IN R

Building ts() objects - I

Start with a vector of data Apply the ts() function

data_vector 10 6 11 8 10 3 6 9 time_series <- ts(data_vector) plot(time_series)

slide-17
SLIDE 17

TIME SERIES ANALYSIS IN R

Building ts() objects - II

Specify the start date and observation frequency:

time_series <- ts(data_vector, start = 2001, frequency =

plot(time_series)

slide-18
SLIDE 18

TIME SERIES ANALYSIS IN R

Using is.ts()

The is.ts() function checks whether an object is of the

ts() class: is.ts(data_vector) FALSE is.ts(time_series) TRUE

slide-19
SLIDE 19

TIME SERIES ANALYSIS IN R

Why ts() objects?

Why create and use time series objects of the ts() class? Improved ploing. Access to time index information. Model estimation and forecasting (later chapters).

slide-20
SLIDE 20

Let's practice!

TIME SE R IE S AN ALYSIS IN R