smooth_wSG {rtrend}R Documentation

Weighted Savitzky-Golay

Description

NA and Inf values in the y has been ignored automatically.

Usage

smooth_wSG(y, halfwin = 1L, d = 1L, w = NULL)

smooth_SG(y, halfwin = 1L, d = 1L)

Arguments

y

colvec

halfwin

halfwin of Savitzky-Golay

d

polynomial of degree. When d = 1, it becomes moving average.

w

colvec of weight

Examples

y <- c(1, 3, 2, 5, 6, 8, 10, 1)
w <- seq_along(y)/length(y)

halfwin = 2
d = 2
s1 <- smooth_wSG(y, halfwin, d, w)
s2 <- smooth_SG(y, halfwin, d)

[Package rtrend version 0.1.5 Index]