wavCWTTree {wmtsa} | R Documentation |
This function first finds the extrema locations (in time and in scale) of the continuous wavelet transform input. The set of extrema are then subdivided into sets of branches, where each branch represents a collection of extrema that correspond to the same ridge in the CWT time-scale plane. A coarse-to-fine scale strategy is used to identify the members of each branch as follows: (i) a single extremum at the coarsest scale is selected as the start of a given branch, (ii) the closest neighboring extremum in time at the next finest scale is then added to the branch, (iii) step ii is repeated until the smallest scale is reached or an apparent break occurs in the branch across scale, and (iv) steps i-iii are repeated until all extrema have been accounted. A branch is not grown unless the nearest neighbor candidate at the next finest scale is close in time to the last recorded branch member, where "close" is defined as being less than the current scale of the neighbor candidate. This means that the window in time for admissible neighbor extrema candidates (at the next finest scale) shrinks proportionally with scale.
wavCWTTree(x, n.octave.min=1, tolerance=0.0, type="maxima")
x |
an object of class wavCWT (as produced by the wavCWT function). |
n.octave.min |
a pruning factor for excluding non-persistent branches. If a branch of connected extrema does not span this number of octaves, it is excluded from the tree. Default: 1. |
tolerance |
a tolerance vector used to find CWT extrema. This vector must be as long as there are scales in the CWT such that the jth element defines the tolerance to use in finding modulus maxima at the jth scale of the CWT. If not, the last value is replicated appropriately. Default: 0. |
type |
a character string denoting the type of extrema to seek in the CWT plane.
Supported types are "extrema" , "maxima" and "minima" . Default: "maxima" . |
A point in the CWT W(t,j) is defined
as an extremum if |W(t-1,j)| + tol < |W(t,j)| and |W(t+1,j)| + tol < |W(t,j)|
where tol
is a (scale-dependent) tolerance specified by the user.
The search algorithm is also adpated to identify plateaus in the data,
and will select the the middle of the plateau as a maximum location
when encountered. The data |W(t,j)| is first scaled so that its
maximum value is 1.0, so the tolerances should be adjusted accordingly.
Since the CWT coefficients are (in effect) a result band-pass filtering operations,
the large scale coefficients form a smoother curve than do the small
scale coefficients. Thus, the tolerance vector allows the user to specify
scale-dependent tolerances, helping to weed out undesirable local maxima.
It is recommended that the tolerance be set proportional to the scale,
e.g., tolerance=C / sqrt(scale)
where C is a constant
0 < C < 1.
The user is also allowed to control the types of peaks to pursue in
the CWT plane: extrema, maxima, or minima. The algorithm (described above) is
adjusted accordingly.
The output object contains a list of sublists, each sublist corresponds to a single branch in the CWT tree and contains the named vectors:
In addition, the returned object contains the following attributes:
an object of class wavCWTTree
. See DETAILS section for more information.
x[2:5]
. To extract branches which terminate near times 0.47, 0.3, and 1.4, use the syntax
x[time=c(0.47, 0.3, 1.4)]
. To extract all branches which terminate between times 1.2 and 1.5, use the syntax
x[range=c(1.2, 1.5)]
.x
is an output of the wavCWTTree
function):
fit=TRUE
, a subset of branches (limited to four) are fit with
various linear regression models on a log(|WTMM|) versus log(scale) basis. The models are specified by the
optional models
argument. This scheme illustrates the process by which
exponents are estimated using the WTMM branches. For example, to see the regressions over chains 10 through 13,
issue plot(x[10:13], fit=TRUE)
. Default: FALSE
.fit=TRUE
. Default: c("lm", "lmsreg", "ltsreg")
.TRUE
, the branch number is placed at the head of each branch. Default: TRUE
.TRUE
, the locations of the (non-pruned and unbranched) extrema are
marked in the time-scale plane. Default: FALSE
.par
function. Default: "o"
.
J.F. Muzy, E. Bacry, and A. Arneodo., ``The multifractal formalism revisited with wavelets.", International Journal of Bifurcation and Chaos, 4, 245–302 (1994).
## create linchirp series linchirp <- make.signal("linchirp") ## calculate the CWT W <- wavCWT(linchirp) ## form CWT tree W.tree <- wavCWTTree(W) ## print the object print(W.tree) ## summarize the object summary(W.tree) ## plot thea CWT image with a tree overlay ## (R-only) plot(W) if (is.R()) plot(W.tree, extrema=TRUE, add=TRUE) ## plot all CWT tree branches plot(W.tree) ## plot a subset of CWT tree branches plot(W.tree[5:10]) ## plot an illustration of the Holder exponent ## estimation process. select branches between ## times 0.2 and 0.4 (only the first four found ## will be fitted) plot(W.tree[range=c(0.2, 0.4)], fit=TRUE)