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 standard estimated dispersion is returned. Otherwise, the function returns the normalized standard estimated dispersion.
Returns
The standard estimated dispersion.
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 standard estimated dispersion given by disploc,d=T1∑t=1Td(Xt,xloc,d), where xloc,d is the standard estimate of the location and d(⋅,⋅) is a distance between ordinal states. If normalize = TRUE, then the normalized dispersion is computed, namely disploc,d/maxsi,sj∈Sd(si,sj).
Examples
estimated_dispersion <- ordinal_dispersion_1(series = AustrianWages$data[[100]],states =0:5)# Computing the standard dispersion estimate# for one series in dataset AustrianWages using the block distance