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 v er time . Time series data is e v er yw here . TIME SERIES ANALYSIS IN R
Time series e x ample Monthl y v al u es of the Cons u mer Price Inde x ( CPI ): 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 ... TIME SERIES ANALYSIS IN R
Time series plots plot(Time_Series) TIME SERIES ANALYSIS IN R
Basic time series models White Noise ( WN ) Random Walk ( RW ) A u toregression ( AR ) Simple Mo v ing A v erage ( MA ) 1 Thro u gho u t this co u rse , y o u w ill not onl y be learning ho w to u se R for time series anal y sis and forecasting , y o u w ill also learn se v eral models for time TIME SERIES ANALYSIS IN R
Time series plots TIME SE R IE S AN ALYSIS IN R
Sampling freq u enc y TIME SE R IE S AN ALYSIS IN R Da v id S . Ma � eson Associate Professor at Cornell Uni v ersit y
Sampling freq u enc y: e x act Some time series data is e x actl y e v enl y spaced . TIME SERIES ANALYSIS IN R
Sampling freq u enc y: appro x imate Some time series data is onl y appro x imatel y e v enl y spaced . TIME SERIES ANALYSIS IN R
Sampling freq u enc y: missing v al u es Some time series data is e v enl y spaced , b u t w ith missing v al u es . TIME SERIES ANALYSIS IN R
Basic ass u mptions Simplif y ing ass u mptions for time series : Consec u ti v e obser v ations are eq u all y spaced . Appl y a discrete - time obser v ation inde x. This ma y onl y hold appro x imatel y. E x. Dail y log ret u rns on stock ma y onl y be a v ailable for w eekda y s . E x. Monthl y CPI v al u es are eq u all y spaced b y month , not b y da y s . TIME SERIES ANALYSIS IN R
Sampling freq u enc y: R f u nctions R f u nctions : start() , frequency(Hourly_series) end() , frequency() , deltat() 24 start(Hourly_series) deltat(Hourly_series) 1 1 0.0417 end(Hourly_series) 1 24 TIME SERIES ANALYSIS IN R
Let ' s practice ! TIME SE R IE S AN ALYSIS IN R
Basic time series objects TIME SE R IE S AN ALYSIS IN R Da v id S . Ma � eson Associate Professor at Cornell Uni v ersit y
B u ilding ts () objects - I time_series <- ts(data_vector) Start w ith a v ector of data plot(time_series) Appl y the ts() f u nction data_vector 10 6 11 8 10 3 6 9 TIME SERIES ANALYSIS IN R
B u ilding ts () objects - II Specif y the start date and obser v ation freq u enc y: time_series <- ts(data_vector, start = 2001, frequency = plot(time_series) TIME SERIES ANALYSIS IN R
Using is . ts () The is.ts() f u nction checks w hether an object is of the ts() class : is.ts(data_vector) FALSE is.ts(time_series) TRUE TIME SERIES ANALYSIS IN R
Wh y ts () objects ? Wh y create and u se time series objects of the ts () class ? Impro v ed plo � ing . Access to time inde x information . Model estimation and forecasting ( later chapters ). TIME SERIES ANALYSIS IN R
Let ' s practice ! TIME SE R IE S AN ALYSIS IN R
Recommend
More recommend