Learn Python and AI for free! One week only. No credit card needed.
Ends in:
Perform iterative gapfilling of the series.
# S3 method for 1d.ssa
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)
# S3 method for cssa
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)
# S3 method for toeplitz.ssa
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)
# S3 method for nd.ssa
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)
Shaped SSA object holding the decomposition
list, the grouping of eigentriples to be used in the forecast
initial values for missed entries, recycled if necessary; if missed, then average of the series will be used
tolerance for reconstruction iterations
upper bound for the number of iterations
distance function used for covergence criterion
series used as a 'seed' for gapfilling: original or
reconstructed according to the value of groups
argument
additional arguments passed to reconstruct
routines
logical, indicates whether the convergence process should be traced
logical, if 'TRUE' then the result is coerced to series itself, when possible (length of 'groups' is one)
logical, if 'TRUE' then the attributes of the input series are not copied to the reconstructed ones.
logical, if 'TRUE' then intermediate results will be cached in the SSA object.
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'.
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).
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.
Rssa
for an overview of the package, as well as,
gapfill
,
clplot
,
summarize.gaps
,
# NOT RUN {
# 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