# How to interpret the entropy data

**URL:** <https://nextstrain.discourse.group/t/how-to-interpret-the-entropy-data/1138>\
**Category:** General\
**Created:** [June 7, 2022, 6:15pm UTC](https://nextstrain.discourse.group/t/how-to-interpret-the-entropy-data/1138 "2022-06-07T18:15:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![juan\_dc](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@juan\_dc](https://nextstrain.discourse.group/u/juan_dc)\
**Post date:** [June 7, 2022, 6:15pm UTC](https://nextstrain.discourse.group/t/how-to-interpret-the-entropy-data/1138/1 "2022-06-07T18:15:45Z")

</div>

Hello  
I have problems interpreting the entropy data, when I saw them I assumed that it goes from 0 to 1, but in my analyzes I find higher values, (1.1 / 1.2 / 1.3) I have read the posts on nextstrain and some papers but in general, they all limit themselves to say that entropy is a measure of diversity.

Attached screenshot

 ![10](https://canada1.discourse-cdn.com/flex031/uploads/nextstrain/original/1X/98b984027b6864e83a932c7a75c4bb9b1e1a795c.png)  
Thanks for your time  
David

---

<div class="post-metadata">

**Author:** ![james](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/james/32/11_2.png) [@james](https://nextstrain.discourse.group/u/james)\
**Post date:** [June 7, 2022, 10:08pm UTC](https://nextstrain.discourse.group/t/how-to-interpret-the-entropy-data/1138/2 "2022-06-07T22:08:38Z")

</div>

Hi David,

**Entropy** is normalised [Shannon entropy](https://en.wikipedia.org/wiki/Entropy_(information_theory)), measuring the “uncertainty” inherent in the possible nucleotides or codons at a given position.

**Events** represent a count of changes in the nucleotide or codon at that position across the (displayed) (sub-)tree. They rely on the ancestral state reconstruction to infer where these changes occured within the tree.

(Docs [here](https://docs.nextstrain.org/en/latest/guides/share/download-data.html?highlight=entropy#diversity-entropy-data) and the code which computes it is [here](https://github.com/nextstrain/auspice/blob/a0e9080dcd61249f24f6c822dfcf6478e4e07ac2/src/util/entropy.js#L187-L191).)

---

<div class="post-metadata">

**Author:** ![juan\_dc](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@juan\_dc](https://nextstrain.discourse.group/u/juan_dc)\
**Post date:** [June 8, 2022, 8:02pm UTC](https://nextstrain.discourse.group/t/how-to-interpret-the-entropy-data/1138/3 "2022-06-08T20:02:30Z")

</div>

Hello James  
then I must assume that there is an error in the calculation of my data???  
Do I have to change the formula?

thanks for your answer

---

<div class="post-metadata">

**Author:** ![james](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/james/32/11_2.png) [@james](https://nextstrain.discourse.group/u/james)\
**Post date:** [June 8, 2022, 8:06pm UTC](https://nextstrain.discourse.group/t/how-to-interpret-the-entropy-data/1138/4 "2022-06-08T20:06:03Z")

</div>

We also have values \> 1 ([e.g.](https://nextstrain.org/ncov/gisaid/global/6m?c=gt-S_371)) so I’ll try to find time to take a closer look

---

<div class="post-metadata">

**Author:** ![james](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/james/32/11_2.png) [@james](https://nextstrain.discourse.group/u/james)\
**Post date:** [June 9, 2022, 3:32am UTC](https://nextstrain.discourse.group/t/how-to-interpret-the-entropy-data/1138/5 "2022-06-09T03:32:36Z")

</div>

[mathematical statistics - Why am I getting information entropy greater than 1? - Cross Validated](https://stats.stackexchange.com/questions/95261/why-am-i-getting-information-entropy-greater-than-1/96461#96461) explains why we have entropy values \> 1.

As an example, looking at a recent nCoV build at spike position 371 we have entropy of 1.056 which is the sum of each of the 4 observed codons: R (1177 tips / 3199 total tips) entropy=0.36, H (1378 / 3199) entropy: 0.36, L (1 / 3199) entropy: 0.00252, P (643 / 3199) entropy: 0.322.

---

<div class="post-metadata">

**Author:** ![juan\_dc](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@juan\_dc](https://nextstrain.discourse.group/u/juan_dc)\
**Post date:** [June 9, 2022, 6:01pm UTC](https://nextstrain.discourse.group/t/how-to-interpret-the-entropy-data/1138/6 "2022-06-09T18:01:08Z")

</div>

Thanks Thanks Thanks Thanks 🙂

---

<div class="post-metadata">

**Author:** ![mathissweet](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@mathissweet](https://nextstrain.discourse.group/u/mathissweet)\
**Post date:** [May 4, 2023, 9:40pm UTC](https://nextstrain.discourse.group/t/how-to-interpret-the-entropy-data/1138/7 "2023-05-04T21:40:46Z")

</div>

Hi James. Are each of these entropy values normalized and then added together (meaning they can be \>1)? Or how are these entropy values normalized? Also, are they normalized to the whole genome/protein coding regions of the genome or normalized to the ORF they are from? Thanks!

---

<div class="post-metadata">

**Author:** ![james](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/james/32/11_2.png) [@james](https://nextstrain.discourse.group/u/james)\
**Post date:** [May 4, 2023, 10:06pm UTC](https://nextstrain.discourse.group/t/how-to-interpret-the-entropy-data/1138/8 "2023-05-04T22:06:21Z")

</div>

Hi @mathissweet - each position (AA or Nt) is computed independently. For a given position, the count of an observed residue/nuc is normalized by the number of (visible) tips, entropy is calculated, and then we report the sum of these entropies for that position. Code [here](https://github.com/nextstrain/auspice/blob/master/src/util/entropy.js#L187-L191) if that helps.

---

<div class="post-metadata">

**Author:** ![mathissweet](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@mathissweet](https://nextstrain.discourse.group/u/mathissweet)\
**Post date:** [May 4, 2023, 10:17pm UTC](https://nextstrain.discourse.group/t/how-to-interpret-the-entropy-data/1138/9 "2023-05-04T22:17:22Z")

</div>

Awesome, thank you!!
