Learn R Programming

ctsfeatures (version 1.2.2)

marginal_probabilities: Computes the marginal probabilities of a categorical time series

Description

marginal_probabilities returns a vector with the marginal probabilities of a categorical time series

Usage

marginal_probabilities(series)

Value

A vector with the marginal probabilities.

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.

Author

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

Details

Given a CTS of length \(T\) with range \(\mathcal{V}=\{1, 2, \ldots, r\}\), \(\overline{X}_t=\{\overline{X}_1,\ldots, \overline{X}_T\}\), the function computes the vector \(\widehat{\boldsymbol p} =(\widehat{p}_1, \ldots, \widehat{p}_r)\), with \(\widehat{p}_i=\frac{N_i}{T}\), where \(N_i\) is the number of elements equal to \(i\) in the realization \(\overline{X}_t\).

References

weiss2008measuringctsfeatures

Examples

Run this code
sequence_1 <- GeneticSequences[which(GeneticSequences$Series==1),]
vector_mp <- marginal_probabilities(series = sequence_1) # Computing the vector of
# marginal probabilities for the first series in dataset GeneticSequences

Run the code above in your browser using DataLab