Computes the conditional probabilities of an ordinal time series
Computes the conditional probabilities of an ordinal time series
conditional_probabilities returns a matrix with the conditional probabilities of an ordinal time series
UTF-8
conditional_probabilities(series, lag =1, states)
Arguments
series: An OTS.
lag: The considered lag (default is 1).
states: A numerical vector containing the corresponding states.
Returns
A matrix with the conditional probabilities.
Details
Given an OTS of length T with range S={s0,s1,s2,…,sn} (s0<s1<s2<…<sn), Xt={X1,…,XT}, the function computes the matrix Pc(l)=(pi−1j−1c(l))1≤i,j≤n+1, with pijc(l)=(T−l)NiTNij(l), where Ni is the number of elements equal to si in the realization Xt and Nij(l) is the number of pairs (Xt,Xt−l)=(si,sj) in the realization Xt.
Examples
matrix_cp <- conditional_probabilities(series = AustrianWages$data[[100]],states =0:5)# Computing the matrix of# conditional probabilities for one series in dataset AustrianWages