Problem 44933. Vogel-Dobbener entropy
Vogel-Dobbener entropy is a measure of dispersion for ordinal variables.
Given an ordered list of distinct observations u_(1), ..., u_(k) with observed relative frequencies f_1, ..., f_k, the Vogel-Dobbener entropy is defined as
VD = -(sum_{i=1}^{k-1} (F_i log2(F_i) + (1 - F_i) log2(1 - F_i))
where F_1, ... F_k are the cumulative relative frequences, i.e.
F_i = sum_{j=1}^i f_i
The Vogel-Dobbener entropy of a sample satisfies 0 <= VD <= (k - 1); the normalized Vogel-Dobbener entropy is thus defined as
VD* = VD / (k - 1)
For example, suppose that your sample is [2.7 3.3 2.0 3.3 1.7 3.7]. Then:
- k = 5 (there are five distinct observations);
- u_(1), ..., u_(k) = [1.7 2.0 2.7 3.3 3.7]; (note that 3.3 only appears once);
- f_1, ..., f_k = [1/6 1/6 1/6 2/6 1/6];
- F_1, ..., F_k = [1/6 2/6 3/6 5/6 6/6];
- VD = 3.2183; (approx.)
- VD* = 0.8046. (approx.)
Your task is to write a function that, given a list of observations (unordered and possibly containing duplicates) computes the normalized Vogel-Dobbener entropy VD* of the sample. Round to four decimal digits.
Hint: if all observations in the sample are the same, then k = 1, the sum in the definition of VD is empty, and VD equals zero.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers11
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15530 Solvers
-
1303 Solvers
-
76 Solvers
-
middleAsColumn: Return all but first and last element as a column vector
605 Solvers
-
Remove entire row and column in the matrix containing the input values
369 Solvers
More from this Author16
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!