smooth_wSG: Weighted Savitzky-Golay

Description Usage Arguments Value References Examples

View source: R/smooth_wSG.R

Description

Weighted Savitzky-Golay

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
smooth_wSG(
  y,
  w,
  nptperyear,
  ylu,
  wFUN = wTSM,
  iters = 2,
  frame = floor(nptperyear/7) * 2 + 1,
  d = 2,
  ...
)

Arguments

y

Numeric vector, vegetation index time-series

w

(optional) Numeric vector, weights of y. If not specified, weights of all NA values will be wmin, the others will be 1.0.

nptperyear

Integer, number of images per year.

ylu

(optional) [low, high] value of time-series y (curve fitting values are constrained in the range of ylu.

wFUN

weights updating function, can be one of 'wTSM', 'wChen' and 'wBisquare'.

iters

How many times curve fitting is implemented.

frame

Savitzky-Golay windows size

d

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

...

Additional parameters are passed to wFUN.

Value

References

  1. Chen, J., J\"onsson, P., Tamura, M., Gu, Z., Matsushita, B., Eklundh, L., 2004. A simple method for reconstructing a high-quality NDVI time-series data set based on the Savitzky-Golay filter. Remote Sens. Environ. 91, 332-344. https://doi.org/10.1016/j.rse.2004.03.014.

  2. https://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_filter

Examples

1
2
3
4
5
6
7
library(phenofit)
data("MOD13A1")
dt <- tidy_MOD13.gee(MOD13A1$dt)
d <- dt[site == "AT-Neu", ]

l <- check_input(d$t, d$y, d$w, nptperyear=23)
r_wSG <- smooth_wSG(l$y, l$w, l$ylu, nptperyear = 23, iters = 2)

phenofit documentation built on April 2, 2020, 5:07 p.m.