This function is generic (see Methods); method functions can be written to handle specific classes of data. Classes which already have methods for this function include:
pcosts, ptable.
best.level(x, type="wp", J=NULL, costs=attr(x, "pcosts"), ...)
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).
Wickerhauser, M. V. (1994). Adapted Wavelet Analysis -- from theory to software.
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)