Learn R Programming

Rssa (version 0.13-1)

igapfill: Perform SSA gapfilling via iterative reconstruction

Description

Perform iterative gapfilling of the series.

Usage

"igapfill"(x, groups, fill = NULL, tol = 1e-6, maxiter = 0, norm = function(x) sqrt(max(x^2)), base = c("original", "reconstructed"), ..., trace = FALSE, drop = TRUE, drop.attributes = FALSE, cache = TRUE) "igapfill"(x, groups, fill = NULL, tol = 1e-6, maxiter = 0, norm = function(x) sqrt(max(x^2)), base = c("original", "reconstructed"), ..., trace = FALSE, drop = TRUE, drop.attributes = FALSE, cache = TRUE) "igapfill"(x, groups, fill = NULL, tol = 1e-6, maxiter = 0, norm = function(x) sqrt(max(x^2)), base = c("original", "reconstructed"), ..., trace = FALSE, drop = TRUE, drop.attributes = FALSE, cache = TRUE) "igapfill"(x, groups, fill = NULL, tol = 1e-6, maxiter = 0, norm = function(x) sqrt(max(x^2)), base = c("original", "reconstructed"), ..., trace = FALSE, drop = TRUE, drop.attributes = FALSE, cache = TRUE)

Arguments

x
Shaped SSA object holding the decomposition
groups
list, the grouping of eigentriples to be used in the forecast
fill
initial values for missed entries, recycled if necessary; if missed, then average of the series will be used
tol
tolerance for reconstruction iterations
maxiter
upper bound for the number of iterations
norm
distance function used for covergence criterion
base
series used as a 'seed' for gapfilling: original or reconstructed according to the value of groups argument
...
additional arguments passed to reconstruct routines
trace
logical, indicates whether the convergence process should be traced
drop
logical, if 'TRUE' then the result is coerced to series itself, when possible (length of 'groups' is one)
drop.attributes
logical, if 'TRUE' then the attributes of the input series are not copied to the reconstructed ones.
cache
logical, if 'TRUE' then intermediate results will be cached in the SSA object.

Value

List of objects with gaps filled in. Elements of the list have the same names as elements of groups. If group is unnamed, corresponding component gets name `Fn', where `n' is its index in groups list.Or, the forecasted object itself, if length of groups is one and 'drop = TRUE'.

Details

Iterative gapfilling starts from filling missed entries with initial values, then the missed values are imputed from the successive reconstructions. This process continues until convergence up to a stationary point (e.g. filling / reconstruction does not change missed values at all).

References

Kondrashov, D. & Ghil, M. (2006) Spatio-temporal filling of missing points in geophysical data sets. Nonlinear Processes In Geophysics, Vol. 13(2), pp. 151-159.

See Also

Rssa for an overview of the package, as well as, gapfill,

Examples

Run this code
# Produce series with gaps
F <- co2; F[100:200] <- NA
# Perform shaped SSA
s <- ssa(F, L = 72)
# Fill in gaps using the trend and 2 periodicty components
# Due to trend, provide a linear filler to speedup the process
fill <- F; fill[100:200] <- F[99] + (1:101)/101*(F[201] - F[99])
g <- igapfill(s, groups = list(1:6), fill = fill, maxit = 50)
# Compare the result
plot(g)
lines(co2, col = "red")

Run the code above in your browser using DataLab