R Tutorial - Trends, seasonality and cyclicity

The Occurrence of Serious Patterns in Time Series Data

Sometimes serious patterns occur so frequently that we give them names. A trend occurs when there is a long-term increase or decrease in the data, and this is deliberately a little vague as a trend is not a well-defined mathematical term. However, if I talk about a trend, I mean a general tendency for the time series to go up over time or down over time.

Seasonality, on the other hand, occurs when there is a regular pattern in the time series related to the calendar. For example, a yearly pattern or a weekly pattern or a daily time whenever the behavior of a time series is influenced in a periodic manner by the calendar, we call it seasonal. It's essential to distinguish between seasonality and cyclic patterns. Cyclic patterns occur when there are rises and falls that are not of a fixed period, such as a business cycle that might last three or five or eight years between peaks or troughs.

In contrast, a seasonal pattern is always of the same length. It's probably easiest to see what I mean with some examples. Monthly Australian electricity production is clearly trended with a change in the slope of the trend around 1990. It's also seasonal, and notice how the seasonal pattern changes a little over time with a little more volatility in the trough at the end of this period, then at the beginning there is no cyclic behavior visible in this graph.

Another example is quarterly Australian clay brick production, which shows both seasonality and cyclicity. The seasonality is seen by the small bumps one each year, while the cycle is seen by the longer ups and downs. For instance, there was a recession in 1975 and another one in 1983, and then again in 1991, between these recessions, the series rises and falls, with some trends, particularly in the first half.

US Treasury bill contracts over 100 consecutive days are another example that shows no seasonality. This looks very much like a downward trend, but it's actually part of a much longer cycle. When you have only a short segment of data and you see only part of a cycle, it can look like a trend. However, this series continuing to fall indefinitely is probably not what you would want to forecast.

The number of links trapped annually in the Hudson Bay region of Canada from 1821 to 1934 is also an example of a famous time series. This data cannot be seasonal because it's annual and shows an annual population cycle that rises when there's plenty of food and plummets when the food supply gets low, causing the population to drop, with surviving links then having plenty of food and start to breed again. The length of these cycles varies from between 8 and 11 years.

It's also worth noting how variable the magnitude of cyclic patterns can be. In this case, the largest peak is more than three times the size of the smallest peak. This shows that we need to distinguish between seasonal and cyclic patterns because very different time series models are used in each case to summarize them. Seasonal patterns have constant length, while cyclic patterns have variable length.

If both exist together, then the average length of the cyclic pattern is longer than the length of the seasonal pattern. Moreover, the size of the cycles tends to be more variable than the size of the seasonal fluctuations, making it much harder to predict cyclic data than seasonal data.

"WEBVTTKind: captionsLanguage: ensometimes serious patterns occur so frequently that we give them names a trend occurs when there is a long-term increase or decrease in the data this is deliberately a little vague as a trend is not a well-defined mathematical term but if I talk about a trend I mean a general tendency for the time series to go up over time or down over time seasonality occurs when there is a regular pattern in the time series related to the calendar for example a yearly pattern or a weekly pattern or a daily time whenever the behavior of a time series is influenced in a periodic manner by the calendar we call it seasonal this should be distinguished from cyclic patterns they occur when there are rises and falls that are not of a fixed period for example a business cycle might last three or five or eight years between Peaks or troughs but a seasonal pattern is always of the same length it is probably easiest to see what I mean with some examples this is monthly Australian electricity production it is clearly trended with a change in the slope of the trend around 1990 it is also seasonal notice how the seasonal pattern changes a little over time with a little more volatility in the trough at the end of this period then at the beginning there is no cyclic behavior visible in this graph quarterly Australian clay brick production shows both seasonality and cyclicity the seasonality is seen by the small bumps one each year the solicita is seen by the longer ups and downs for example there was a recession in 1975 and another one in 1983 and then again in 1991 between these recessions the series rises and falls there's also some trends and in this graph particularly in the first half the next graph shows US Treasury bill contracts over 100 consecutive days there's no seasonality here this looks very much like a downward trend but it's actually part of a much longer cycle when you have only a short segment of data and you see only part of a cycle it can look like a trend you probably would not want to forecast this series continuing to fall indefinitely my last example is a famous time series this is the number of links trapped annually in the Hudson Bay region of Canada from 1821 to 1934 link some medium-sized wild cats that used to be trapped for their fur because this is annual data that cannot be seasonal the population of links Rises when there's plenty of food and when the food supply gets low they stop breeding causing the population to plummet the surviving links then have plenty of food start to breed again and the cycle continues the length of these cycles varies from between 8 and 11 years this is also a good example to show how variable the magnitude of cyclic patterns can be with the largest peak being more than three times the size of the smallest peak we need to distinguish between seasonal and cyclic patterns as very different time series models are used in each case to summarize seasonal patterns have constant length while cyclic patterns have variable length if both exists together then the average length of the cyclic pattern is longer than the length of the seasonal pattern the size of the cycles tends to be more variable than the size of the seasonal fluctuations as a result it's much harder to predict cyclic data than seasonal data okay let's get back to looking at data with oursometimes serious patterns occur so frequently that we give them names a trend occurs when there is a long-term increase or decrease in the data this is deliberately a little vague as a trend is not a well-defined mathematical term but if I talk about a trend I mean a general tendency for the time series to go up over time or down over time seasonality occurs when there is a regular pattern in the time series related to the calendar for example a yearly pattern or a weekly pattern or a daily time whenever the behavior of a time series is influenced in a periodic manner by the calendar we call it seasonal this should be distinguished from cyclic patterns they occur when there are rises and falls that are not of a fixed period for example a business cycle might last three or five or eight years between Peaks or troughs but a seasonal pattern is always of the same length it is probably easiest to see what I mean with some examples this is monthly Australian electricity production it is clearly trended with a change in the slope of the trend around 1990 it is also seasonal notice how the seasonal pattern changes a little over time with a little more volatility in the trough at the end of this period then at the beginning there is no cyclic behavior visible in this graph quarterly Australian clay brick production shows both seasonality and cyclicity the seasonality is seen by the small bumps one each year the solicita is seen by the longer ups and downs for example there was a recession in 1975 and another one in 1983 and then again in 1991 between these recessions the series rises and falls there's also some trends and in this graph particularly in the first half the next graph shows US Treasury bill contracts over 100 consecutive days there's no seasonality here this looks very much like a downward trend but it's actually part of a much longer cycle when you have only a short segment of data and you see only part of a cycle it can look like a trend you probably would not want to forecast this series continuing to fall indefinitely my last example is a famous time series this is the number of links trapped annually in the Hudson Bay region of Canada from 1821 to 1934 link some medium-sized wild cats that used to be trapped for their fur because this is annual data that cannot be seasonal the population of links Rises when there's plenty of food and when the food supply gets low they stop breeding causing the population to plummet the surviving links then have plenty of food start to breed again and the cycle continues the length of these cycles varies from between 8 and 11 years this is also a good example to show how variable the magnitude of cyclic patterns can be with the largest peak being more than three times the size of the smallest peak we need to distinguish between seasonal and cyclic patterns as very different time series models are used in each case to summarize seasonal patterns have constant length while cyclic patterns have variable length if both exists together then the average length of the cyclic pattern is longer than the length of the seasonal pattern the size of the cycles tends to be more variable than the size of the seasonal fluctuations as a result it's much harder to predict cyclic data than seasonal data okay let's get back to looking at data with our\n"