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 dispersion is returned. Otherwise, the function returns the normalized estimated dispersion.
Returns
The estimated dispersion according to the approach based on the diversity coefficient.
Details
Given an OTS of length T with range S={s0,s1,s2,…,sn} (s0<s1<s2<…<sn), Xt={X1,…,XT}, the function computes the DIVC estimated dispersion given by dispd=T−1T∑i,j=0nd(si,sj)pipj, where d(⋅,⋅) is a distance between ordinal states and pk is the standard estimate of the marginal probability for state sk. If normalize = TRUE, and distance = "Block" or distance = "Euclidean", then the normalized versions are computed, that is, the corresponding estimates are divided by the factors 2/m or 2/m2, respectively.
Examples
estimated_dispersion <- ordinal_dispersion_2(series = AustrianWages$data[[100]],states =0:5)# Computing the DIVC dispersion estimate# for one series in dataset AustrianWages using the block distance