Documente Academic
Documente Profesional
Documente Cultură
Aplicatia 1
Pentru un magazin de mobila se cunosc numarul de spoturi publicitare difuzate si numarul de vizitatori:
Numar de spoturi 7 5 1 8 10 2 6 7
publicitare
Numar vizitatori 42 32 10 40 61 8 35 34
(mii persoane)
Se cere:
3) sa se estimeze, pe baza functiei de regresie, numarul de vizitatori daca s-ar difuza 12 spoturi publicitare
4) sa se masoare intensitatea legaturii dintre cele doua variabile, folosind un indicator adecvat. Sa se
interpreteze
Rezolvare
1) Identificam:
Pentru a identifica existenta, forma si sensul legaturii dintre variabilele analizate construim corelograma:
Corelatia dintre numarul de vizitatori si numarul
spoturilor publicitare difuzate
70
60 y = 5.5354x + 0.9213
R² = 0.9384
50
vizitatori
40
30
20
10
0
0 2 4 6 8 10 12
spoturi
Se observa ca legatura dintre variabile este directa si liniara, iar ecuatia de regresie va avea forma:
𝑦̂𝑖 = 𝑎 + 𝑏𝑥𝑖
𝜕𝑓
=0 2 ∑(𝑦𝑖 − 𝑎 − 𝑏𝑥𝑖 )(−1) = 0 𝑛𝑎 + 𝑏 ∑ 𝑥𝑖 = ∑ 𝑦𝑖
{ 𝜕𝑎 →{ →{
𝜕𝑓
=0 2 ∑(𝑦𝑖 − 𝑎 − 𝑏𝑥𝑖 ) (−𝑥𝑖 ) = 0 𝑎 ∑ 𝑥𝑖 + 𝑏 ∑ 𝑥𝑖2 = ∑ 𝑥𝑖 𝑦𝑖
𝜕𝑏
de unde:
∑ 𝑦𝑖 ∑ 𝑥𝑖
| |
∆𝑎 ∑ 𝑥𝑖 𝑦𝑖 ∑ 𝑥𝑖2 ∑ 𝑥𝑖2 ∑ 𝑦𝑖 − ∑ 𝑥𝑖 ∑ 𝑥𝑖 𝑦𝑖
𝑎= = =
∆ 𝑛 ∑ 𝑥𝑖 𝑛 ∑ 𝑥𝑖2 − (∑ 𝑥𝑖 )2
| |
∑ 𝑥𝑖 ∑ 𝑥𝑖2
𝑛 ∑ 𝑦𝑖
| |
∆𝑏 ∑ 𝑥𝑖 ∑ 𝑥𝑖 𝑦𝑖 𝑛 ∑ 𝑥𝑖 𝑦𝑖 − ∑ 𝑥𝑖 ∑ 𝑦𝑖
𝑏= = =
∆ 𝑛 ∑ 𝑥𝑖 𝑛 ∑ 𝑥𝑖2 − (∑ 𝑥𝑖 )2
| 2 |
∑ 𝑥𝑖 ∑ 𝑥𝑖
Spoturi (xi) Vizitatori (yi) 𝑥𝑖2 𝑥𝑖 𝑦𝑖
7 42 49 294
5 32 25 160
1 10 1 10
8 40 64 320
10 61 100 610
2 8 4 16
6 35 36 210
7 34 49 238
46 262 328 1858
Astfel:
𝑛𝑎 + 𝑏 ∑ 𝑥𝑖 = ∑ 𝑦𝑖
8𝑎 + 46𝑏 = 262
{ →{
𝑎 ∑ 𝑥𝑖 + 𝑏 ∑ 𝑥𝑖2 = ∑ 𝑥𝑖 𝑦𝑖 46𝑎 + 328𝑏 = 1858
De unde:
262 46
| | 328 ∗ 262 − 46 ∗ 1858 85936 − 85468 468
𝑎= 1858 328 = = = = 0.9213
8 46 8 ∗ 328 − (46)2 2624 − 2116 508
| |
46 328
8 262
| | 8 ∗ 1858 − 46 ∗ 262 14864 − 12052 2812
𝑏= 46 1858 = = = = 5.5354
8 46 8 ∗ 328 − (46)2 2624 − 2116 508
| |
46 328
Daca numarul spoturilor publicitare difuzate ar fi 12, atunci se poate estima ca numarul vizitatorilor ar fi
67.35 mii persoane.
a) raportul de corelatie R
∑(𝑦̂𝑖 − 𝑦̅)2
𝑅=√
∑(𝑦𝑖 − 𝑦̅)2
∑ 𝑦𝑖 262
𝑦̅ = = = 32.75 mii pers/spot
𝑛 8
Astfel:
Interpretare: Intre numarul de vizitatori si numarul de spoturi publicitare difuzate exista o legatura
liniara foarte puternica (R foarte aproape de 1) si directa (b>0).
sau
𝑛 ∑ 𝑥𝑦 − ∑ 𝑥 ∑ 𝑦
𝑟𝑥𝑦 =
√[𝑛 ∑ 𝑥 2 − (∑ 𝑥)2 ] ∙ [𝑛 ∑ 𝑦 2 − (∑ 𝑦)2 ]
Astfel:
𝑛 ∑ 𝑥𝑦 − ∑ 𝑥 ∑ 𝑦 8 ∗ 1858 − 46 ∗ 262
𝑟𝑥𝑦 = =
√[𝑛 ∑ 𝑥 2 − (∑ 𝑥)2 ] ∙ [𝑛 ∑ 𝑦 2 − (∑ 𝑦)2 ] √(8 ∗ 328 − 462 )(8 ∗ 10654 − 2622 )
14864 − 12052 2812 2812
= = = = 0.9687
√(2624 − 2116)(85232 − 68644) √508 ∗ 16588 2902.88
Interpretare: Intre numarul de vizitatori si numarul de spoturi publicitare difuzate exista o legatura
liniara foarte puternica si directa (𝑟𝑥𝑦 foarte aproape de 1, pozitiv)
5) Coeficientul de determinare 𝑅2
∑(𝑦̂𝑖 − 𝑦̅)2
𝑅2 = = 0.9384
∑(𝑦𝑖 − 𝑦̅)2
Interpretare: In medie, numarul de vizitatori este influentat in masura de 93.84% de numarul de spoturi
publicitare difuzate.
Aplicatia 2
Pentru sase suprafete agricole s-au inregistrat valorile variabilelor: cantitatea de ingrasaminte si productia
la hectar, intre care exista o legatura liniara. Se cunosc datele: ∑ 𝑥𝑖 = 53, ∑ 𝑦𝑖 = 148, ∑ 𝑥𝑖2 = 609,
∑ 𝑥𝑖 𝑦𝑖 = 833, 𝑖 = ̅̅̅̅
1,6. Sa se determine ecuatia de regresie liniara care modeleaza legatura dintre
variabile si sa se interpreteze coeficientul de regresie.
Rezolvare
Pentru a determina estimatorii a si b, minimizam suma patratelor abaterilor valorilor ajustate de la cele
reale: 𝑚𝑖𝑛 ∑(𝑦𝑖 − 𝑦̂𝑖 )2 . Aceasta conditie se verifica atunci cand se anuleaza derivatele partiale in raport
cu cei doi parametrii.
𝜕𝑓
=0 2 ∑(𝑦𝑖 − 𝑎 − 𝑏𝑥𝑖 )(−1) = 0 𝑛𝑎 + 𝑏 ∑ 𝑥𝑖 = ∑ 𝑦𝑖
{ 𝜕𝑎 →{ →{
𝜕𝑓
=0 2 ∑(𝑦𝑖 − 𝑎 − 𝑏𝑥𝑖 ) (−𝑥𝑖 ) = 0 𝑎 ∑ 𝑥𝑖 + 𝑏 ∑ 𝑥𝑖2 = ∑ 𝑥𝑖 𝑦𝑖
𝜕𝑏
de unde:
∑ 𝑦𝑖 ∑ 𝑥𝑖
| |
∆𝑎 ∑ 𝑥𝑖 𝑦𝑖 ∑ 𝑥𝑖2 ∑ 𝑥𝑖2 ∑ 𝑦𝑖 − ∑ 𝑥𝑖 ∑ 𝑥𝑖 𝑦𝑖
𝑎= = =
∆ 𝑛 ∑ 𝑥𝑖 𝑛 ∑ 𝑥𝑖2 − (∑ 𝑥𝑖 )2
| |
∑ 𝑥𝑖 ∑ 𝑥𝑖2
𝑛 ∑ 𝑦𝑖
| |
∆𝑏 ∑ 𝑥𝑖 ∑ 𝑥𝑖 𝑦𝑖 𝑛 ∑ 𝑥𝑖 𝑦𝑖 − ∑ 𝑥𝑖 ∑ 𝑦𝑖
𝑏= = =
∆ 𝑛 ∑ 𝑥𝑖 𝑛 ∑ 𝑥𝑖2 − (∑ 𝑥𝑖 )2
| 2 |
∑ 𝑥𝑖 ∑ 𝑥𝑖
Astfel:
𝑛𝑎 + 𝑏 ∑ 𝑥𝑖 = ∑ 𝑦𝑖
6𝑎 + 53𝑏 = 148
{ →{
𝑎 ∑ 𝑥𝑖 + 𝑏 ∑ 𝑥𝑖2 = ∑ 𝑥𝑖 𝑦𝑖 53𝑎 + 609𝑏 = 833
De unde:
148 53
| | 148 ∗ 609 − 53 ∗ 833 90132 − 44149 45983
𝑎 = 833 609 = = = = 54.42
6 53 6 ∗ 609 − (53)2 3654 − 2809 845
| |
53 609
6 148
| |
𝑏= 53 833 = 6 ∗ 833 − 53 ∗ 148 = 4998 − 7844 = −2846 = −3.37
6 53 6 ∗ 609 − (53)2 6 ∗ 609 − (53)2 845
| |
53 609