l1tf | R Documentation |
L1 trend filteirng
l1tf(x, lambda, prop = 0.1, debug = FALSE)
x |
Numeric vector of inputs. Must be equally spaced in time. |
lambda |
A number that controls the balance between accuracy and simplicity. Small values favour accuracy; large values favour simplicity. |
prop |
A number between 0 and 1. Specify lambda as a proportion of the maximum lambda for the input dataset. |
debug |
If |
x <- runif(1000)
plot(x)
lines(l1tf(x), col = "red")
lines(l1tf(x, prop = 0.01), col = "blue")
# SP500 example from paper
plot(sp500$date, log(sp500$raw), type="l", col="grey50", ylab="log-price")
lines(sp500$date, l1tf(log(sp500$raw), lambda=100), col="blue")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.