Computes the total cumulative correlation of an ordinal time series
Computes the total cumulative correlation of an ordinal time series
total_c_correlation returns the value of the total cumulative correlation for an ordinal time series
UTF-8
total_c_correlation(series, lag =1, states, features =FALSE)
Arguments
series: An OTS.
lag: The considered lag (default is 1).
states: A numerical vector containing the corresponding states.
features: Logical. If features = FALSE (default), the value of the total cumulative correlation is returned. Otherwise, the function returns a matrix with the individual components of the total cumulative correlation
Returns
If features = FALSE (default), returns the value of the total cumulative correlation. Otherwise, the function returns a matrix of features, i.e., the matrix contains the features employed to compute the total cumulative correlation.
Details
Given an OTS of length T with range S={s0,s1,…,sn}, Xt={X1,…,XT}, and the cumulative binarized time series, which is defined as Yt={Y1,…,YT}, with Yk=(Yk,0,…,Yk,n−1)⊤
such that Yk,i=1 if Xk≤si (c("k=1,ldots,T,\n", ",i=0,ldots,n−1")), the function computes the estimated average Ψ(l)c=n21∑i,j=0n−1ψij(l)2, where ψij(l) is the estimated correlation Corr(Yt,i,Yt−l,j), i,j=0,1,…,n−1. If features = TRUE, the function returns a matrix whose components are the quantities ψij(l), i,j=0,1,…,n−1.
Examples
tcc <- total_c_correlation(series = AustrianWages$data[[100]],states =0:5)# Computing the total cumulative correlation# for one of the series in dataset AustrianWagesfeature_matrix <- total_c_correlation(series = AustrianWages$data[[100]],states =0:5)# Computing the corresponding matrix of features