Learn R Programming

Dimodal (version 1.0.0)

Didata: Class methods for Didata Objects

Description

Common functions to handle "Didata" class results, which store all data used in the modality analysis.

Usage

# S3 method for Didata
print(x, ...)
# S3 method for Didata
summary(object, ...)

Value

The basic data stored in the matrix contains the rows

x

the original data

xsort

sorted data

xmid

the mid-distribution from midquantile

Di

the spacing; index 1 is NA

This is enough to run the changepoint analysis.

If low-pass spacing is required, Dimodal adds the row

lp

spacing 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

Diw

the interval spacing

signed

the 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.name

the source of the data in the call to Dimodal

Low-pass filtering adds

lp.kernel

the name of the filter

lp.window

the 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

wlp

the actual window width in data points

lp.stID

the first column in the matrix with valid low-pass values

lp.endID

the last column (inclusive) that is valid

Interval spacing adds

diw.window

the interval size, as provided by Diopt, which is normally a fraction of the data size but may also be in data points

wdiw

the interval in data points

diw.stID

the 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.

Arguments

x

an object of class "Didata"

object

an object of class "Didata"

...

extra arguments, ignored for all methods

Details

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.

See Also

Dimodal, Diopt, midquantile

Examples

Run this code
## 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