find_seasonalities: Find seasonalities

View source: R/utils.R

find_seasonalitiesR Documentation

Find seasonalities

Description

Get seasonalities in a time series by iterative spectral density estimation

Usage

find_seasonalities(y, max_iter = 5, aggregator = sum, upper_limit = 1500)

Arguments

y

The time series to detect seasonality in - a numeric vector.

max_iter

The maximal number of iterations - of the spectral density decomposition and aggregation cycles

aggregator

How seasonalities are aggregated - by default **sum**.

upper_limit

The highest possible seasonality to be found in a time series - by default 1500.

Details

This algorithm computes the spectral density of a time series y, using an AR process

Value

A vector of seasonalities.

See Also

[stats::spec.ar()]. If this returns a period longer than 1, the time series is aggregated, using the previous period as an aggregation window. This is done by applying a function to slices of the time series (by default, the **sum**). Then the first step is repeated with the new, shorter time series. This is repeated until either no seasonality is found, **max_ter** iterations of the algorithm have been carried out, or the **upper_limit** for period length is reached. None that the upper limit is relatively liberal, and should not be reached until you have minute (or smaller) samples of the data, multiple seasonalities, and years of data.


JSzitas/fable.tbats documentation built on April 18, 2023, 1:55 a.m.