An open API service indexing awesome lists of open source software.

https://github.com/hadley/l1tf

L1 trend filtering
https://github.com/hadley/l1tf

Last synced: 9 months ago
JSON representation

L1 trend filtering

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

[![R-CMD-check](https://github.com/hadley/l1tf/actions/workflows/R-CMD-check.yaml/badge.svg)](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')
```