ordinal_skewness: Computes the estimated skewness of an ordinal time series

View source: R/ordinal_skewness.R

ordinal_skewnessR Documentation

Computes the estimated skewness of an ordinal time series

Description

ordinal_skewness computes the estimated skewness of an ordinal time series

Usage

ordinal_skewness(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 skewness is returned. Otherwise, the function returns the normalized estimated skewness.

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 skewness given by \widehat{skew}_{d}=∑_{i=0}^n\big(d(s_i,s_n)-d(s_i,s_0)\big)\widehat{p}_i, where d(\cdot, \cdot) is a distance between ordinal states and \widehat{p}_k is the standard estimate of the marginal probability for state s_k computed from the realization \overline{X}_t.

Value

The estimated skewness.

Author(s)

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

References

\insertRef

weiss2019distanceotsfeatures

Examples

estimated_skewness <- ordinal_skewness(series = AustrianWages$data[[100]],
states = 0 : 5) # Computing the skewness estimate
# for one series in dataset AustrianWages using the block distance

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