coef-BinSeg-method: Obtain segment data for a particular number of changepoints.

Description Usage Arguments Value Details See Also

Description

This function allows to obtain segment start, end, and parameter estimation (mean, etc. depending on the selected distribution) for the selected number of segments. Can compute segment data for several models at the same time. Note that the models_summary produced by rcpp_binseg is used here in order to comopute several models without doing the changepoint analysis again.

Usage

1
2
## S4 method for signature 'BinSeg'
coef(object, segments = seq_len(nrow(object@models_summary)))

Arguments

object

A valid BinSeg object

segments

The number of segments to use. Must be a numeric value. If you provide only one segment, it must be accompanied by L (eg. 1L). Otherwise, if you want information about several models (ie. several number of changepoints / segments), provide a vector.

Value

A data.table with the following fixed columns: #'

segments

This identifies a specific model by the number of segments. For the model with five segments, each of the five rows will have a value of 5 in this column.

start

The starting index of a segment relative to the input data vector number of data points. It is unique for a partiuclar model (i.e. no two segments can start on the same index

end

The ending index of a segment

Additionally, columns for each estimated parameter are added. However, this depends on the selected distribution. For example, if the distribution is meanvar_norm, then two columns will be added, one for segment mean and another one for segment variance.

Details

Depending on wheter you want information about a single model or several models, you can provide different values to the segments parameter:

Atomic value:

This means that only the model with the specified number of segments will be computed. Therefore, all the values in the segments column will be the same.

Numeric vector:

In this case, several models will be computed at the same time. The indicated models will be differentiated by their segments value.

See Also

rcpp_binseg for the function that creates the models_summary matrix used in this function.


diego-urgell/BinSeg documentation built on Dec. 19, 2021, 11:11 p.m.