flâneur — a map of the web's best reading

Ren DATASCI 112 Lab 1B - Colaboratory

colab.research.google.com · 4 words · saved by 1 readers

There are many different diversity indices in use, but they all involve first calculating the distribution of a categorical variable. For example, suppose there are 𝐾 species in an ecosystem. We record the species of 𝑛 animals. The first step in calculating any diversity index is to determine the proportion of each species: 𝑝 1 , 𝑝 2 , 𝑝 3 ,..., 𝑝 𝐾 . The diversity index depends on these proportions. In this lab, you will learn about two diversity indices and apply them to the first digits that you looked at in Part A of this lab. First, read in the S&P 500 data again (https://dlsun.github.io/pods/data/sp500.csv). The Simpson diversity index (also called the Herfindahl–Hirschman index in economics) is the probability that two randomly selected observations belong to the same category. The higher the probability, the lower the diversity. The formula for the Simpson diversity index is ∑ 𝑖=1 𝐾 𝑝 2 𝑖 . Connections to Other Courses: Calculate the Simpson diversity indices for

Explore this link on the map →

saved by