Y
|
4
|
5
|
5
|
6
|
X1
|
4
|
3
|
5
|
8
|
X2
|
1
|
2
|
3
|
3
|
Korrelyatsiya koeffitsientini va regressiya tenglamasini hisoblash uchun, berilgan ma'lumotlardan foydalanamiz:
Y: 4, 5, 5, 6
X1: 4, 3, 5, 8
X2: 1, 2, 3, 3
O'rtacha qiymatlarni hisoblaymiz:
Y_mean = (4 + 5 + 5 + 6) / 4 = 5
X1_mean = (4 + 3 + 5 + 8) / 4 = 5
X2_mean = (1 + 2 + 3 + 3) / 4 = 2.25
Bog'liqlikning kuchini hisoblaymiz:
Cov(X1, Y) = Σ((X1 - X1_mean) * (Y - Y_mean)) / n
= ((4 - 5) * (4 - 5) + (3 - 5) * (5 - 5) + (5 - 5) * (5 - 5) + (8 - 5) * (6 - 5)) / 4
= (-1 * -1 + -2 * 0 + 0 * 0 + 3 * 1) / 4
= (1 + 0 + 0 + 3) / 4
= 4 / 4
= 1
Cov(X2, Y) = Σ((X2 - X2_mean) * (Y - Y_mean)) / n
= ((1 - 2.25) * (4 - 5) + (2 - 2.25) * (5 - 5) + (3 - 2.25) * (5 - 5) + (3 - 2.25) * (6 - 5)) / 4
= (-1.25 * -1 + -0.25 * 0 + 0.75 * 0 + 0.75 * 1) / 4
= (1.25 + 0 - 0 + 0.75) / 4
= 2 / 4
= 0.5
Bog'liqlikning tomoshasini hisoblaymiz:
Var(X1) = Σ((X1 - X1_mean)^2) / n
= ((4 - 5)^2 + (3 - 5)^2 + (5 - 5)^2 + (8 - 5)^2) / 4
= (1^2 + 2^2 + 0^2 + 3^2) / 4
= (1 + 4 + 0 + 9) / 4
= 14 / 4
= 3.5
Var(X2) = Σ((X2 - X2_mean)^2) / n
= ((1 - 2.25)^2 + (2 - 2.25)^2 + (3 - 2.25)^2 + (3 - 2.25)^2) / 4
= (1.25^2 + 0.25^2 + 0.75^2 + 0.75^2) / 4
= (1.5625 + 0.0625 + 0.5625 + 0.5625) / 4
= 2.75 / 4
= 0.6875
Korrelyatsiya koeffitsientini hisoblaymiz:
Corr(X1, Y) = Cov(X1, Y) / sqrt(Var(X1) * Var(Y))
= 1 / sqrt(3.5 * Var(Y))
= 1 / sqrt(3.5 * ((4 - 5)^2 + (5 - 5)^2 + (5 - 5)^2 + (6 - 5)^2) / 4)
= 1 / sqrt(3.5 * ((-1)^2 + 0^2 + 0^2 + 1^2) / 4)
= 1 / sqrt(3.5 * (1 + 0 + 0 + 1) / 4)
= 1 / sqrt(3.5 * 2 / 4)
= 1 / sqrt(7 / 4)
= 1 / sqrt(7 / 2)
= 1 / (sqrt(7) / sqrt(2))
= sqrt(2) /Korrelyatsiya koeffitsientini va regressiya tenglamasini hisoblash uchun, berilgan ma'lumotlardan foydalanamiz:
Y: 4, 5, 5, 6
X1: 4, 3, 5, 8
X2: 1, 2, 3, 3
O'rtacha qiymatlarni hisoblaymiz:
Y_mean = (4 + 5 + 5 + 6) / 4 = 5
X1_mean = (4 + 3 + 5 + 8) / 4 = 5
X2_mean = (1 + 2 + 3 + 3) / 4 = 2.25
Bog'liqlikning kuchini hisoblaymiz:
Cov(X1, Y) = Σ((X1 - X1_mean) * (Y - Y_mean)) / n
= ((4 - 5) * (4 - 5) + (3 - 5) * (5 - 5) + (5 - 5) * (5 - 5) + (8 - 5) * (6 - 5)) / 4
= (-1 * -1 + -2 * 0 + 0 * 0 + 3 * 1) / 4
= (1 + 0 + 0 + 3) / 4
= 4 / 4
= 1
Cov(X2, Y) = Σ((X2 - X2_mean) * (Y - Y_mean)) / n
= ((1 - 2.25) * (4 - 5) + (2 - 2.25) * (5 - 5) + (3 - 2.25) * (5 - 5) + (3 - 2.25) * (6 - 5)) / 4
= (-1.25 * -1 + -0.25 * 0 + 0.75 * 0 + 0.75 * 1) / 4
= (1.25 + 0 - 0 + 0.75) / 4
= 2 / 4
= 0.5
Bog'liqlikning tomoshasini hisoblaymiz:
Var(X1) = Σ((X1 - X1_mean)^2) / n
= ((4 - 5)^2 + (3 - 5)^2 + (5 - 5)^2 + (8 - 5)^2) / 4
= (1^2 + 2^2 + 0^2 + 3^2) / 4
= (1 + 4 + 0 + 9) / 4
= 14 / 4
= 3.5
Var(X2) = Σ((X2 - X2_mean)^2) / n
= ((1 - 2.25)^2 + (2 - 2.25)^2 + (3 - 2.25)^2 + (3 - 2.25)^2) / 4
= (1.25^2 + 0.25^2 + 0.75^2 + 0.75^2) / 4
= (1.5625 + 0.0625 + 0.5625 + 0.5625) / 4
= 2.75 / 4
= 0.6875
Korrelyatsiya koeffitsientini hisoblaymiz:
Corr(X1, Y) = Cov(X1, Y) / sqrt(Var(X1) * Var(Y))
= 1 / sqrt(3.5 * Var(Y))
= 1 / sqrt(3.5 * ((4 - 5)^2 + (5 - 5)^2 + (5 - 5)^2 + (6 - 5)^2) / 4)
= 1 / sqrt(3.5 * ((-1)^2 + 0^2 + 0^2 + 1^2) / 4)
= 1 / sqrt(3.5 * (1 + 0 + 0 + 1) / 4)
= 1 / sqrt(3.5 * 2 / 4)
= 1 / sqrt(7 / 4)
= sqrt(4) / sqrt(7)
= 2 / sqrt(7)
Dostları ilə paylaş: |