| decompose_series | R Documentation |
Surfaces the STL trend/seasonal/remainder split that analyze_series()
already computes internally to drive the recommendation heuristic, as a
tidy tibble a caller can plot directly.
decompose_series(df, date_agg = "day", robust = FALSE)
df |
A tibble with |
date_agg |
Aggregation frequency: one of |
robust |
Logical; use robust (outlier-downweighted) STL –
|
A tibble with columns ds, observed, trend, seasonal,
remainder, or NULL (not an error) when no candidate frequency has
enough cycles of data, or date_agg has no seasonal candidates at all
(e.g. "year").
n <- 60
df <- tibble::tibble(ds = as.Date("2024-01-01") + 0:(n - 1),
y = 100 + 10 * sin(2 * pi * seq_len(n) / 7) + rnorm(n))
decompose_series(df, date_agg = "day")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.