Human relationships are deeply complex entities; far more than we think we see at the surface. They are particularly so if the people themselves are complex beings. There are nuanced and often unacknowledged patterns lurking under the surface that we do not label but can feel. Only when that person is gone can we sometimes piece together the fragments of the subconscious that defined the interplay between you.
There is no mathematical formula that could ever be developed to adequately explain human behaviour because it defies both definition and categoriazation.
It simply is.