Compute 2D Wavelet Packet Costs

DESCRIPTION:
Computes 2D wavelet packet costs.

USAGE:
wp.costs.2d(x, cost.fun="entropy", wavelet="s8", n.levels=4,
            boundary="periodic", precondition=F, dual=F,
            analysis.filter=NULL, synthesis.filter=NULL,
            scale=NULL, thresh=NULL, p=2, prob=.5)

REQUIRED ARGUMENTS:
x:
a matrix or an image.

OPTIONAL ARGUMENTS:
cost.fun:
character string indicating which cost functional to use: "entropy", "threshold", "risk", "sure", and "lp" are available. See below for details.
wavelet:
a character string or a character vector of length two, which gives the name(s) of the wavelet(s). See wavelet.packet for a list of all available wavelet names. If the length of wavelet is one, the same wavelet is used for both rows and columns. For user-provided filter, input the values the filter argument (see below).
n.levels:
a non-negative integer specifying number of multi-resolution levels. if n.levels is bigger than ml, where ml is the maximum possible level, computed from the max.level function, then n.levels is set to ml and a warning message is given.
boundary:
a character string or a character vector of length two giving the name of the boundary rule. If the length of boundary is one, the same boundary rule is used for both row and column. All the boundary rules listed for dwt are available except for "infinite" and "polynomial". See dwt for the definitions of these rules.
precondition:
logical vector of length one or two: for boundary="interval" only. See dwt for details.
dual:
logical vector of length one or two indicating if dual filter is used for analysis instead of synthesis.
scale:
scaling factor for computing the costs. The default depends on cost.fun. See below for details.
thresh:
a non-negative number, needed when cost.fun is "threshold" or "sure". See below for details.
p:
a number in the interval (0,2] giving the degree of the lpnorm when cost.fun is "lp". See below for details.
prob:
a number in (0,1), needed when cost.fun is "threshold". See below for details.

VALUE:
a 2-D packet cost object with class pcosts.2d. A packet cost object can be used with the best.basis function to select optimal wavelet packet transforms for images.

DETAILS:
See the printed help file for the definitions of the cost functionals listed below.

Available cost functionals:


SEE ALSO:
max.level , pcosts , pcosts.2d.object , wavelet.options , wpt.2d .

EXAMPLES:
phone <- phone-mean(phone)
wcost <- wp.costs.2d(phone, wavelet="s8", n.levels=3)
bb2 <- best.basis(wcost, data=phone)
bb2
plot(bb2)