← Back to all sparks
T

trendseries

ANALYTICS
Velocity3.8

R package trendseries by viniciusoike — release notes from GitHub.

A trend-extraction toolkit grows a full decomposition engine, seasonal components and all.

time-serieseconometricsr-packageseasonal-decompositiontrend-extractionreproducibility
Current state
trendseries extracts trends from economic time series through two pipe-friendly functions, backed by an unusually broad method set — Hodrick-Prescott in one- and two-sided variants, Baxter-King, Christiano-Fitzgerald, Hamilton regression, Beveridge-Nelson, unobserved components, plus the moving average and smoothing family. The 1.4 release adds decomposition proper: an exported decompose_series() that splits a series into trend, seasonal, and remainder across five methods and guarantees the components add back to the original values.
Where it's heading
The package is moving from breadth of methods to rigour about what those methods produce. Recent work has been about defaults and guarantees rather than new filters: the unobserved components model now derives its signal-to-noise ratios from Hodrick-Prescott lambdas so the default output is economically interpretable, decomposition carries an exact additive identity, and a log transform gives a uniform multiplicative variant across every method. Naming is being tidied in the same spirit, with group_vars deprecated in favour of group_cols. Side-by-side method comparison — passing several methods and getting each one's components as separate columns — suggests an audience that treats method choice as a research question rather than a setting.
Prediction
Expect the comparison and diagnostic side to keep developing, since the package now produces multiple decompositions of the same series and offers no ranking between them; the entries give no indication of new filters being queued.

Recent moves

  1. 15d ago

    Decomposition becomes a first-class operation, five methods deep

    ⚡ SPARK

    The package's output type changes: alongside trend columns it now returns seasonal and remainder components, via an exported decompose_series() covering STL, regression, classical moving averages, a state-space basic structural model, and X-13ARIMA-SEATS. It also folds in the 1.3.0 development series that never reached CRAN, so this release carries more than its version gap suggests.

    View source ↗
  2. 3mo ago

    Multi-column trends and economically grounded UCM defaults

    augment_trends() accepts several value columns at once, naming outputs by method and column, which matters for anyone running the same filter across a panel. The more substantive change is under the hood: the unobserved components model now uses fixed variance components with signal-to-noise ratios derived from Hodrick-Prescott lambdas, so its default trends are smoother and interpretable without tuning. group_vars is deprecated in favour of group_cols.

    View source ↗
  3. 10mo ago

    First production release with 21 trend extraction methods

    The baseline the later releases build on: 21 methods spanning econometric filters, moving averages, smoothing and signal processing, behind a deliberately small two-function API. The breadth established here is what makes the later work — better defaults, exact identities, side-by-side comparison — the useful next problem.

    View source ↗