Lucruri pe care orice programator ar trebui să le ştie - Forumul Softpedia.pdf
Regresii liniare 1. o ţiuni teoretice introductive Se ştie...
Transcript of Regresii liniare 1. o ţiuni teoretice introductive Se ştie...
![Page 1: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/1.jpg)
1
Regresii liniare
1. �oţiuni teoretice introductive
Se ştie ca teoretic, forţa de rezistenţă ce o întampină un obiect la mişcarea prin aer este:
![Page 2: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/2.jpg)
2
![Page 3: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/3.jpg)
3
Se pune problema gasirii unei curbe ce aproximează cât mai bine
datele obţinute experimental („norul de puncte”).
Metoda celor mai mici pătrate.
Fie curba y=f(x) = ax+b care aproximează norul de puncte. Se formează suma:
![Page 4: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/4.jpg)
4
( )[ ]∑=
−=n
iii yxfS(a,b)
1
2
reprezentând suma pătratelor distanţelor de la punctele experimentale la punctele curbei y = f(x).
Dorim sa minimizăm pe S(a,b) Calculăm derivatele parţiale ale lui S în raport cu a şi b şi determinăm extremul funcţiei S(a, b) din sistemul de ecuaţii:
=∂
∂
=∂
∂
0
0
b
S(a,b)
a
S(a,b)
![Page 5: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/5.jpg)
5
Verificăm dacă valorile determinate (a, b) reprezintă într-adevăr un minim pentru funcţia S. Se verifică inegalităţile:
∆ > 0; r >0.
Cu a şi b determinate trasăm drepta de ecuaţie y=ax+b care va trece “prin interiorul” norului de puncte astfel încât distanţa de la aceste puncte la dreptă să fie minimă.
∑=
−+=n
iii ybaxS
1
2)( .
)(2)(2111
2
1∑∑∑∑====
−+=−+=∂∂ n
iii
n
ii
n
ii
n
iiii yxxbxaybaxx
a
S
)(2)(2111∑∑∑===
−+=−+=∂
∂ n
ii
n
ii
n
iii ynbxaybax
b
S
Obţinem
![Page 6: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/6.jpg)
6
∑∑∑===
=+n
iii
n
ii
n
ii yxxbxa
111
2
∑∑==
=+n
ii
n
ii ynbxa
11
unde necunoscutele sunt coeficienţii a şi b. Avem
2
11
2
111
−
−
=
∑∑
∑∑∑
==
===
n
ii
n
ii
n
ii
n
ii
n
iii
xxn
yxyxn
a , 2
11
2
1 11
2
1
−
+−
=
∑∑
∑ ∑∑∑
==
= ===
n
ii
n
ii
n
i
n
ii
n
ii
n
iiii
xxn
yxyxx
b
![Page 7: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/7.jpg)
7
Pentru exemplul de mai sus căutăm o curbă de forma:
![Page 8: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/8.jpg)
8
Observaţie: Rezultatele, cel putin pentru viteze mici, nu sunt corecte
deoarece avem valori negative ale forţei de rezistenţă.
![Page 9: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/9.jpg)
9
Pentru a verifica „cât de bună” este aproximarea noastră introducem mărimile:
unde este media valorilor. Se calculează eroarea standard a estimaţiei
unde notaţia y/x semnifică faptul că eroarea se referă la o valoare preconizată a lui y corespunzând unei valori particulare a lui x. Numitorul n-2 semnifică faptul ca s-au pierdut două grade de libertate pentru calculul valorii lui Sr (prin determinarea coeficienţilor a0 şi a1).
![Page 10: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/10.jpg)
10
Reamintim că abaterea medie pătratică dată de
măsoară dispersia datelor. Putem face o analogie între abaterea medie pătratică şi eroarea standard a estimaţiei:
![Page 11: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/11.jpg)
11
Parametrul care ne indică „cât de bună” este aproximarea noastră este coeficientul de determinare
![Page 12: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/12.jpg)
12
unde
este coeficientul de corelaţie. Cu cât coeficientul de determinare este mai aproape de 1, aproximarea noastră este mai bună. Pentru exemplul de mai sus avem
> şi atunci regresia liniară aproximează corect datele.
![Page 13: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/13.jpg)
13
Putem spune că 88% din incertitudinile initiale sunt sunt explicate de acest model liniar. Totuşi nu ne putem baza doar pe calculul coeficientului de determinare, curba obţinută trebuie verificată şi vizual. În exmplele de mai jos, toate datele sunt aproximate cu aceeaşi dreaptă y =3 + 0.5x şi au acelaşi coeficient de determinare, r2 = 0.674.
![Page 14: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/14.jpg)
14
![Page 15: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/15.jpg)
15
2.Liniarizarea expresiilor neliniare (Steven C. Chapra, Applied $umerical Methods with MATLAB for Engineers and Scientists, 3rd ed, ISB$-13:978-0-07-340110-2 )
Există cazuri în care aproximarea datelor se face cu ajutorul unor curbe
neliniare. Pentru a obţine curba de regresie se fac transformări de
liniarizare a acestor curbe. Unele dintre cele mai folosite modele
neliniare sunt:
- Modelul exponenţial (creşterea populaţiilor, dezintegrarea radioactivă)
![Page 16: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/16.jpg)
16
- Modelul de tip putere (model general, utilizat când nu se ştie forma modelului)
- Modelul de saturation growth rate (model utilizat în creşterea populaţiilor când există limitări ale creşterii)
![Page 17: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/17.jpg)
17
![Page 18: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/18.jpg)
18
Exemplu: Se ştie ca teoretic, forţa de rezistenţă ce o întampină un obiect la mişcarea prin aer este:
![Page 19: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/19.jpg)
19
Interpolăm folosind o funcţie de tip putere:
Unde mediile sunt (vezi tabelul de mai jos)
Atunci
![Page 20: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/20.jpg)
20
Obţinem
şi deci
![Page 21: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/21.jpg)
21
![Page 22: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/22.jpg)
22
Regresia liniară poate fi calculată cu
![Page 23: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/23.jpg)
23
3.Generalizarea metodei celor mai mici pătrate.Regresie neliniară.
Regresie polinomială
![Page 24: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/24.jpg)
24
Regresia liniară descrisă anterior se poate generaliza în cazul
polinoamelor. De exemplu, pentru un polinom de gradul doi avem:
Trebuie să minimizăm:
adică
![Page 25: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/25.jpg)
25
Relaţiile de mai sus ne conduc la rezolvarea sistemului
din aflăm coeficienţii
Se poate face uşor o generalizare pentru:
Pentru un polinom de grad m (m+1 coeficienţi) eroarea standard este:
![Page 26: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/26.jpg)
26
iar coeficientul de determinare este dat de:
unde
Exemplu: Gasiţi polinomul de ordinul doi ce aproximează datele din
tabelul de mai jos:
![Page 27: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/27.jpg)
27
Avem:
Formăm sistemul:
![Page 28: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/28.jpg)
28
Rezolvăm folosind Matlab
şi obţinem polinomul
pentru care
şi
Se obţine un coeficient de determinare foarte bun. Buna aproximare este confirmată vizual şi de figura următoare:
![Page 29: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/29.jpg)
29
![Page 30: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/30.jpg)
30
În Matlab regresia polinomială poate fi calculată folosind funcţia polyfit
p = polyfit(x,y,n)
unde
Exemplu
x = (0: 0.1: 2.5)';
y = erf(x);
p = polyfit(x,y,6)
p =
0.0084 -0.0983 0.4217 -0.7435 0.1471 1.1064 0.0004
![Page 31: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/31.jpg)
31
3. Regresie liniară multidimensională
În mod natural se poate face o generalizare a regresiei linare în mai multe
dimensiuni. De exemplu, în R2 vom obţine un plan de regresie:
![Page 32: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/32.jpg)
32
Trebuie să minimizăm:
ceea conduce la rezolvarea sistemului
![Page 33: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/33.jpg)
33
Exemplu: Găsiţi planul de regresie pentru:
Avem de rezolvat
![Page 34: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/34.jpg)
34
Regresia liniară multidimensională se poate generaliza astfel:
![Page 35: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/35.jpg)
35
În Matlab regresia liniară multidimensională poate fi calculată folosind
funcţia regress
b = regress(y,X)
[b,bint] = regress(y,X)
[b,bint,r] = regress(y,X)
[b,bint,r,rint] = regress(y,X)
Exemplu
load carsmall
x1 = Weight;
x2 = Horsepower; % Contains NaN data
y = MPG;%mileage – numar de mile parcurse
![Page 36: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/36.jpg)
36
Compute regression coefficients for a linear model with an
interaction term:
X = [ones(size(x1)) x1 x2 x1.*x2];
b = regress(y,X) % Removes NaN data
b =
60.7104
-0.0102
-0.1882
0.0000
Plot the data and the model:
scatter3(x1,x2,y,'filled')
hold on
x1fit = min(x1):100:max(x1);
x2fit = min(x2):10:max(x2);
[X1FIT,X2FIT] = meshgrid(x1fit,x2fit);
YFIT = b(1) + b(2)*X1FIT + b(3)*X2FIT + b(4)*X1FIT.*X2FIT;
mesh(X1FIT,X2FIT,YFIT)
![Page 37: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/37.jpg)
37
xlabel('Weight')
ylabel('Horsepower')
zlabel('MPG')
view(50,10)
![Page 38: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/38.jpg)
38
Regresia liniară multiplă poate fi folosită pentru determinarea unor relaţii
de tipul:
4. Regresie neliniară
Există cazuri în care funcţia cu care vrem să aproximăm datele nu se
poate liniariza (de exemplu):
![Page 39: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/39.jpg)
39
În acest caz se poate face o liniarizare folosind dezvoltări în serie Taylor
sau se poate face minimizarea direct, rezolvând un sistem neliniar.
Funcţia ce trebuie minimizată este
De exemplu, în Matlab există funcţia fminsearch (Optimization
Toolbox) ce minimizează o funcţie.
![Page 40: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/40.jpg)
40
Exemplu:Fie funcţia
,
![Page 41: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/41.jpg)
41
Din figura de mai jos minimul se afla în vecinătatea punctului
![Page 42: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/42.jpg)
42
Exemplu: Considerăm din nou exemplul cu mişcarea unui obiect în aer:
![Page 43: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/43.jpg)
43
Scriem o funcţie generală ce calculează suma pătratelor
Minimizăm
şi obţinem
![Page 44: Regresii liniare 1. o ţiuni teoretice introductive Se ştie ...math.ubbcluj.ro/~tgrosan/2012CursAppAnNum05.pdf · 1 Regresii liniare 1. o ţiuni teoretice introductive Se ştie ca](https://reader030.fdocuments.net/reader030/viewer/2022040808/5e4ce87d8b1ed609ce5cd5ee/html5/thumbnails/44.jpg)
44
Reamintim că prin liniarizare am obţinut