Takes either (1) a mdm or (2) a scaler, vector or matrix of deviances, and extracts or converts then to diverities.
The relationship between deviance (dev) and diversity (d) is given by div = exp(dev/2/n) where n is the number of units (typically rows of a matrix) over which deviance is being averaged.
Usage
dev2div(x, n)
Arguments
x
a mdm or a scaler, vector or matrix of deviances.
n
if x is not a mdm, then the divisor in the conversion as defined as above.