TSGFssa {greenbrown}R Documentation

Temporal smoothing and gap filling using singular spectrum analysis

Description

This function fills gaps and smoothes a time series by using 1-dimensional singular spectrum analysis.

Usage

TSGFssa(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?

...

further arguments (currently not used)

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]

See Also

TsPP

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 <- TSGFssa(gaps)
#plot(gaps)
#lines(tsgf, col="red")

## compare original data with gap-filled data
#plot(ndvi[is.na(gaps)], window(tsgf[is.na(gaps)], end=c(2008, 11)), 
#	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]