Package: jumps 2.0.0

jumps: Hodrick-Prescott Filter and Spline Smoothing with Jumps

A set of functions to compute the Hodrick-Prescott (HP) filter and spline smoothing with automatically selected jumps. The original HP filter and spline smoothing extract a smooth signal, and our version allows for a small number of automatically identified jumps. Smoothing splines with discontinuities are obtained either by time warping, or by the dynamic-programming algorithm of Storath and Weinmann (2024) <doi:10.1080/10618600.2023.2262000>. See Maranzano and Pelagatti (2025) <doi:10.1016/j.econmod.2025.107132> for details on the HP filter with jumps.

Authors:Matteo Pelagatti [aut, cre, cph], Paolo Maranzano [aut, cph]

jumps_2.0.0.tar.gz
jumps_2.0.0.zip(r-4.7-x86_64)jumps_2.0.0.zip(r-4.7-arm64)jumps_2.0.0.zip(r-4.6-x86_64)jumps_2.0.0.zip(r-4.6-arm64)jumps_2.0.0.zip(r-4.5-x86_64)
jumps_2.0.0.tgz(r-4.6-x86_64)jumps_2.0.0.tgz(r-4.6-arm64)jumps_2.0.0.tgz(r-4.5-x86_64)jumps_2.0.0.tgz(r-4.5-arm64)
jumps_2.0.0.tar.gz(r-4.7-arm64)jumps_2.0.0.tar.gz(r-4.7-x86_64)jumps_2.0.0.tar.gz(r-4.6-arm64)jumps_2.0.0.tar.gz(r-4.6-x86_64)
jumps_2.0.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
jumps/json (API)

# Install 'jumps' in R:
install.packages('jumps', repos = c('https://matteopelagatti.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/matteopelagatti/jumps/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • demand_temp - Electricity demand and temperature: the analysis sample
  • employed_IT - Employed people in Italy by age class
  • load_temp - Hourly electricity load of Northern Italy and temperature of Milan

On CRAN:

Conda:

cpp

5.56 score 2 stars 3 scripts 263 downloads 26 exports 3 dependencies

Last updated from:196a32dda9. Checks:8 ERROR, 7 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64ERROR159
linux-devel-x86_64OK145
source / vignettesOK247
linux-release-arm64ERROR166
linux-release-x86_64OK169
macos-release-arm64ERROR182
macos-release-x86_64ERROR451
macos-oldrel-arm64ERROR184
macos-oldrel-x86_64ERROR381
windows-devel-arm64ERROR374
windows-devel-x86_64OK203
windows-release-arm64ERROR382
windows-release-x86_64OK165
windows-oldrel-x86_64OK157
wasm-releaseOK138

Exports:auto_hpfjauto_hpfj_fixauto_hpfjxauto_ssj_atwauto_ssj_atw_cvauto_ssj_atw_gcvauto_ssj_cssdauto_ssj_fixauto_ssj_kfsauto_ssj_mledummyseashpfjhpfj_fixhpfjxhpjlltmsepredict_cssd_dpssj_atwssj_breaksssj_cssdssj_cssd_dpssj_fixssj_kfsssj_mletrigseas

Dependencies:nloptrRcppRcppEigen

Introduction to the jumps package
Introduction | Basic usage | Examples | Simulated time series | Nile time series | Employment in Italy | Smoothing splines with jumps | A simulated example | Application: electricity demand and temperature

Last update: 2026-08-21
Started: 2025-10-26

Formulae
Introduction | Basic model for the HP filter with jumps | Scalar Kalman filtering recursions | Modifications when missing observations are present | Diffuse initial conditions | $t=1$ | $t=2$ | $t=3$ | Smoothing | Weights for computing the effective degrees of freedom | Analytical scores | $\lambda$ free | $\lambda$ fixed

Last update: 2025-10-26
Started: 2024-04-22

Readme and manuals

Help Manual

Help pageTopics
Automatic selection of the optimal HP filter with jumpsauto_hpfj
Automatic selection of the optimal HP filter with jumps and fixed smoothing constantauto_hpfj_fix
Automatic selection of the optimal HP filter with jumps and regressorsauto_hpfjx
Automatic selection of the optimal smoothing spline with jumps using the alternating time-warping algorithmauto_ssj_atw
Smoothing splines with jumps by alternating time warping, with the smoothing constant chosen by cross-validationauto_ssj_atw_cv
Smoothing splines with jumps by alternating time warping, with the smoothing constant chosen by generalized cross-validationauto_ssj_atw_gcv
Automatic CSSD with K-fold cross-validation of the parametersauto_ssj_cssd
Automatic selection of the optimal smoothing spline with jumps and fixed smoothing parameterauto_ssj_fix
Automatic selection of the optimal time-warping smoothing spline with jumps using the Kalman filter and smootherauto_ssj_kfs
Automatic selection of the optimal time-warping smoothing spline with jumps using maximum-likelihood estimationauto_ssj_mle
BIC method for the class hpjBIC.hpj
Electricity demand and temperature: the analysis sampledemand_temp
Seasonal dummy variablesdummyseas
Employed people in Italy by age classemployed_IT
HP filter with automatic jump detectionhpfj
HP filter with automatic jump detection and fixed smoothing constanthpfj_fix
HP filter with jumps and regressors (still experimental)hpfjx
Hodrick-Prescott filter with jumpshpj
Kalman filtering and smoothing for local linear trend plus noisellt
Hourly electricity load of Northern Italy and temperature of Milanload_temp
logLik method for the class hpjlogLik.hpj
Mean squared errormse
nobs method for the class hpjnobs.hpj
Plot method for the class hpjplot.hpj
Plot method for the class ssjplot.ssj
Predict from a fitted CSSD at new locationspredict_cssd_dp
Predict from a smoothing spline with jumpspredict.ssj
Print method for the class hpjprint.hpj
Print method for the class ssjprint.ssj
Smoothing splines with automatic jump detection using the alternating time-warping algorithmssj_atw
Discontinuities declared by a smoothing spline with jumpsssj_breaks
Total-variation denoising for irregularly sampled signalsssj_cssd
Cubic smoothing spline with discontinuities (CSSD)ssj_cssd_dp
Smoothing splines with automatic jump detection and fixed smoothing parameterssj_fix
Smoothing splines with automatic jump detection via time warping and Kalman filter-smoother estimationssj_kfs
Smoothing splines with automatic jump detection via time warping and maximum-likelihood estimation of the smoothing parameterssj_mle
Trigonometric seasonal variablestrigseas