ajuste de datos
DESCRIPTION
ejercicios lineal exponencialTRANSCRIPT
![Page 1: Ajuste de Datos](https://reader035.vdocuments.com.br/reader035/viewer/2022081808/55cf8a9255034654898be5a4/html5/thumbnails/1.jpg)
AJUSTE DE DATOS
Quillas Flores Jhonatan
![Page 2: Ajuste de Datos](https://reader035.vdocuments.com.br/reader035/viewer/2022081808/55cf8a9255034654898be5a4/html5/thumbnails/2.jpg)
AJUSTE LINEAL: a+bxx=[1:1:10]'; -->y=[17.1,38.1,66.9,101,137,175,213,250,284,317]'; -->[x,y] ans = 1. 17.1 2. 38.1 3. 66.9 4. 101. 5. 137. 6. 175. 7. 213. 8. 250. 9. 284. 10. 317.
![Page 3: Ajuste de Datos](https://reader035.vdocuments.com.br/reader035/viewer/2022081808/55cf8a9255034654898be5a4/html5/thumbnails/3.jpg)
CÓDIGO : a + bxfunction [Q, R]=factorQR(A)
[m,n]=size(A);
P =eye(m,m);
R =A;
for i=1:n A1 = R(i:m,i);
r11 =-sign(A1(1))*norm(A1);
v =A1-r11*eye(m-i+1,1);
v =v./norm(v);
P1 =eye(m,m);
P1(i:m,i:m)=eye(m-i+1,m-i+1)-2*v*v';
R=P1*R;
P=P1*P;
end
Q=P';
endfunction
-->A=[ones(x),x];
-->[Q,R]=factorQR(A);
-->m =(R'*R)\(A'*y);
-->y2=m(1)+m(2)*x;
-->plot(x,y2,x,y,'*');
![Page 4: Ajuste de Datos](https://reader035.vdocuments.com.br/reader035/viewer/2022081808/55cf8a9255034654898be5a4/html5/thumbnails/4.jpg)
Gráfica: a+bx
![Page 5: Ajuste de Datos](https://reader035.vdocuments.com.br/reader035/viewer/2022081808/55cf8a9255034654898be5a4/html5/thumbnails/5.jpg)
ECUACIÓN DE AJUSTE: a+bx• y2=m(1)+m(2)*x
-->m(1)
ans =
- 30.42
-->m(2)
ans =
34.605455
• y2=m(1)+m(2)*x
y2=-30.42+34.605*x
y=a+bxEcuación de ajuste
lineal
Y=-30.42+34.605455X
![Page 6: Ajuste de Datos](https://reader035.vdocuments.com.br/reader035/viewer/2022081808/55cf8a9255034654898be5a4/html5/thumbnails/6.jpg)
AJUSTE CUADRÁTICO:a+bx+cX2
--> x=[1:1:10]';
-->y=[17.1,38.1,66.9,101,137,175,213,250,284,317]';
-->[x,y] ans = 1. 17.1 2. 38.1 3. 66.9 4. 101. 5. 137. 6. 175. 7. 213. 8. 250. 9. 284. 10. 317.
![Page 7: Ajuste de Datos](https://reader035.vdocuments.com.br/reader035/viewer/2022081808/55cf8a9255034654898be5a4/html5/thumbnails/7.jpg)
CÓDIGO: a+bx+cX2
function [Q, R]=factorQR(A)
[m,n]=size(A);
P =eye(m,m);
R =A;
for i=1:n A1 = R(i:m,i);
r11 =-sign(A1(1))*norm(A1);
v =A1-r11*eye(m-i+1,1);
v =v./norm(v);
P1 =eye(m,m);
P1(i:m,i:m)=eye(m-i+1,m-i+1)-2*v*v';
R=P1*R;
P=P1*P;
end Q=P';
endfunction
-->A=[ones(x),x];
-->[Q,R]=factorQR(A);
-->m =(R'*R)\(A'*y);
-->y2=m(1)+m(2)*x;
-->plot(x,y2,x,y,'*');
![Page 8: Ajuste de Datos](https://reader035.vdocuments.com.br/reader035/viewer/2022081808/55cf8a9255034654898be5a4/html5/thumbnails/8.jpg)
GRÁFICA:a+bx+cX2
![Page 9: Ajuste de Datos](https://reader035.vdocuments.com.br/reader035/viewer/2022081808/55cf8a9255034654898be5a4/html5/thumbnails/9.jpg)
ECUACIÓN DE AJUSTE: a+bx+cX2
y3= p(1)+ p(2)*x + p(3)* x.^2
-->p(1)
ans =
- 18.595
-->p(2)
ans =
28.692955
-->p(3)
ans =
0.5375
Y3= p(1)+ p(2)*x + p(3)* x.^2
y3= -18.595+ 28.692955*x + 0.5375 x.^2
Y =a+bx+cX2
Ecuación de ajuste cuadrático:
Y=-18.5995+28.692955x+0.53.75X2
![Page 10: Ajuste de Datos](https://reader035.vdocuments.com.br/reader035/viewer/2022081808/55cf8a9255034654898be5a4/html5/thumbnails/10.jpg)
AJUSTE :a+bx+cX2e^(x/10)
--> x=[1:1:10]';
-->y=[17.1,38.1,66.9,101,137,175,213,250,284,317]';
-->[x,y] ans = 1. 17.1 2. 38.1 3. 66.9 4. 101. 5. 137. 6. 175. 7. 213. 8. 250. 9. 284. 10. 317.
![Page 11: Ajuste de Datos](https://reader035.vdocuments.com.br/reader035/viewer/2022081808/55cf8a9255034654898be5a4/html5/thumbnails/11.jpg)
CÓDIGO : a+bx+cX2e (x/10)
function [Q, R]=factorQR(A)
[m,n]=size(A);
P =eye(m,m);
R =A;
for i=1:n A1 = R(i:m,i);
r11 =-sign(A1(1))*norm(A1);
v =A1-r11*eye(m-i+1,1);
v =v./norm(v);
P1 =eye(m,m);
P1(i:m,i:m)=eye(m-i+1,m-i+1)-2*v*v';
R=P1*R;
P=P1*P;
end Q=P';
endfunction
-->A= [ones(x),x,x.^2 .*exp(x./10)];
-->[Q,R]= factorQR(A);
-->s= (R'*R)\(A'*y);
-->y4= s(1)+ s(2)*x + s(3)* x.^2 .*exp(x./10);
-->plot(x,y4,x,y,'*');
![Page 12: Ajuste de Datos](https://reader035.vdocuments.com.br/reader035/viewer/2022081808/55cf8a9255034654898be5a4/html5/thumbnails/12.jpg)
GRÁFICA: a+bx+cX2e (x/10)
![Page 13: Ajuste de Datos](https://reader035.vdocuments.com.br/reader035/viewer/2022081808/55cf8a9255034654898be5a4/html5/thumbnails/13.jpg)
ECUACIÓN: a+bx+cX2e^(x/10)
y4= s(1)+ s(2)*x + s(3)* x.^2 .*exp(x./10);
-->s(1)
ans =
- 23.061734
-->s(2)
ans =
31.633059
-->s(3)
ans =
0.1044139
• y4= -23.061734+31.633059x +0.1044139*x.^2 .*exp(x./10)
Y=a+bx+cX2e^(x/10)
ECUACIÓN DEL AJUSTE DE DATOS:
• Y= -23.061734 + 31.633059x + 0.1044139X2 e(x/10)