Description Usage Arguments Value Author(s) See Also Examples
This function can be used for pre-processing of time series before the analyzing phenology or trends. The pre-processing involves the following steps:
Step 1. Filling of permanent gaps. Values that are missing in each year will be filled using the function FillPermanentGaps.
Step 2. Temporal smoothing, gap filling and interpolation. The time series will be smoothed and remaining gaps will be filled. Optionally, time series will be interpolated to daily values.
1 2 3 4 5 6 7 8 | TsPP(Yt, fpg = FillPermanentGaps,
tsgf = TSGFspline,
interpolate = FALSE,
min.gapfrac = 0.2,
lower = TRUE, fillval = NA,
fun = min, backup = NULL,
check.seasonality = 1:3,
...)
|
Yt |
univariate time series of class |
fpg |
Filling of permanent gaps: If NULL, permanent gaps will be not filled, else the function |
tsgf |
Temporal smoothing and gap filling: Function to be used for temporal smoothing, gap filling and interpolation of the time series. If NULL, this step will be not applied. Otherwise a function needs to be specified. Exisiting functions that can be applied are |
interpolate |
Should the smoothed and gap filled time series be interpolated to daily values? |
min.gapfrac |
How often has an observation to be NA to be considered as a permanent gap? (fraction of time series length) Example: If the month January is 5 times NA in a 10 year time series (= 0.5), then the month January is considered as permanent gap if |
lower |
For filling of permanent gaps: fill |
fillval |
For filling of permanent gaps: constant fill values for gaps. If NA the fill value will be estimated from the data using |
fun |
For filling of permanent gaps: function to be used to compute fill values. By default, minimum. |
backup |
Which |
check.seasonality |
Which methods in |
... |
further arguments (currently not used) |
pre-processed time series
Matthias Forkel <matthias.forkel@tu-dresden.de> [aut, cre]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # introduce systematic gaps in winter and random gaps
gaps <- ndvi
gaps[runif(50, 1, length(ndvi))] <- NA
gaps[cycle(ndvi) == 1 | cycle(ndvi) == 2 | cycle(ndvi) == 12] <- NA
plot(gaps)
# perform pre-processing of time series using different methods
pp.lin <- TsPP(gaps, tsgf=TSGFlinear) # linear interpolation + running median
pp.spl <- TsPP(gaps, tsgf=TSGFspline) # smoothing splines
plot(gaps)
cols <- rainbow(5)
lines(pp.lin, col=cols[1])
lines(pp.spl, col=cols[2])
data.df <- ts.union(time(gaps), orig=ndvi, pp.lin, pp.spl)
plot(data.df)
cor(na.omit(data.df[is.na(gaps),]))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.