ordinal_asymmetry {otsfeatures}R Documentation

Computes the estimated asymmetry of an ordinal time series

Description

ordinal_asymmetry computes the estimated asymmetry of an ordinal time series

Usage

ordinal_asymmetry(series, states, distance = "Block", normalize = FALSE)

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.

normalize

Logical. If normalize = FALSE (default), the value of the estimated asymmetry is returned. Otherwise, the function returns the normalized estimated asymmetry.

Details

Given an OTS of length TT with range S={s0,s1,s2,,sn}\mathcal{S}=\{s_0, s_1, s_2, \ldots, s_n\} (s0<s1<s2<<sns_0 < s_1 < s_2 < \ldots < s_n), Xt={X1,,XT}\overline{X}_t=\{\overline{X}_1,\ldots, \overline{X}_T\}, the function computes the estimated asymmetry given by asym^d=p^(JI)Dp^\widehat{asym}_{d}=\widehat{\boldsymbol p}^\top (\boldsymbol J-\boldsymbol I)\boldsymbol D\widehat{\boldsymbol p}, where p^=(p^0,p^1,,p^n)\widehat{\boldsymbol p}=(\widehat{p}_0, \widehat{p}_1, \ldots, \widehat{p}_n)^\top, with p^k\widehat{p}_k being the standard estimate of the marginal probability for state sks_k, I\boldsymbol I and J\boldsymbol J are the identity and counteridentity matrices of order n+1n + 1, respectively, and D\boldsymbol D is a pairwise distance matrix for the elements in the set S\mathcal{S} considering a specific distance between ordinal states, d(,)d(\cdot, \cdot). If normalize = TRUE, then the normalized estimate is computed, namely asym^dmaxsi,sjSd(si,sj)\frac{\widehat{asym}_{d}}{max_{s_i, s_j \in \mathcal{S}}d(s_i, s_j)}.

Value

The estimated asymmetry.

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_asymmetry <- ordinal_asymmetry(series = AustrianWages$data[[100]],
states = 0 : 5) # Computing the asymmetry estimate
# for one series in dataset AustrianWages using the block distance

[Package otsfeatures version 1.0.0 Index]