ordinal_cohens_kappa {otsfeatures}R 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, \ldots, s_n\} (s_0 < s_1 < s_2 < \ldots < s_n), \overline{X}_t=\{\overline{X}_1,\ldots, \overline{X}_T\}, the function computes the estimated ordinal Cohen's kappa given by \widehat{\kappa}_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}\sum_{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} \sum_{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

Weiß CH (2019). “Distance-based analysis of ordinal data and ordinal time series.” Journal of the American Statistical Association.

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

[Package otsfeatures version 1.0.0 Index]