Time series attributes

Manipolare dati di serie temporali in R

Harrison Brown

Graduate Researcher in Geography

Temporal attributes

  • Start point
  • End point
  • Frequency

Temporal attributes can be used to:

  • Understand when and for how long the data was sampled
  • Find the times where multiple time series overlap

Conceptual diagram of two overlapping time series; the last part of time series A overlaps the first part of time series B.

Conceptual diagram outlining the challenge of combining two overlapping time series. In the overlapping region of the combined time series, there is a dotted line, representing how the data in that region is uncertain.

Manipolare dati di serie temporali in R

Temporal attributes

Key temporal attributes:

  • Start point
start(AirPassengers)
[1] 1949 1
Manipolare dati di serie temporali in R

Temporal attributes

Key temporal attributes:

  • Start point
  • End point
end(ftse)
[1] 1998.646
  • Decimal date (numeric)
end(ftse) %>%
  lubridate::date_decimal()
[1] "1998-08-24 20:18:27 UTC"
Manipolare dati di serie temporali in R

Temporal attributes

Key temporal attributes:

  • Starting point
  • Endpoint
  • Frequency
frequency(monthly_data)
[1] 12
frequency(weekly_data)
[1] 52.14286
frequency(ftse)
[1] 260
ftse
1991.4962 2443.6
1991.5    2460.2
1991.5038 2448.2
1991.5077 2470.4
1991.5115 2484.7
1991.5154 2466.8
...
Manipolare dati di serie temporali in R

Regular vs. irregular time series

A conceptual timeline showing a regular time series. Above the line are markers representing each observation. The markers are spaced at regular intervals.

  • Evenly-spaced intervals
  • No missing values
  • Uses decimal date for 'irregular' intervals

A conceptual timeline showing an irregular time series. As opposed to the 'regular time series' diagram, the markers in this time series are not spaced at regular intervals, with uneven gaps between observations.

  • Spacing can be irregular
    • Weekdays, random days
  • Missing observations
  • Decimal date or Date/POSIXct data
Manipolare dati di serie temporali in R

Let's practice!

Manipolare dati di serie temporali in R

Preparing Video For Download...