get_trend: Get quantile trends

Description Usage Arguments Examples

View source: R/get_trend.R

Description

get_trend Returns the quantile trend matrix

Usage

1
get_trend(y, tau, lambda, k)

Arguments

y

observed data, should be equally spaced, may contain NA

tau

quantile levels at which to evaluate trend

lambda

penalty paramter controlling smoothness

k

order of differencing

Examples

1
2
3
4
5
6
7
8
9
n <- 100
x <- seq(1, n, 1)
y <- sin(x*2*pi/n) + rnorm(n, 0, .4)
lambda <- 10
k <- 3
tau <- c(0.05, .2)
trend <- get_trend(y, tau, lambda, k)
plot(y~x, type = "l")
lines(trend[,1]~x, col = "red")

halleybrantley/detrendr documentation built on May 30, 2019, 12:43 p.m.