The TDI measure represents the weighted arithmetic mean (expression levels as
weights for the divergence-stratum value) over all gene divergence categories denoted as divergence-strata.
$$TDI_s = \sum (e_is * ds_i) / \sum e_is$$
where TDI_s denotes the TDI value in developmental stage s, e_is denotes the gene expression level of gene i in stage s, and ds_i denotes the corresponding divergence-stratum of gene i, \(i = 1,...,N\) and N = total number of genes.
Internally the function is written in C++ to speed up TDI computations.