This feature calculates the cosine distance matrix between two HMMs \(A\) and \(B\) before dynamic time warp is applied to
the distance matrix calculate the cumulative distance between the HMMs, which acts as a measure of similarity,
The cosine distance matrix \(D\) is found to be \(D[a_i, b_j] = 1 - \frac{a_ib_j^{T}}{a_ia_i^Tb_jb_j^T}\),
in which \(a_i\) and \(a_i\) refer to row vectors of \(A\) and \(B\) respectively.
This in turn means that \(D\) is of dimensions \(nrow(A), nrow(b)\). Dynamic time warp then calculates the
cumulative distance by calculating matrix \(C[i, j] = min(C[i-1, j], C[i, j-1], C[i-1, j-1]) + D[i, j]\),
where \(C_{i,j}\) is 0 when \(i\) or \(j\) are less than 1. The lower rightmost point of the matrix \(C\)
is then returned as the cumulative distance between proteins.