https://github.com/hadley/l1tf
L1 trend filtering
https://github.com/hadley/l1tf
Last synced: 9 months ago
JSON representation
L1 trend filtering
- Host: GitHub
- URL: https://github.com/hadley/l1tf
- Owner: hadley
- License: other
- Created: 2014-11-12T19:11:59.000Z (about 11 years ago)
- Default Branch: main
- Last Pushed: 2024-04-02T13:35:58.000Z (almost 2 years ago)
- Last Synced: 2025-04-14T04:16:52.230Z (9 months ago)
- Language: C
- Size: 175 KB
- Stars: 31
- Watchers: 4
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: COPYING
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# l1tf: l1 trend filtering
[](https://github.com/hadley/l1tf/actions/workflows/R-CMD-check.yaml)
This is an R package wrapper around the C solver for the [l1 trend filtering algorithm](https://web.stanford.edu/~boyd/l1_tf/) written by Kwangmoo Koh, Seung-Jean Kim and Stephen Boyd.
## Installation
You can install the development version of l1tf from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("hadley/l1tf")
```
## Examples
```{r}
library(l1tf)
plot(sp500$log, type='l', col='blue')
lines(l1tf(sp500$log, lambda = 50), col = "red", type='l')
lines(l1tf(sp500$log, prop = 0.01), col = "green3", type='l')
```