cpt, cp.molecule, dwt, nd.dwt, rob.dwt, rob.dwt.list, wpt, wp.molecule
.
decompose(x, top=NULL, data=NULL, order.crystal="energy")
cpt, cp.molecule, dwt, nd.dwt, rob.dwt,rob.dwt.list, wpt, wp.molecule.
x used in the decomposition,
in effect only if
x is an object of class
"molecule".
By default, use all the coefficients in
x. See details below.
x is an object of class
"molecule".
See details below.
"dwt" (for the DWT decomposition only),
"energy" (the decomposition components will be
ordered by energy), and
"frequency" (in
depth.first order).
decompose. See
decompose.object for details.
The function
decompose produces a
decomposition which is a sum of components where each k-th component
represents the contribution of the k-th crystal (when
x
is of class
cpt) or the atom
associated with the k-th largest coefficient (when
x
is of class
cp.molecule
or
wp.molecule
to the signal.
When
x is of class
"cpt" or
"wpt", all atoms with non-zero coefficients
are included in the decomposition, the sum of the components yields the original
series.
When
x is of class
"cp.molecule" or
"wp.molecule", if
data is provided,
the sum of the components yields an approximation of
the
data with a (non-trivial) residual term attached at the end of the
outcome matrix. The bigger the
top, the closer the approximation to the
original signal; if
data is missing, the sum of the components only yields
an approximation to the original signal.
xx <- make.signal("ramp", 1024)
par(mfrow=c(2,2))
plot(xx, type="l", xlab="")
xx.dwt <- dwt(xx, wavelet="s8", n.levels=4)
plot(xx.dwt)
xx.dec <- decompose(xx.dwt)
plot(xx.dec)
xx.top <- top.atoms(xx.dwt, n.atoms=10)
xx.dec1 <- decompose(xx.top, data=xx) # decompose signal on the top 10 atoms
plot(xx.dec1)