Codecov test
coverage R-CMD-check CRAN


The Sparsity-Ranked Lasso (SRL) for Time Series implemented in srlTS efficiently fits long, high-frequency time series with complex seasonality, even with a high-dimensional exogenous feature set.

Originally described in Peterson and Cavanaugh (2022) in the context of variable selection with interactions and/or polynomials, ranked sparsity is a philosophy of variable selection in the presence of prior informational asymmetry.

In time series data with complex seasonality or exogenous features; see Peterson and Cavanaugh (2023+), which also describes this package in greater detail. The basic premise is to utilize the sparsity-ranked lasso to be less skeptical of more recent lags, and suspected seasonal relationships.


You can install the development version of srlTS like so:

# install.packages("remotes")

Or, install from CRAN with:



This is a basic example.


y <- cumsum(rnorm(100))
fit <- srlTS(y, gamma = c(0, .5))

#>  PF_gamma best_AICc best_BIC
#>       0.0  209.9610 216.3429
#>       0.5  208.1509 214.5327
#> Test-set prediction accuracy
#>         rmse       rsq      mae
#> AIC 1.518106 0.9478941 1.286608
#> BIC 1.518106 0.9478941 1.286608

Learn more

To learn more and to see this methodology in action, see:

Try the srlTS package in your browser

Any scripts or data that you put into this service are public.

srlTS documentation built on May 29, 2024, 10:57 a.m.