Reconstruct the data given the SSA decomposition and the desired grouping of the elementary components.
1 2  ## S3 method for class 'ssa'
reconstruct(x, groups, ..., drop.attributes = FALSE, cache = TRUE)

x 
SSA object 
groups 
list of numeric vectors, indices of elementary components used for reconstruction, the entries of the list can be named, see 'Value' for more information 
... 
further arguments passed to routines (e.g. to

drop.attributes 
logical, if 'TRUE' then the attributes of the input objects are not copied to the reconstructed ones. 
cache 
logical, if 'TRUE' then intermediate results will be cached in the SSA object. 
List of reconstructed objects. Elements of the list have the same
names as elements of groups
. If the group is unnamed, then
corresponding component will obtain name â€˜Fnâ€™, where â€˜nâ€™ is its index
in groups
list.
By default (argument drop.attributes
) the routine tries to
preserve all the attributes of the input object. This way, for
example, the reconstruction result of 'ts' object is the 'ts' object
with the same time scale.
Rssa
for an overview of the package, as well as,
ssainput
,
ssa
,
plot.reconstruction
,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27  # Decompose 'co2' series with default parameters
s < ssa(co2)
# Reconstruct the series, grouping elementary series.
r < reconstruct(s, groups = list(Trend = c(1, 4), Season1 = c(2,3), Season2 = c(5, 6)))
plot(r)
# 'groups' argument might contain duplicate entries as well
r < reconstruct(s, groups = list(1, 1:4, 1:6))
plot(r)
# Real example: Mars photo
data(Mars)
# Decompose only Mars image (without backgroud)
s < ssa(Mars, mask = Mars != 0, wmask = circle(50), kind = "2dssa")
# Reconstruct and plot trend
plot(reconstruct(s, 1), fill.uncovered = "original")
# Reconstruct and plot texture pattern
plot(reconstruct(s, groups = list(c(13, 14, 17, 18))))
# Decompose 'EuStockMarkets' series with default parameters
s < ssa(EuStockMarkets, kind = "mssa")
r < reconstruct(s, groups = list(Trend = 1:2))
# Plot original series, trend and residuals superimposed
plot(r, plot.method = "xyplot", superpose = TRUE,
auto.key = list(columns = 3),
col = c("blue", "green", "red", "violet"),
lty = c(rep(1, 4), rep(2, 4), rep(3, 4)))

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.