total_c_correlation: Computes the total cumulative correlation of an ordinal time...

View source: R/total_c_correlation.R

total_c_correlationR Documentation

Computes the total cumulative correlation of an ordinal time series

Description

total_c_correlation returns the value of the total cumulative correlation for an ordinal time series

Usage

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

Details

Given an OTS of length T with range \mathcal{S}=\{s_0, s_1, …, s_n\}, \overline{X}_t=\{\overline{X}_1,…, \overline{X}_T\}, and the cumulative binarized time series, which is defined as \overline{\boldsymbol Y}_t=\{\overline{\boldsymbol Y}_1, …, \overline{\boldsymbol Y}_T\}, with \overline{\boldsymbol Y}_k=(\overline{Y}_{k,0}, …, \overline{Y}_{k,n-1})^\top such that \overline{Y}_{k,i}=1 if \overline{X}_k≤q s_i (k=1,…,T, , i=0,…,n-1), the function computes the estimated average \widehat{Ψ}(l)^c=\frac{1}{n^2}∑_{i,j=0}^{n-1}\widehat{ψ}_{ij}(l)^2, where \widehat{ψ}_{ij}(l) is the estimated correlation \widehat{Corr}(Y_{t, i}, Y_{t-l, j}), i,j=0, 1,…,n-1. If features = TRUE, the function returns a matrix whose components are the quantities \widehat{ψ}_{ij}(l), i,j=0,1, …,n-1.

Value

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.

Author(s)

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

Examples

tcc <- total_c_correlation(series = AustrianWages$data[[100]],
states = 0 : 5) # Computing the total cumulative correlation
# for one of the series in dataset AustrianWages
feature_matrix <- total_c_correlation(series = AustrianWages$data[[100]],
states = 0 : 5) # Computing the corresponding matrix of features

otsfeatures documentation built on March 7, 2023, 7:38 p.m.