distanceDist(x) computes the distribution of the hamming distances between all pairs of rows (even identical) in matrix x.

distanceDist(x)

Arguments

x

input matrix

Value

a vector of the distance distribution

Details

For a matrix \(\mathbf{X}\) of size \((n \times m)\), the distance distribution is a row-vector \(B\) of length \(n\), where \(B_i\) is the number of pairs of rows with hamming distance \(i\). Since pairs of identical rows are considered, \(B_0\) will always be \(n\).