Learn R Programming

wmtsa (version 1.1-1)

wavBestBasis: DWPT Best basis selection

Description

The discrete wavelet packet transform (DWPT) contains a multitude of disjoint dyadic decompositions representing an ensemble of different bases. Best basis selection is an attempt to isloate one such basis in an optimal way.

Usage

wavBestBasis(costs)

Arguments

costs
a numeric vector containing the costs for each crystal in a DWPT in ${\cal{C}}(W_{0,0}), {\cal{C}}(W_{1,0}), {\cal{C}}(W_{1,1}), {\cal{C}}(W_{2,0}), \ldots, {\cal{C}}(W_{J,2^J-1})$ order where ${\cal{C}}(\cdot)$ is the additive cost functional and $W_{j,n

concept

transforms, waveletbest basis

References

Ronald R. Coifman and Mladen Victor Wickerhauser, ``Entropy-Based Algorithms for Best Basis Selection", IEEE Transactions on Information Theory, 38(2), pp. 713--718, 1992.

D. B. Percival and A. T. Walden, Wavelet Methods for Time Series Analysis, Cambridge University Press, 2000.

See Also

wavDWPT.

Examples

Run this code
## calculate the DWPT of the difference of the 
## atomic clock series 
W <- wavDWPT(diff(atomclock), n.level=6)

## define an entropy cost functional 
"entropy" <- function(x){
    iz <- which(x==0)
    z <- -x^2 * log(x^2)
    if (length(iz))
       z[iz] <- 0
    sum(z)
}

## create the cost vector 
C <- unlist(lapply(W$data, entropy))

## calculate the bets basis 
z <- wavBestBasis(C)

## print the crystals of the best basis 
paste("W(", z$level, ",", z$osc, ")", sep="")

Run the code above in your browser using DataLab