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 Ditrack
print(x, ...)
# S3 method for Ditrack
summary(object, ...)
# S3 method for Ditrack
plot(x, feature=c('peaks', 'flats'), opt=Diopt(), ...)The tracker returns a list assigned to class "Ditrack" with elements
peaksa subset of the "Dipeak" result with columns
"pos", "ismax", "ppeak", and "naccept", plus an additional
column "winpct" giving the filter size as an integer percentage,
keeping only rows with valid peaks
flatsa subset of the "Diflat" result taking columns
"stID", "endID", "pflat", and "naccept", plus an
additional column "winpct" giving the filter size
nxthe length of the data x argument
smooththe 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.
for Ditrack, the data to study; for the class methods,
the value returned from Ditrack
an object of class "Ditrack"
which filtering to apply to the data, "lp" to look for features in the low-pass spacing or "diw" in the interval spacing
local version of options passed to Dimodal analysis
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.
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
Run the code above in your browser using DataLab