ordinal_cohens_kappa: Computes the estimated ordinal Cohen's kappa of an ordinal...

View source: R/ordinal_cohens_kappa.R

ordinal_cohens_kappaR Documentation

Computes the estimated ordinal Cohen's kappa of an ordinal time series

Description

ordinal_cohens_kappa computes the estimated ordinal Cohen's kappa of an ordinal time series

Usage

ordinal_cohens_kappa(series, states, distance = "Block", lag = 1)

Arguments

series

An OTS.

states

A numerical vector containing the corresponding states.

distance

A function defining the underlying distance between states. The Hamming, block and Euclidean distances are already implemented by means of the arguments "Hamming", "Block" (default) and "Euclidean". Otherwise, a function taking as input two states must be provided.

lag

The considered lag.

Details

Given an OTS of length T with range \mathcal{S}=\{s_0, s_1, s_2, …, s_n\} (s_0 < s_1 < s_2 < … < s_n), \overline{X}_t=\{\overline{X}_1,…, \overline{X}_T\}, the function computes the estimated ordinal Cohen's kappa given by \widehat{κ}_d(l)=\frac{\widehat{disp}_d(X_t)-\widehat{E}[d(X_t, X_{t-l})]}{{\widehat{disp}}_d(X_t)}, where \widehat{disp}_{d}(X_t)=\frac{T}{T-1}∑_{i,j=0}^nd\big(s_i, s_j\big)\widehat{p}_i\widehat{p}_j is the DIVC estimate of the dispersion, with d(\cdot, \cdot) being a distance between ordinal states and \widehat{p}_k being the standard estimate of the marginal probability for state s_k, and \widehat{E}[d(X_t, X_{t-l})]=\frac{1}{T-l} ∑_{t=l+1}^T d(\overline{X}_t, \overline{X}_{t-l}).

Value

The estimated ordinal Cohen's kappa.

Author(s)

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

References

\insertRef

weiss2019distanceotsfeatures

Examples

estimated_ock <- ordinal_cohens_kappa(series = AustrianWages$data[[100]],
states = 0 : 5) # Computing the estimated ordinal Cohen's kappa
# for one series in dataset AustrianWages using the block distance

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