Learn R Programming

srlTS

Overview

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.

Installation

You can install the development version of srlTS like so:

# install.packages("remotes")
remotes::install_github("PetersonR/srlTS")

Or, install from CRAN with:

install.packages("srlTS")

Example

This is a basic example.

library(srlTS)

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

fit
#>  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:

Copy Link

Version

Install

install.packages('srlTS')

Monthly Downloads

9

Version

0.1.1

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Ryan Andrew Peterson

Last Published

December 14th, 2023

Functions in srlTS (0.1.1)

predict.srlTS

Predict function for srlTS object
AICc

internal AICc function for lasso models
uihc_ed_arrivals

Hourly arrivals into the University of Iowa Hospital Emergency Department
srlTS

Perform time series ranked sparsity methods