TSGFstm {greenbrown}R Documentation

Temporal smoothing and gap filling based on a season-trend model

Description

This function fills gaps in a time series by using a season-trend model as in TrendSTM (Verbesselt et al. 2010, 2012).

Usage

TSGFstm(Yt, interpolate = FALSE, ...)

Arguments

Yt

univariate time series of class ts.

interpolate

Should the smoothed and gap filled time series be interpolated to daily values by using na.spline?

...

further arguments to TrendSTM.

Value

The function returns a gap-filled and smoothed version of the time series.

Author(s)

Matthias Forkel <matthias.forkel@geo.tuwien.ac.at> [aut, cre]

References

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.

See Also

TsPP, TrendSTM

Examples

# load a time series of NDVI (normalized difference vegetation index)
data(ndvi)
plot(ndvi)

# 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)))


[Package greenbrown version 2.4.3 Index]