Description Usage Arguments Value Author(s) References See Also Examples
This function fills gaps in a time series by using a season-trend model as in TrendSTM
(Verbesselt et al. 2010, 2012).
1 2 |
Yt |
univariate time series of class |
interpolate |
Should the smoothed and gap filled time series be interpolated to daily values by using |
... |
further arguments to |
The function returns a gap-filled and smoothed version of the time series.
Matthias Forkel <matthias.forkel@tu-dresden.de> [aut, cre]
Verbesselt, J.; Hyndman, R.; Zeileis, A.; Culvenor, D., Phenological change detection while accounting for abrupt and gradual trends in satellite image time series. Remote Sensing of Environment 2010, 114, 2970-2980.
Verbesselt, J.; Zeileis, A.; Herold, M., Near real-time disturbance detection using satellite image time series. Remote Sensing of Environment 2012, 123, 98-108.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # introduce random gaps
gaps <- ndvi
gaps[runif(100, 1, length(ndvi))] <- NA
plot(gaps)
# do smoothing and gap filling
tsgf <- TSGFstm(gaps)
plot(gaps)
lines(tsgf, col="red")
# compare original data with gap-filled data
plot(ndvi[is.na(gaps)], tsgf[is.na(gaps)], xlab="original", ylab="gap filled")
abline(0,1)
r <- cor(ndvi[is.na(gaps)], tsgf[is.na(gaps)])
legend("topleft", paste("Cor =", round(r, 3)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.