Skip to content

Major Feature Expansion: Multi-Method Indexing, Diagnostics, and Visualization Tools#1

Merged
vivekag7 merged 28 commits intomasterfrom
develop
Jul 30, 2025
Merged

Major Feature Expansion: Multi-Method Indexing, Diagnostics, and Visualization Tools#1
vivekag7 merged 28 commits intomasterfrom
develop

Conversation

@vivekag7
Copy link
Owner

This pull request merges significant improvements from the develop branch into master, introducing expanded index methodologies, diagnostic tooling, plotting utilities, and robustness enhancements across the REPS package.


Enhancements and New Features

Expanded Method Support in calculate_price_index()

  • Added support for three new index methodologies:
    • Repricing method
    • Time Dummy index
    • Rolling Time Dummy index
  • These methods are now fully integrated and accessible via the main calculate_price_index() interface.
  • Users can now compare multiple index types side-by-side by passing them in a single call:
    calculate_price_index(..., method = c("fisher", "laspeyres", "repricing"))

Multi-Method Compatibility

  • calculate_price_index() returns a named list when multiple methods are supplied.
  • Enables efficient benchmarking and comparison of index performance across methodologies.

Plotting Utilities

  • Added plot_price_index() for quick visualization of index results:
    • Supports both single-method and multi-method outputs.
    • Includes clear labels, distinct lines, and year-wise period demarcation.

Regression Diagnostics

  • Introduced calculate_regression_diagnostics() to evaluate model assumptions over time:

    • Includes adjusted R², Shapiro-Wilk normality test, Durbin-Watson (autocorrelation), and Breusch-Pagan (heteroscedasticity).
    • Automatically fits a log-linear model per period and summarizes diagnostics in a tidy tibble.
  • New plot_regression_diagnostics() function visualizes these diagnostics across time:

    • Outputs a 3×2 grid with intuitive threshold indicators.
    • Helps users assess model robustness and assumptions in longitudinal index models.

Bug Fixes and Compatibility Improvements

Input Validation Enhancements

  • Improved validate_input() with better messages and checks:
    • Warns for non-numeric values and missing required columns.
    • Accepts both "202101" and "2020Q1" period formats.

Methodology Guardrails

  • Prevents incompatible configurations:
    • For example, disallows resting_points = TRUE when using multiple methods simultaneously.
    • Errors are now informative and guide correct usage.

Removed assertthat Dependency

  • All internal assertions now use base R for improved portability and minimal dependencies.

Documentation and Testing

  • Vignette updates:

    • Added detailed examples for new methods and diagnostics usage.
    • vignette("calculate_regression_diagnostics") demonstrates model quality analysis workflow.
  • Function manuals updated to include:

    • Examples of multi-method calls.
    • Sample plots for both index and diagnostics visualizations.
  • Test coverage expanded to ensure robustness across new functionalities.


This update significantly expands the capabilities of the REPS package while improving usability and diagnostics. It lays the groundwork for even more advanced analytics while maintaining backward compatibility and user clarity.

@vivekag7 vivekag7 merged commit 8a936fd into master Jul 30, 2025
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