pcosts
,
cp.table,
wp.table,
cp.table.list and
wp.table.list
best.level(x, type="wp", J=NULL, costs=attr(x, "pcosts"), ...)
pcosts
cp.table,
wp.table,
cp.table.list or
wp.table.list
"wp"
"cp"
"wp.list"
"cp.list"
indicating whether to
perform wavelet packet analysis or cosine packet analysis.
This argument will be ignored
when
x is an object of
pcosts or
cp.table,
wp.table,
cp.table.list or
wp.table.list
x is an object of
ptable or
pcosts. Levels beyond
J will be ignored in the best level
selection process.
x is an object of one of the classes
cp.table,
wp.table,
cp.table.list or
wp.table.list only.
The best level will be selected based on the costs vector.
wp.table or
cp.table when
x is a numeric
vector. See
wp.table, cp.table for details.
x is an object of
pcosts, a character vector of
crystal.names
is returned; otherwise, an object of class
wpt or
cpt, inheriting from
class
wp or
cp. It also inherits from class
crystal.vector or
crystal.list
, depending on the way the basis is stored.
If
x is a numeric vector or univariate time series, then
best.level will
first compute a wavelet packet or cosine packet table (according to
type="wp"
or
"cp) and then select the best level from the table.
The outcome of
best.basis is the orthogonal basis, which minimizes the sum
of the costs over all possible orthogonal basis choices up to level
J.
See the chapter "Wavelet Packet Analysis" of the
S+WAVELETS User's Manual
for details. The algorithm can also be found in pp.717 of
Coifman and Wickerhauser (1992) and Chapter 8 of Wickerhauser (1994).
Coifman, R. and Wickerhauser, M. V. (1992). Entropy-Based Algorithms for Best Basis Selection. IEEE Transactions on Information Theory, 38 (2): 713-718.
Wickerhauser, M. V. (1994). Adapted Wavelet Analysis from Theory to Software. A. K. Peters Ltd, Wellesley, MA.
yy <- make.signal("linchirp", 512) # a linear chirp
yw <- wp.table(yy, wavelet="s8", n.levels=3)
bl <- best.level(yw) # select the best level
eda.plot(bl)
yc <- cp.table(yy, taper="trig", n.levels=3)
bc <- best.level(yc)
eda.plot(bc)