Documente Academic
Documente Profesional
Documente Cultură
MA Sem 4
CORELAIE I REGRESIE
Se pune problema stabilirii unor relaii ntre dou sau mai multe seturi de date. Presupunem c dorim
Y y1 , y 2 ,..., y n sunt nite vectori de aceeai lungime cu componente numere reale. Mai nti
axa ordonatelor. n funcie de natura graficului alegem o funcie f astfel nct f x j s aproximeze ct
1
3
x
2
1
x
2
3
x
j1
f b 0 , b1 y j Fx j y j b 0 b1 x j
n
j1
j1
2
MA Sem 4
DY
b 0
b 0 b1MX MY
b1 X, Y
0
DX
b
M
X
b
M
X
M
X
,
Y
0
1
b MY aM X
0
0
b1
X, Y
MXY MX MY
fiind coeficientul de corelaie al variabilelor X i Y.
DX DY
j1
j1
1 x1
y1
b
1
1 x2
y2
Observaie. Dac notm Z
, Y , B 0 atunci B Z t Z Z t Y
... ...
...
b1
1 x
y
n
Mathcad
mean(X)
var(X)
Media M(X)
Dispersia D(X)
EXCEL
AVERAGE
VARP
Abaterea X
stdevX
Covariana cov(X,Y)
cvar(X,Y)
COVAR
Coef de corelaie X, Y
corr X, Y
CORREL
b1
b0
slope(X,Y)
SLOPE(Y,X)
intercept(X,Y)
b0
b1
eroarea la regresia
liniar=radical(S/n-2)
STDEVP
INTERCEPT(Y,X)
line (X, Y)
stderr(X,Y)
Exemplul 1. S-au msurat 2 mrimi fizice i s-au obinut urmtoarele rezultate . S se reprezinte
grafic, s se calculeze coeficientul de corelaie i s se scrie dreapta de regresie a lui Y n raport cu X.
Relaia ntre X i Y poate fi considerat liniar?
X
Y
2.1
5.9
1.2
2.5
1.5
3.2
1.8
4.8
1.7
4.2
2
5.1
1.6
4
1.4
3
X x
a slope(XY)
mean(X) 1.65
a 3.782
Y y
b intercept (XY)
mean(Y) 4.04
b 2.2
1.9
5
1.3
2.7
3
MA Sem 4
6
5
Y
4
a X b
3
2
2.2
Axis Title
1.2
1.56
1.85
1.7
24
1.63
1.4
1.92
1.31
2.5
3.2
4.8
4.2
5.1
4
3
5
2.7
Series1
Linear (Series1)
2.1
1.2
1.5
1.8
1.7
2
1.6
1.4
1.9
1.3
5.9
2.5
3.2
4.8
4.2
5.1
4
3
5
2.7
b1=
b0=
SLOPE(B1:B10,A1:A10)
INTERCEPT(B1:B10,A1:A10)
3.78
-2.2
j1
j1
4
MA Sem 4
f
0
b
0
f
0
b1
f
0
b2
b 0 b1MX b 2 M X 2 MY
b 0 MX b1M X 2 b 2 M X 3 MX, Y
2
3
4
2
b 0 M X b1M X b 2 M X M X , Y
Se afl b 0 , b1 , b 2 .
Observaii.
1 x1
1 x2
1. Dac notm Z
... ...
1 x
n
2. Coeficienii b 0 , b1 , b 2 se
x 12
y1
b0
2
x2
1
y2
, Y , B b1 atunci B Z t Z Z t Y
...
...
b
2
2
xn
yn
, 2=gradul
polinomului
Exemplul 2. Se consider datele. S se reprezinte grafic i s se stabileasc dac exist o
relaie de dependen.
X
-1
0
1
2
3
Y
1
0
3
7
15
Rezolvare.
A MX
M X2
MX
M X2
M X3
MY b
, b MXY , b
MX Y b
M X2
M X3
M X4
0.343
1 lsolveA, b 0.786
1.357
2
sau
15
Y
10
3.5 X 1.7
3
3
regress ( X Y 2)
0.343
0.786
1.357
2
X