
WnioskowanieStatystyczne/Interpretacja współczynnika korelacji: Różnice pomiędzy wersjami
(Nie pokazano 7 pośrednich wersji utworzonych przez tego samego użytkownika) | |||
Linia 22: | Linia 22: | ||
</math> | </math> | ||
− | Całkowitą | + | Całkowitą wariancję zmiennej <math>y</math> podzieliliśmy na dwa |
człony: wariancję estymaty <math>y_{i}^{p}</math> wokół wartości | człony: wariancję estymaty <math>y_{i}^{p}</math> wokół wartości | ||
średniej <math>\overline{y}</math> i wariancję obserwowanych | średniej <math>\overline{y}</math> i wariancję obserwowanych | ||
<math>y_{i}</math> wokół estymaty <math>y_{i}^{p}</math> (trzeci człon | <math>y_{i}</math> wokół estymaty <math>y_{i}^{p}</math> (trzeci człon | ||
− | [https://en.wikipedia.org/wiki/Explained_sum_of_squares#Simple_derivation znika]) | + | [https://en.wikipedia.org/wiki/Explained_sum_of_squares#Simple_derivation znika]): |
+ | |||
+ | |||
+ | <math> | ||
+ | \underset{i=1}{\overset{N}{\sum }}(y_{i}-\overline{y})^{2}= | ||
+ | \underset{i=1}{\overset{N}{\sum }}(y_{i}-y_{i}^{p})^{2}+\underset{i=1}{ | ||
+ | \overset{N}{\sum }}(y_{i}^{p}-\overline{y})^{2} | ||
+ | </math> | ||
+ | |||
+ | |||
===Współczynnik korelacji liniowej (Pearsona)=== | ===Współczynnik korelacji liniowej (Pearsona)=== | ||
Linia 39: | Linia 48: | ||
</math> | </math> | ||
− | oraz estymator współczynnika korelacji liniowej | + | |
+ | oraz wzór na estymator współczynnika korelacji liniowej | ||
+ | |||
<math> | <math> | ||
Linia 46: | Linia 57: | ||
{\sqrt{E\left( (x-\mu_{x})^2\right) E\left( (y-\mu_{y})^2\right)}}, | {\sqrt{E\left( (x-\mu_{x})^2\right) E\left( (y-\mu_{y})^2\right)}}, | ||
</math> | </math> | ||
+ | |||
jego kwadrat estymujemy jako | jego kwadrat estymujemy jako | ||
+ | |||
<math> | <math> | ||
Linia 57: | Linia 70: | ||
− | + | Podstawiając | |
<math> | <math> | ||
\forall_i (y_i - \overline{y}) = | \forall_i (y_i - \overline{y}) = | ||
b (x_i - \overline{x} ) | b (x_i - \overline{x} ) | ||
− | </math>, | + | </math>, oraz |
+ | <math> | ||
+ | b=\frac{\underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x})(y_{i}- | ||
+ | \overline{y})}{\underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x})^{2}} | ||
+ | </math> | ||
+ | |||
+ | |||
+ | do wyrażenia na wariancję tłumaczoną przez model | ||
+ | |||
+ | |||
+ | :<math>\underset{i=1}{\overset{N}{\sum }}(y_{i}^{p}-\overline{y})^{2} </math>, | ||
+ | dostajemy: | ||
− | <math> | + | :<math> |
\underset{i=1}{\overset{N}{\sum }}(y_{i}^{p}-\overline{y})^{2} | \underset{i=1}{\overset{N}{\sum }}(y_{i}^{p}-\overline{y})^{2} | ||
− | = b \underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x})^{2} | + | = b \underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x})^{2} |
− | |||
− | |||
− | |||
=\frac{\left( | =\frac{\left( | ||
\underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x})(y_{i}-\overline{y} | \underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x})(y_{i}-\overline{y} | ||
)\right) ^{2}}{\left( \underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x} | )\right) ^{2}}{\left( \underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x} | ||
)^{2}\right) ^{2}}\underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x} | )^{2}\right) ^{2}}\underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x} | ||
− | )^{2}= | + | )^{2}=\\ |
− | |||
− | |||
=\frac{\left( \underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x} | =\frac{\left( \underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x} | ||
)(y_{i}-\overline{y})\right) ^{2}}{\underset{i=1}{\overset{N}{\sum }}(x_{i}- | )(y_{i}-\overline{y})\right) ^{2}}{\underset{i=1}{\overset{N}{\sum }}(x_{i}- | ||
Linia 84: | Linia 103: | ||
\underset{i=1}{\overset{N}{\sum }}(y_{i}-\overline{y})^{2} | \underset{i=1}{\overset{N}{\sum }}(y_{i}-\overline{y})^{2} | ||
</math> | </math> | ||
+ | |||
czyli | czyli | ||
− | <math> | + | |
+ | :<math> | ||
{r^{2}=\frac{\underset{i=1}{\overset{N}{\sum }}(y_{i}^{p}- | {r^{2}=\frac{\underset{i=1}{\overset{N}{\sum }}(y_{i}^{p}- | ||
\overline{y})^{2}}{\underset{i=1}{\overset{N}{\sum }}(y_{i}-\overline{y})^{2} | \overline{y})^{2}}{\underset{i=1}{\overset{N}{\sum }}(y_{i}-\overline{y})^{2} | ||
Linia 94: | Linia 115: | ||
− | |||
− | + | [[Plik:Korelacja.png|600px|thumb|center|<figure id="fig:rozw2"></figure>Przykładowe wartości współczynnika korelacji dla 300 par <math>(x, y)</math> o | |
− | [[Plik:Korelacja.png|600px|thumb| | ||
różnych stopniach współzależności. | różnych stopniach współzależności. | ||
]] | ]] | ||
+ | |||
+ | |||
+ | Ciekawe przykłady korelacji liniowych dla zależności nieliniowych podaje [https://pl.wikipedia.org/wiki/Zale%C5%BCno%C5%9B%C4%87_zmiennych_losowych artykuł z Wikipedii] |
Aktualna wersja na dzień 16:57, 5 maj 2025
Wnioskowanie_Statystyczne_-_wykład
Interpretacja współczynnika korelacji
Rozważmy wariancję zmiennej [math]y[/math] z poprzedniego rozdziału. Niech [math]y_{i}^{p}=a+bx_{i}[/math]
[math]
\underset{i=1}{\overset{N}{\sum }}(y_{i}-\overline{y})^{2}=
\underset{i=1}{\overset{N}{\sum }}(y_{i}-y_{i}^{p}+y_{i}^{p}-\overline{y}
)^{2}=
[/math]
[math]
\underset{i=1}{\overset{N}{\sum }}(y_{i}-y_{i}^{p})^{2}+\underset{i=1}{
\overset{N}{\sum }}(y_{i}^{p}-\overline{y})^{2}+2\underset{i=1}{\overset{N}{
\sum }}(y_{i}-y_{i}^{p})(y_{i}^{p}-\overline{y})
[/math]
Całkowitą wariancję zmiennej [math]y[/math] podzieliliśmy na dwa człony: wariancję estymaty [math]y_{i}^{p}[/math] wokół wartości średniej [math]\overline{y}[/math] i wariancję obserwowanych [math]y_{i}[/math] wokół estymaty [math]y_{i}^{p}[/math] (trzeci człon znika):
[math]
\underset{i=1}{\overset{N}{\sum }}(y_{i}-\overline{y})^{2}=
\underset{i=1}{\overset{N}{\sum }}(y_{i}-y_{i}^{p})^{2}+\underset{i=1}{
\overset{N}{\sum }}(y_{i}^{p}-\overline{y})^{2}
[/math]
Współczynnik korelacji liniowej (Pearsona)
przypominamy wyprowadzone w poprzednim rozdziale zależności:
[math]
b=\frac{\underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x})(y_{i}-
\overline{y})}{\underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x})^{2}},
\qquad a=\overline{y}-b\overline{x}
[/math]
oraz wzór na estymator współczynnika korelacji liniowej
[math]
r_{x, y}= \frac{\sigma_{x, y}}{\sigma_x \sigma_y}=
\frac{E\left( \left(x-\mu_{x})(y-\mu_{y}\right)\right)}
{\sqrt{E\left( (x-\mu_{x})^2\right) E\left( (y-\mu_{y})^2\right)}},
[/math]
jego kwadrat estymujemy jako
[math]
r^{2}=\frac{\left( \underset{i=1}{\overset{N}{\sum }}(x_{i}-
\overline{x})(y_{i}-\overline{y})\right) ^{2}}{\underset{i=1}{\overset{N}{
\sum }}(x_{i}-\overline{x})^{2}\underset{i=1}{\overset{N}{\sum }}(y_{i}-
\overline{y})^{2}}
[/math]
Podstawiając
[math]
\forall_i (y_i - \overline{y}) =
b (x_i - \overline{x} )
[/math], oraz
[math]
b=\frac{\underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x})(y_{i}-
\overline{y})}{\underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x})^{2}}
[/math]
do wyrażenia na wariancję tłumaczoną przez model
- [math]\underset{i=1}{\overset{N}{\sum }}(y_{i}^{p}-\overline{y})^{2} [/math],
dostajemy:
- [math] \underset{i=1}{\overset{N}{\sum }}(y_{i}^{p}-\overline{y})^{2} = b \underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x})^{2} =\frac{\left( \underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x})(y_{i}-\overline{y} )\right) ^{2}}{\left( \underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x} )^{2}\right) ^{2}}\underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x} )^{2}=\\ =\frac{\left( \underset{i=1}{\overset{N}{\sum }}(x_{i}-\overline{x} )(y_{i}-\overline{y})\right) ^{2}}{\underset{i=1}{\overset{N}{\sum }}(x_{i}- \overline{x})^{2}}\frac{\underset{i=1}{\overset{N}{\sum }}(y_{i}-\overline{y} )^{2}}{\underset{i=1}{\overset{N}{\sum }}(y_{i}-\overline{y})^{2}}=r^{2} \underset{i=1}{\overset{N}{\sum }}(y_{i}-\overline{y})^{2} [/math]
czyli
- [math] {r^{2}=\frac{\underset{i=1}{\overset{N}{\sum }}(y_{i}^{p}- \overline{y})^{2}}{\underset{i=1}{\overset{N}{\sum }}(y_{i}-\overline{y})^{2} }\ } [/math]
Ciekawe przykłady korelacji liniowych dla zależności nieliniowych podaje artykuł z Wikipedii