Professional Documents
Culture Documents
Introduction To Time Series Analysis: Welcome To The Course!
Introduction To Time Series Analysis: Welcome To The Course!
Welcome to
the Course!
Introduction to Time Series Analysis
Introduction
● Time Series: A sequence of data in chronological order
● Data is commonly recorded sequentially, over time
● Time series data is everywhere
BMW Daily log stock returns
0.10
0.05
0.00
−0.05
−0.10
−0.15
10
5
0
−5
Year
Introduction to Time Series Analysis
> 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
...
Introduction to Time Series Analysis
●
2
● ●
● ●
●
Time_Series
●
●
●
●
0
● ●
●
−1
●
−2
5 10 15 20
Time
Introduction to Time Series Analysis
Let’s practice!
INTRODUCTION TO TIME SERIES ANALYSIS
Sampling Frequency
Introduction to Time Series Analysis
● ●
●
● ●
● ●
72
●
●
Hourly Temp.
70
●
●
●
●
●
68
● ●
●
●
66
● ●
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time
Introduction to Time Series Analysis
●
●
● ●
●
● ● ●
● ●
72
●●
●
●
Hourly Temp.
●
70
●
●
●
68
●
●
66
● ●
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time
Introduction to Time Series Analysis
● ●
●
●
72
●
Hourly Temp.
●
●
70
●
68
●
66
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time
Introduction to Time Series Analysis
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 day.
Introduction to Time Series Analysis
> start(Hourly_series)
[1] 1 1
> end(Hourly_series)
[1] 1 24
> frequency(Hourly_series)
[1] 24
> deltat(Hourly_series)
[1] 0.0417
INTRODUCTION TO TIME SERIES ANALYSIS
Let’s practice!
INTRODUCTION TO TIME SERIES ANALYSIS
Basic Time
Series Objects
Introduction to Time Series Analysis
6
4
1 2 3 4 5 6 7 8
Time
Introduction to Time Series Analysis
8
6
4
Time
Introduction to Time Series Analysis
Using is.ts()
● The is.ts() function checks whether an object is of the ts() class:
> is.ts(data_vector)
[1] FALSE
> is.ts(time_series)
[1] TRUE
Introduction to Time Series Analysis
Let’s practice!