Kovariance a Pearsonův korelační koeficient

Statistical Thinking in Python (Part 1)

Justin Bois

Teaching Professor at the California Institute of Technology

Výsledky voleb 2008 v kolísavých státech USA

ch2-4_v2.003.png

1 Data retrieved from Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Part 1)

Výsledky voleb 2008 v kolísavých státech USA

ch2-4_v2.004.png

1 Data retrieved from Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Part 1)

Výsledky voleb 2008 v kolísavých státech USA

ch2-4_v2.005.png

1 Data retrieved from Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Part 1)

Vytvoření bodového grafu

_ = plt.plot(total_votes/1000, dem_share,
             marker='.', linestyle='none')
_ = plt.xlabel('total votes (thousands)')
_ = plt.ylabel('percent of vote for Obama')
Statistical Thinking in Python (Part 1)

Kovariance

  • Míra společné variability dvou veličin
Statistical Thinking in Python (Part 1)

Výpočet kovariance

ch2-4_v2.011.png

1 Data retrieved from Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Part 1)

Výpočet kovariance

ch2-4_v2.012.png

1 Data retrieved from Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Part 1)

Výpočet kovariance

ch2-4_v2.013.png

1 Data retrieved from Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Part 1)

Výpočet kovariance

ch2-4_v2.014.png

$$covariance = \frac{1}{n}\sum_{i=1}^{n}(x_i - \bar{x})(y_i - \bar{y})$$

1 Data retrieved from Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Part 1)

Pearsonův korelační koeficient

$$\rho = \text{Pearsonův korelační koeficient} = \frac{\text{kovariance}}{(\text{sm. odch. x}) (\text{sm. odch. y})}$$

$$= \frac{\text{variabilita způsobená závislostí}}{\text{nezávislá variabilita}}$$

Statistical Thinking in Python (Part 1)

Příklady Pearsonova korelačního koeficientu

ch2-4_v2.020.png

Statistical Thinking in Python (Part 1)

Pojďme si procvičit!

Statistical Thinking in Python (Part 1)

Preparing Video For Download...