Common functions to handle "Didata" class results, which store all
data used in the modality analysis.
# S3 method for Didata
print(x, ...)
# S3 method for Didata
summary(object, ...)The basic data stored in the matrix contains the rows
xthe original data
xsortsorted data
xmidthe mid-distribution from midquantile
Dithe spacing; index 1 is NA
This is enough to run the changepoint analysis.
If low-pass spacing is required, Dimodal adds the row
lpspacing after low-pass filtering
where the leading and trailing columns are set to NA when part of the filter falls outside the data.
If interval spacing is needed, the matrix also contains rows
Diwthe interval spacing
signedthe signed difference of the interval spacing, with values -1, 0, +1 $
where the leading columns up to the width of the interval are set NA. The signed difference has an additional NA.
Several bits of metadata are stored as attributes with the matrix, in addition to any generated by R. The basic analysis provides
data.namethe source of the data in the call to Dimodal
Low-pass filtering adds
lp.kernelthe name of the filter
lp.windowthe window or size of the filter, as provided
by Diopt, which is normally a fraction of the data size but
may also be in data points
wlpthe actual window width in data points
lp.stIDthe first column in the matrix with valid low-pass values
lp.endIDthe last column (inclusive) that is valid
Interval spacing adds
diw.windowthe interval size, as provided by Diopt,
which is normally a fraction of the data size but may also be in data
points
wdiwthe interval in data points
diw.stIDthe first column in the matrix with valid interval spacing; the last valid column is the end of the matrix
Note that the signed row starts one column after the interval spacing,
at diw.stID + 1, and runs to the end of the matrix.
The methods return the object, invisibly.
an object of class "Didata"
an object of class "Didata"
extra arguments, ignored for all methods
Didata is a matrix that contains all data used in the modality analysis,
with contents that depends on which analyses are run. The matrix has one
column for each raw data point. Dimodal creates the Didata object
internally; there is no public function to generate it. Row "xmid"
is the interpolated raw value for each index, as calculated by
midquantile(data["xsort",], type=#), where the algorithm type is
provided by the option "data.midq". Row "signed" added by
the interval spacing analysis is its signed difference, where differences
within an order of magnitude of .Machine.double.eps are treated as
ties to avoid numerical precision errors.
The print method shows the source of the data and any filters applied to
the spacing. It then prints a table with the valid columns, range of
values, and standard deviation of the original data and spacing. If
low-pass and interval spacing were needed by Dimodal, then information
about them is added to the table. The method uses option "digits" to
control the number of significant digits for raw values. If it is set to
zero then the standard options()$digits is used.
The summary method prints just the setup information.
Dimodal,
Diopt,
midquantile
## We override the analysis option to avoid changepoints,
## which may not be available.
m <- Dimodal(faithful$eruptions, Diopt.local(analysis=c('diw','lp'), diw.window=16))
m$data
Run the code above in your browser using DataLab