-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
70 lines (47 loc) · 2.77 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# fastTS
<!-- badges: start -->
[](https://app.codecov.io/gh/petersonR/fastTS?branch=main)
[](https://github.com/petersonR/fastTS/actions/workflows/R-CMD-check.yaml)
[](https://CRAN.R-project.org/package=fastTS)
<!-- badges: end -->
## Overview
The `fastTS` package efficiently fits long, high-frequency time series with complex seasonality, even with a high-dimensional exogenous feature set. It implements the sparsity-ranked lasso (and similar methods) for time series data.
Originally described in [Peterson and Cavanaugh (2022)](https://doi.org/10.1007/s10182-021-00431-7) 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.
This package implements such methods for fast fitting of time series data with complex seasonality or exogenous features. More information is included in [Peterson and Cavanaugh (2024)](https://doi.org/10.1177/1471082X231225307). The basic premise is to utilize the sparsity-ranked lasso (or similar) to be less skeptical of more recent lags, and suspected seasonal relationships.
Please cite `fastTS` as:
Peterson R. A. & Cavanaugh J. E. (2024). Fast, effective, and coherent time series modelling using the sparsity-ranked lasso. *Statistical Modelling*. doi:10.1177/1471082X231225307
## Installation
You can install the development version of `fastTS` like so:
```{r install, eval = FALSE}
# install.packages("remotes")
remotes::install_github("PetersonR/fastTS")
```
Or, install from CRAN with:
```{r install_cran, eval = FALSE}
install.packages("fastTS")
```
## Example
This is a basic example with the [sunspot monthly series](https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/sunspot.month.html).
```{r example}
library(fastTS)
data("sunspot.month")
fit <- fastTS(sunspot.month)
fit
```
## Learn more
To learn more and to see this methodology in action, see:
- [Simple case studies vignette](https://petersonr.github.io/fastTS/articles/case_studies.html)
- [Modeling hourly ER arrival data with complex seasonality](https://petersonr.github.io/fastTS/articles/hourly_er_visits.html)
- [Did Denver’s 2022 ‘Zero Fare for Cleaner Air’ campaign actually work?](https://data-diction.com/posts/did-denver-zero-fare-policy-work/#modeling)