| Ditrack | R Documentation |
Find peaks and flats that appear in the spacing as the size of the low-pass filter or interval changes. Support methods for the class include printing and plotting the significant features.
Ditrack(x, smooth=c('lp', 'diw'), opt=Diopt())
## S3 method for class 'Ditrack'
print(x, ...)
## S3 method for class 'Ditrack'
summary(object, ...)
## S3 method for class 'Ditrack'
plot(x, feature=c('peaks', 'flats'), opt=Diopt(), ...)
x |
for |
object |
an object of class |
smooth |
which filtering to apply to the data, "lp" to look for features in the low-pass spacing or "diw" in the interval spacing |
opt |
local version of options passed to |
feature |
which feature(s) to plot, may include both |
... |
extra arguments, ignored for all methods |
The mode tree and SiZer visualization tools track a feature's position and
some metric as the bandwidth of a kernel density estimate changes. They
help find the best bandwidth for the trade-off between feature detectability
and smoothing. The Ditrack class does the same for the spacing
analysis. It varies the size of the low-pass filter kernel or interval
spacing and tracks the position and probability of peaks and flats per the
tests in the Dimodal analysis.
The Ditrack function varies the window size and gathers the
peak and flat results into matrices.
The tracker will overwrite the options "analysis" and either
"lp.window" or "diw.window" from Diopt. These should not
appear in the "lp.param" or "diw.param" overrides, which have
precedence. It steps these sizes from 0.01 to the option
"track.maxwindow".
plot.Ditrack graphs one or both features, with the window size on the
vertical axis and the position along the horizontal. Peaks and minima are
drawn as symbols, with dots for the maxima and dashes for the minima. The
dots are filled in if any test passes its acceptance level. Flats are drawn
with a line spanning the feature. Both are color-coded according to the
overall probability, the best of all tests that were run. The coloring is
fixed and does not use the "palette" option. There will always be a
minimum between two peaks. Extrema at the edges of the data are not drawn.
print.Ditrack gives a table with the number of significant features
at the 0.01 and 0.05 level plus the number of features significant according
to the current acceptance levels, as the window size changes.
The summary method prints the ranges of window sizes for peaks and flats that give features that pass the acceptance levels of any test that has been run.
The tracker returns a list assigned to class "Ditrack" with elements
peaks |
a subset of the |
flats |
a subset of the |
nx |
the length of the data |
smooth |
the argument of the same name |
The peaks and flats matrices will have one row per feature,
be it a minimum or maximum from Dipeak or a flat. There may be
many rows with the same winpct, or none for a given value.
Dimodal,
Dipeak,
Diflat
## Not run because of the run time.
trk <- Ditrack(quakes[,3], 'lp')
## Two plots side by side.
dev.new(width=8,height=4) ; plot(trk)
trk
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.