analyze_series: Analyze a series' shape for model recommendation

View source: R/recommend.R

analyze_seriesR Documentation

Analyze a series' shape for model recommendation

Description

A lightweight, no-model-fitting heuristic: measures trend/seasonal strength (via STL decomposition), differencing needed (forecast::ndiffs/nsdiffs), missing-data ratio, and a Box-Jenkins ACF/PACF-based (p,q)(P,Q) order suggestion. Feeds recommend_model()'s scoring and the app's suggested-hyperparameters table.

Usage

analyze_series(df, date_agg = "day", robust = FALSE)

Arguments

df

A tibble with ds/y columns.

date_agg

Aggregation frequency: one of "hour", "day", "week", "month", "quarter", "year".

robust

Logical; use robust (outlier-downweighted) STL when a seasonal decomposition is attempted internally. Default FALSE.

Value

A list with n_obs, detected_freq, n_cycles, trend_strength, seasonal_strength, ndiffs_needed, nsdiffs_needed, missing_ratio, arima_p, arima_q, arima_P, arima_Q.

Examples

df <- tibble::tibble(ds = as.Date("2024-01-01") + 0:29, y = 1:30 + rnorm(30))
analyze_series(df, date_agg = "day")

forecastsuite documentation built on Oct. 18, 2026, 5:08 p.m.