# why some of the weighted unifrac distances are lager than one

**URL:** https://forum.qiime2.org/t/why-some-of-the-weighted-unifrac-distances-are-lager-than-one/13636
**Category:** User Support
**Tags:** diversity
**Created:** [February 15, 2020, 3:10pm UTC](https://forum.qiime2.org/t/why-some-of-the-weighted-unifrac-distances-are-lager-than-one/13636 "2020-02-15T15:10:31Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![jwdebelius](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jwdebelius/32/9655_2.png) [@jwdebelius](https://forum.qiime2.org/u/jwdebelius)
#### Post date: [February 16, 2020, 10:55am UTC](https://forum.qiime2.org/t/why-some-of-the-weighted-unifrac-distances-are-lager-than-one/13636/4 "2020-02-16T10:55:59Z")

</div>

Hi @yuqing,

Welcome to the :qiime2: forum!

It has to do with the way weight is calculated. In unweighted UniFrac, we calculate distance as \frac{\cap \textrm{ branches}}{\cup \textrm{ branches}} (Shared history / total history). So, this value is always between 0 and 1.

Weighted UniFrac is the sum of the the branch length by the absolute difference in count fractions \sum\_{i}^{n}{b\_{i} \mid \frac{A\_{i}}{A\_{T}} - \frac {B\_{i}}{B\_{T}} \mid } where b\_{i} is the branch length, A\_{i} is the total number of sequences in sample A along the length of the branch, A\_{T} is the total number of sequences in sample A, B\_{i} are the sequences in B along the branch and B\_{T} the total sequences in B. But, because of this scaling, the distance can easily exceed one. There's also a rescaling factor that can be used to adjust for the fact that a longer branch length may correlate to more difference... I think it's probably easier for you to read the [original paper](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1828774/) than for me to try and dance around the math.

I do want to note that there's no requirements distances be between 0 and 1, though. I'm about to go to work, which is a distance of about 8 metro stops. I could theoretically rescale that as the fraction of the subway if that was somehow more meaningful here, but I can also just represent it as 8 subway stops. The issue is the relative scale, not the quantity. The one thing I _can't_ do is compare my distance of 8 subway stops with someone else who's scaled their metro distance, because then it's not the same thing!

Best,  
Justine

---

_[View the full topic](https://forum.qiime2.org/t/why-some-of-the-weighted-unifrac-distances-are-lager-than-one/13636)._
