marginal_probabilities function

Computes the marginal probabilities of a categorical time series

Computes the marginal probabilities of a categorical time series

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

marginal_probabilities(series)

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.

Returns

A vector with the marginal probabilities.

Details

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

Examples

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

References

Rdpack::insert_ref(key="weiss2008measuring",package="ctsfeatures")

Author(s)

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

  • Maintainer: Angel Lopez-Oriona
  • License: GPL-2
  • Last published: 2024-01-29

Useful links