calculate_features {ctsfeatures}R Documentation

Computes several features associated with a categorical time series

Description

calculate_features computes several features associated with a categorical time series or between a categorical and a real-valued time series

Usage

calculate_features(series, n_series = NULL, lag = 1, type = NULL)

Arguments

series

An object of type tsibble (see R package tsibble), whose column named Value contains the values of the corresponding CTS. This column must be of class factor and its levels must be determined by the range of the CTS.

n_series

A real-valued time series.

lag

The considered lag (default is 1).

type

String indicating the feature one wishes to compute.

Details

Assume we have a CTS of length T with range \mathcal{V}=\{1, 2, \ldots, r\}, \overline{X}_t=\{\overline{X}_1,\ldots, \overline{X}_T\}, with \widehat{p}_i being the natural estimate of the marginal probability of the ith category, and \widehat{p}_{ij}(l) being the natural estimate of the joint probability for categories i and j at lag l, i,j=1, \ldots, r. Assume also that we have a real-valued time series of length T, \overline{Z}_t=\{\overline{Z}_1,\ldots, \overline{Z}_T\}. The function computes the following quantities depending on the argument type:

Value

The corresponding feature.

Author(s)

Ángel López-Oriona, José A. Vilar

References

Weiß CH, Göb R (2008). “Measuring serial dependence in categorical time series.” AStA Advances in Statistical Analysis, 92, 71–89.

Examples

sequence_1 <- GeneticSequences[which(GeneticSequences$Series==1),]
uc <- calculate_features(series = sequence_1, type = 'uncertainty_coefficient' )
# Computing the uncertainty coefficient
# for the first series in dataset GeneticSequences
se <- calculate_features(series = sequence_1, type = 'spectral_envelope' )
# Computing the spectral envelope
# for the first series in dataset GeneticSequences

[Package ctsfeatures version 1.2.2 Index]