% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/DIx.R
\name{DIx}
\alias{DIx}
\title{Return an index of quantitative asymmetry and complexity named Developmental Instability Index (DIx)}
\usage{
DIx(l1, l2, details = FALSE, version = 1)
}
\arguments{
\item{l1}{Set of measures at one side of an organism}

\item{l2}{Set of measures at the other side of an organism}

\item{details}{If TRUE, will show the details of computing}

\item{version}{Can be 1 or 2; see description}
}
\value{
A numeric value
}
\description{
Return an index of quantitative asymmetry and complexity.\cr
Higher is the value, higher is the complexity (number of objects) and diversity (difference between them).\cr
The indice is based on the product of the average angular distance of
Edwards (1971) for all permutations of measures for both sides with the
geometric mean of the inverse of Shannon entropy H for both sides.
Let p1 and p2 two vectors of relative measures of objects with sum(p1) = 1 and sum(p2)=1
and n1 being the number of objects in p1 and n2 being the number of objects in p2.\cr
Edwards distance for all permutations of p1 and p2 objects are computed and the average value E is calculated.\cr
The maximun possible Shannon index for identical n1 is max1 = sum((1/n1) * log(1/n1)).\cr
Shannon index is v1 = sum(p1 * log(p1)).\cr
If version == 2, the complementary of Shannon index for these n1 objects is used: c1 = 2 * max1 - v1\cr
If version == 1, the Shannon index is used directly.\cr
The geometry mean between both sides defined the measure of diversity within each side: S=sqrt(c1 * c2)\cr
The Developmental Instability Index is then S * E
}
\details{
DIx returns an index of quantitative asymmetry and complexity
}
\examples{
\dontrun{
l1 <- c(0.1, 0.1, 0.05, 0.2, 0.3, 0.25)
l2 <- c(0.2, 0.3, 0.5)
DIx(l1, l2)

l1 <- c(0.1, 0.1, 0.05, 0.2, 0.3, 0.25)
l2 <- c(0.1, 0.1, 0.05, 0.2, 0.3, 0.25)
DIx(l1, l2)

l1 <- c(0.2, 0.3, 0.5)
l2 <- c(0.2, 0.3, 0.5)
DIx(l1, l2)

l1 <- c(0.2, 0.2, 0.2, 0.2, 0.2)
l2 <- c(0.2, 0.3, 0.5)
DIx(l1, l2)

l1 <- c(0.2, 0.2, 0.2, 0.2, 0.2)
l2 <- c(0.3333, 0.3333, 0.3333)
DIx(l1, l2)

l1 <- c(0.2, 0.2, 0.2, 0.2, 0.2)
l2 <- c(0.2, 0.2, 0.2, 0.2, 0.2)
DIx(l1, l2)

l1 <- c(0.3333, 0.3333, 0.3333)
l2 <- c(0.3333, 0.3333, 0.3333)
DIx(l1, l2)
}
}
\references{
Edwards, A.W.F., 1971. Distances between populations on the basis of gene frequencies. Biometrics 27, 873–881.\cr
Shannon C.E. 1948 A mathematical theory of communication. Bell System Technical Journal 27(3), 379-423.\cr
}
\author{
Marc Girondot \email{marc.girondot@gmail.com}
}
