joint_probabilities function

Computes the joint probabilities of a categorical time series

Computes the joint probabilities of a categorical time series

joint_probabilities returns a matrix with the joint probabilities of a categorical time series UTF-8

joint_probabilities(series, lag = 1)

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.
  • lag: The considered lag (default is 1).

Returns

A matrix with the joint 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 matrix P^(l)=(p^ij(l))1i,jr\widehat{\boldsymbol P}(l) = \big(\widehat{p}_{ij}(l)\big)_{1 \le i, j \le r}, with p^ij(l)=Nij(l)Tl\widehat{p}_{ij}(l)=\frac{N_{ij}(l)}{T-l}, where Nij(l)N_{ij}(l) is the number of pairs (Xt,Xtl)=(i,j)(\overline{X}_t, \overline{X}_{t-l})=(i,j) in the realization Xt\overline{X}_t.

Examples

sequence_1 <- GeneticSequences[which(GeneticSequences$Series==1),] matrix_jp <- joint_probabilities(series = sequence_1) # Computing the matrix of # joint 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