Professional Documents
Culture Documents
Toooopii
Toooopii
Garis linear ketika terdapat outlier pada titik 5 memiliki konstanta persamaan yang lebih besar
dibandingkan dengan tanpa outlier.
Setelah dilakukan pembobotan, trendline hasil inversinya lebih mendekati trendline hasil inversi
tanpa outlier.
Gambar 2. Grafik y Terhadap x (posisi outlier di awal)
Garis linear ketika terdapat outlier di awal memiliki gradien yang lebih kecil dibandingkan dengan
yang tanpa outlier. Sehingga mempengaruhi perolehan nilai parameter modelnya.
%MODEL PERTAMA
x=0:6;
y=2+(4*x);
noise1=[0 0 0 0 0 20 0 ]; %kasus 1
noise2=[10 0 0 0 0 0 0 ]; %kasus 2
yout1=y+noise1;
yout2=y+noise2;
%wf=bobot
wf=eye(7,7);
wf(6,6)=0.001;
wf2=eye(7,7);
wf2(1,1)=0.001;
ylin1=m1(1,1)+m1(2,1)*x';
ylin2=m2(1,1)+m2(2,1)*x';
S1=abs(ylin1-y');
S2=abs(ylin2-y');
S11=abs(ylin11-y');
S22=abs(ylin22-y');
figure
subplot(2,1,1);
title('INVERSI TANPA PEMBOBOTAN')
hold on
plot (x,y,'-k');
plot (x,yout1,'or')
plot (x,ylin1,'-r')
xlabel('x')
ylabel('y')
legend ('without Noise', 'data','with Noise')
hold off
subplot(2,1,2);
title ('INVERSI DENGAN PEMBOBOTAN')
hold on
plot (x,y,'-k');
plot (x,yout1,'or')
plot (x,ylin11,'-r')
xlabel('x')
ylabel('y')
legend ('without Noise', 'data','with Noise')
figure
subplot (2,1,1);
title('INVERSI TANPA PEMBOBOTAN')
hold on
plot (x,y,'-k');
plot (x,yout2,'or')
plot (x,ylin2,'-r')
xlabel('x')
ylabel('y')
legend ('without outlier', 'data','with outlier')
hold off
subplot(2,1,2);
title ('INVERSI DENGAN PEMBOBOTAN')
hold on;
plot (x,y,'-k');
plot (x,yout2,'or')
plot (x,ylin22,'-r')
xlabel('x')
ylabel('y')
legend ('without outlier', 'data','with outlier')
figure
subplot (2,1,1);
title ('perbandingan y obs (TANPA BOBOT) dengan y cal ')
hold on
scatter (ylin1,y,'*k')
xlabel ('yobs')
ylabel('ycal')
hold off
subplot (2,1,2);
title ('Perbandingan y obs (dengan Bobot) dengan y cal')
hold on
scatter(ylin11,y,'*k')
xlabel('yobs')
ylabel('ycal')