View source: R/ordinal_asymmetry.R
ordinal_asymmetry | R Documentation |
ordinal_asymmetry
computes the estimated asymmetry
of an ordinal time series
ordinal_asymmetry(series, states, distance = "Block", normalize = FALSE)
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 |
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 asymmetry given by \widehat{asym}_{d}=\widehat{\boldsymbol p}^\top (\boldsymbol J-\boldsymbol I)\boldsymbol D\widehat{\boldsymbol p},
where \widehat{\boldsymbol p}=(\widehat{p}_0, \widehat{p}_1, …, \widehat{p}_n)^\top,
with \widehat{p}_k being the standard estimate of the marginal probability for state
s_k, \boldsymbol I and \boldsymbol J are the identity and counteridentity
matrices of order n + 1, respectively, and \boldsymbol D is a pairwise distance
matrix for the elements in the set \mathcal{S} considering a specific distance
between ordinal states, d(\cdot, \cdot). If normalize = TRUE
, then the normalized estimate is computed, namely
\frac{\widehat{asym}_{d}}{max_{s_i, s_j \in \mathcal{S}}d(s_i, s_j)}.
The estimated asymmetry.
Ángel López-Oriona, José A. Vilar
weiss2019distanceotsfeatures
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.