0% found this document useful (0 votes)
67 views31 pages

Unit 1

Uploaded by

Aa Hinda no Aria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views31 pages

Unit 1

Uploaded by

Aa Hinda no Aria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Some logistics...

Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Unit 1: Introduction to Time Series

1 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

1 Some logistics...

2 Introduction to Time Series

3 Objectives of Time Series

4 Time Domain Vs Frequency Domain

5 A Few More Examples

2 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Course administrative

• Lecture handouts. Posted day before class.


• Assignments. I will go through the R tutorial especially early
on.
• Data sets for assignments.
• (Almost) anything you’d like for the course.

3 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

1 Some logistics...

2 Introduction to Time Series

3 Objectives of Time Series

4 Time Domain Vs Frequency Domain

5 A Few More Examples

4 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Introduction to Time Series

Time Series are data collected in a sequence. They are usually


evenly spaced and because of the sequential nature are statistically
dependent observations.

5 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Introduction to Time Series

A common assumption for data is that the observations are


independent and identically distributed (iid), i.e. the outcome
at one point in the sequence does not effect the outcome at
another point in the sequence. The nature of our observations
then will be a sequence of (typically real) numbers x1 , · · · , xn
where the index represents some type of ordering. Unlike iid
sequences, order matters in time series.

6 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Introduction to Time Series

Time series also differs from data such as regression data, where
we have pairs of numbers and are looking for the relationship
between the pairs. We will see as we move along that there is a
relationship to regression in that we can form pairs from the
sequenced observations.

7 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Example: S&P 500 stock

8 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

1 Some logistics...

2 Introduction to Time Series

3 Objectives of Time Series

4 Time Domain Vs Frequency Domain

5 A Few More Examples

9 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Objectives of Time Series

1 Description.
2 Interpretation / Explanation.
3 Prediction / Forecasting.
4 Control.
5 Hypothesis testing.
6 Simulation.

10 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Description

Some of the features of time series data we look out for are:
• Trend.
• Periodicity / Seasonality.
• Is the mean changing over time?
• Is the variation changing over time?
• Are there abrupt changes?
• Are there outliers?

Time series plots will be an important tool.

11 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Example: Monthly Sales at Souvenir Shop

Figure : Monthly sales for a souvenir shop at a beach resort town in


Queensland, Australia, Jan 1987-Dec 1993.
1e+05
8e+04
6e+04
sales

4e+04
2e+04
0e+00

0 20 40 60 80

Time

12 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Example: Monthly Sales at Souvenir Shop

Regress sales on time index.


Regress sales on time index


1e+05
8e+04


6e+04
sales



4e+04



● ●●
● ●
● ●
2e+04


● ●
● ●
● ●
● ●
● ●

● ● ● ● ●
● ● ●
●●
● ● ●●●● ● ●
● ●● ●●●●●● ●
● ● ●●● ●● ● ●
● ● ● ●●●●●●● ●● ● ●
0e+00

●●●● ● ●
●●

0 20 40 60 80

time

Appears to be increasing trend.

13 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Example: Monthly Sales at Souvenir Shop


1e+05
8e+04
6e+04
sales

4e+04
2e+04
0e+00

0 20 40 60 80

Time

Notice peaks at every 12 time period interval. Suggests presence


of seasonality.
14 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

1 Some logistics...

2 Introduction to Time Series

3 Objectives of Time Series

4 Time Domain Vs Frequency Domain

5 A Few More Examples

15 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Two Approaches to Time Series

There are two primary approaches to time series. One is the time
domain approach. This approach focuses on the rules for a time
series to move forward. For example, how do yesterday’s and
today’s observations affect tomorrow’s observation?

16 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Two Approaches to Time Series

The other approach is the frequency domain approach. This


approach tries to understand how differing oscillations can
contribute to current observations. For example, taking hourly
temperatures in Charlottesville, VA. There will be a very clear 24
hour oscillation. There will be another clear 8,760 hour oscillation.
The current temperature is a sum of these two sinusoids (plus a lot
of noise and fluctuation).

17 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

1 Some logistics...

2 Introduction to Time Series

3 Objectives of Time Series

4 Time Domain Vs Frequency Domain

5 A Few More Examples

18 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Summer Temperature in Munich

The next example is a series that involves the average summer


temperature for each year in Munich from 1781 to 1988.

19 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Summer Temperature in Munich

Figure : Average Summer Temperature, Munich 1781-1988.


17
16
summer

15
14

1800 1850 1900 1950

Time

20 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Summer Temperature in Munich

The level of variance seems to be changing. There seems to be a


very mild sinusoidal trend. It is usually not trivial to detect long
range weather trends at one location.

21 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Summer Temperature in Munich

One way to assess independence is through correlation.


Independent random variables (RVs) are uncorrelated, but
uncorrelated RVs may or may not be independent. Mostly we’ll be
dealing with normal RVs in which case we won’t have to worry
about this. An autocorrelation plot is a tool which can aid us in
assessing correlation

22 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Summer Temperature in Munich

Figure : ACF for summer data.

Series summer
1.0
0.8
0.6
ACF

0.4
0.2
0.0

0 5 10 15 20

Lag

23 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Average Monthly Temperature in Dubuque, IA

Another temperature time series is the average monthly


temperature in Dubuque, IA. This is highly periodic. Later we’ll
talk about taking seasonal effects into account. We’ll also discuss
decomposing variation into Fourier components.

24 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Average Monthly Temperature in Dubuque, IA

Figure : Average monthly temperature: Dubuque, IA.


70
60
50
Temp (F)

40
30
20
10

1964 1966 1968 1970 1972 1974 1976

Time

25 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Marriages in the Church of England

There was a data set made famous by Yule concerning the number
of marriages in the Church of England as a percentage of all
marriages. It appears as a somewhat negative linear trend. If we
perform a linear regression, then the residuals are correlated. We
may want to tackle trends in a slightly different way to deal with
the dependency.

26 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Marriages in the Church of England

Figure : Percent of Marriages in Church of England.


75
70
Percent

65
60

1870 1880 1890 1900 1910

Time

27 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Marriages in the Church of England

Figure : ACF of residuals for marriage data.

Series fit$resid
1.0
0.8
0.6
0.4
ACF

0.2
0.0
−0.2

0 5 10 15

Lag

28 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

IBM Stock Prices

In another data set with a clear trend, we look at the closing stock
price for IBM stock from Jan 1980 to Oct 1992. A common
transformation for stock price is to look at returns diff (log (xn )).
The resulting series looks fairly stationary except for a huge shock.
Different transformations get us data that’s easier to analyze.

29 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

IBM Stock Prices

Daily closing price Daily returns

0.1
160
140

0.0
Price in dollars

120

Returns

−0.1
100
80

−0.2
60

0 1000 2000 3000 0 1000 2000 3000

Time Time

30 / 31
Some logistics... Introduction to Time Series Objectives of Time Series Time Domain Vs Frequency Domain A Few More Exampl

Homework

Recommended to do before next class: install R on your


computer and go through the tutorials posted

31 / 31

You might also like