Skip to contents

localintel 0.2.2

Eurostat Column Robustness, Cascade Metadata Fixes, Insight Formatting

New Features

Bug Fixes

  • src_{var}_level no longer NA after imputation (R/cascade.R)
    • After PCHIP interpolation or ETS forecasting, source-level metadata (src_{var}_level) is now forward/backward filled per region using tidyr::fill(.direction = "downup"). Previously, interpolated and forecasted cells retained NA because the cascade only assigned source levels to observed values.
  • Insight panel: fixed +- percentage formatting (subnational.html)
    • The “What the data reveals” panel now correctly formats percentage changes using proper sign symbols (+ / ) and absolute values, preventing malformed strings like +-101.0% or negative numbers after “fell by”.
  • Insight panel: polarity-aware direction language (subnational.html)
    • The EU average evolution narrative now accounts for variable polarity (higherIs: 'worse' vs 'better'). A decrease in mortality rate is correctly reported as “improved”, not “deteriorated”.
  • Insight panel: variable-specific context (subnational.html)
    • All insight narratives now use each variable’s context field (e.g. “mortality outcomes”, “educational attainment”, “economic output”) instead of hardcoded “health system capacity” or “health outcomes”.
  • Insight panel: negative differential in Top 5 vs Bottom 5 (subnational.html)
    • For variables where lower is better (e.g. mortality rate), the Top 5 vs Bottom 5 differential is now displayed as an absolute value, preventing confusing negative numbers like “-1431.1 per 100,000”.

Tests

  • Added 3 unit tests for normalize_eurostat_cols() in test-utils.R (mangled geo column, TIME_PERIOD rename, no-op on standard columns).
  • Added 2 unit tests for src_level propagation in test-cascade.R (interpolated cells, forecasted years).

localintel 0.2.1

Imputation Integration, Smart Caching, Tests

New Features

  • Integrated Adaptive Imputation in Cascade
    • cascade_to_nuts2() now accepts impute = TRUE (default) and forecast_to parameters. After cascading, each region’s time series is automatically filled using PCHIP interpolation (internal gaps) and optionally ETS forecasting (future periods, best model selected via AIC).
    • New imp_{variable}_flag columns track imputation method per value: 0 = observed/cascaded, 1 = PCHIP interpolated, 2 = ETS forecasted.
    • The existing src_{variable}_level columns are preserved for cascade source tracking.
    • Set impute = FALSE for legacy behaviour (no gap-filling).
  • Session-Level Smart Caching (R/cache.R)
  • Test Suite (tests/testthat/)
    • Comprehensive unit tests for utils, imputation, cascade, data processing, and caching functions using mock data (no Eurostat API calls required).

Bug Fixes


localintel 0.2.0

Econometric Imputation

New Features

  • Econometric Imputation Module (R/imputation.R)
    • interp_pchip_flag(): PCHIP (Piecewise Cubic Hermite Interpolating Polynomial) interpolation for missing years within the observed range. Uses monotone Hermite splines (Fritsch-Carlson method) which preserve monotonicity and handle non-linear patterns without overshooting — a significant upgrade over the previous linear interpolation approach.
    • forecast_autoregressive(): Exponential smoothing state space model (ETS) for forecasting beyond observed data. Autoregressive by design, it automatically selects optimal smoothing parameters via AICc. Falls back to Holt’s linear trend when the forecast package is unavailable.
    • impute_series(): Unified pipeline combining PCHIP interpolation (for internal gaps) with autoregressive forecasting (for future periods). Returns a complete series with flags distinguishing observed (0), interpolated (1), and forecasted (2) values.

Design Decisions

  • Interpolation vs Forecasting: The package now uses two distinct methods — PCHIP for within-range imputation (where the curve should respect existing data points) and ETS for beyond-range forecasting (where autoregressive dynamics drive the projection). This separation reflects the fundamentally different statistical requirements of each task.

  • Graceful Degradation: The forecast package is placed in Suggests rather than Imports. When unavailable, the system falls back to Holt’s linear trend extrapolation with manually estimated smoothing parameters (α=0.3, β=0.1).


localintel 0.1.0

Initial Release

New Features

Documentation

  • Complete package documentation with roxygen2
  • README with installation and quick start guide
  • Example workflow script in inst/examples/