Skip to content

Feat/decompose series#8

Merged
viniciusoike merged 8 commits into
mainfrom
feat/decompose-series
Jun 7, 2026
Merged

Feat/decompose series#8
viniciusoike merged 8 commits into
mainfrom
feat/decompose-series

Conversation

@viniciusoike

Copy link
Copy Markdown
Owner

No description provided.

viniciusoike and others added 8 commits May 12, 2026 23:05
- Simplify econometric-filters vignette title
- Add axis.title.x = element_blank() to theme in both vignettes
- Split data-processing and plotting into separate code chunks
- Refactor window-comparison plot to use facets with original series overlay
- Add Henderson MA to method list; use glimpse() for data preview

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pipe-friendly function decomposing time series into trend, seasonal, and
remainder components via STL or regression-based methods, with grouping
support. Includes full test coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduce R/method_registry.R with .method_info() and .valid_methods()
as the canonical source of truth for supported trend methods. Both
augment_trends() and extract_trends() now read from .valid_methods()
instead of hardcoding parallel method vectors that could drift apart.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
decompose_series() gains:
- three methods: "classic" (stats::decompose), "bsm" (stats::StructTS
  via the Kalman smoother), and "seats" (X-13ARIMA-SEATS via the
  optional seasonal package)
- vector-valued method= for side-by-side comparison
- transform = "log" for a uniform multiplicative decomposition
- seasadj = TRUE to add the seasonally adjusted series
- per-method params validation and NA-row handling

deseason_series() is a new exported convenience wrapper around
decompose_series() focused on seasonal adjustment.

Add seasonal to Suggests (only required for method = "seats", guarded
with requireNamespace()).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- New "Trend Extraction Methods" vignette cataloguing all 20 methods
- New "Decomposing Series" vignette
- README: list decompose_series(), full 20-method table, vignette links
- _pkgdown.yml: add the two vignettes and a Decomposition reference group
- NEWS.md: document the 1.3.0 changes

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… type

- Rename `method` -> `methods` in decompose_series() and deseason_series()
  for consistency with augment_trends().
- Remove the native multiplicative `classic` estimator (params$type);
  transform = "log" already provides a uniform multiplicative path for
  every method, so the special-casing and its tests are gone.
- Simplify the regression decomposition with predict(type = "terms")
  instead of a manual model-matrix split; seasonal is now mean-centred.
- Harden the X-13ARIMA-SEATS path: guard the s11/s12 extraction and note
  that transform = "none" is preferred (X-13 handles transformation).
- Drop variable shadowing of base::start; tidy classic/bsm/seats signatures.
- Fix a broken example (oil_derivatives has `production`, not `index`).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Write the previously unfinished "classic", "bsm", and "seats" method
  sections.
- Guard the seats/deseason chunks with eval = requireNamespace("seasonal")
  so the vignette builds where the Suggested package is absent.
- Fix the electricity plot (was plotting remainder_stl but labelled "Trend").
- Rename method -> methods; clarify manual-log vs transform = "log";
  tidy titles/axis labels, fix typos and grammar.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The vignettes use ggplot2 4.0 features (theme paper=, palette.colour.discrete,
and the layer layout= argument), so pin the Suggests floor accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@viniciusoike
viniciusoike merged commit 5cf8deb into main Jun 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant