cp.costs.2d(x, cost.fun="threshold", n.levels=NULL, taper="poly2", dct.type=2, boundary="periodic", n.taper=NULL, scale=NULL, thresh=NULL, p=2, prob=.5)
2^(n.levels[1])
and
column length must be divisible by
2^(n.levels[2])
, see below.
Should demean first.
"entropy"
,
"lp"
,
"threshold"
, and
"cpentropy"
.
See details below.
x
is divided into
2^(2*n.levels)
nrow(x)/2^n.levels
by
ncol(x)/2^n.levels
blocks. For
"best.basis"
,
n.levels
gives the blocking factor for the finest level.
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.
2
or
4
indicating, respectively, which of DCT-II or DCT-IV should be used.
See the function
dct
for details.
"boxcar", "poly1", "poly2", "poly3", "poly4", "poly5"
, or
"trig"
.
See the function
cp.table
for details.
"cp.reflect", "periodic"
and
"zero"
.
See the function
cp.table
for details.
2*n.taper
.
By default,
n.taper
is set to
length(x)/2^(n.level+1)
,
which is the maximum possible length at the finest blocking level.
"entropy"
and
"cpentropy"
.
The default is
vecnorm(dct.2d(x))
. See below for details.
(0,2]
giving the degree of the
lp-norm when
cost.fun
is
"lp"
.
See below for details.
cost.fun
is
"threshold"
or
"sure"
.
By default,
thresh
is the
prob
th percentile of the
absolute value of the DCT coefficients.
See below for details.
0
and
1
which is used to
compute the threshold
thresh
for when
cost.fun
is
"threshold"
.
See the
thresh
argument.
pcosts.2d
.
A packet cost object can be used with
the
best.basis
function to select optimal cosine packet
transforms for images.
Available cost functionals:
related to
scale
.
threshold
.
entropy
for cosine packets.
The default optional arguments
n.levels, taper, dct.type, boundary
can be reset using function
wavelet.options
,
see
wavelet.options
for details.
Wickerhauser, M. V. (1994). Adapted Wavelet Analysis from Theory to Software. A. K. Peters Ltd, Wellesley, MA.
phone <- phone-mean(phone) ccost <- cp.costs.2d(phone, taper="poly2", n.levels=3) bb2 <- best.basis.2d(ccost, phone) bb2 plot(bb2)