You are on page 1of 4

TUGAS INVERSI GEOFISIKA

WEIGHT FOR OUTLIER DATA


Falah Fadjariansyah Kusuma Kautsar, 12115031.

Gambar 1. Grafik y Terhadap x (posisi outlier di titik 5)

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.

Gambar 3. Grafik y cal Terhadap y obs


SCRIPT MATLAB
%FALAH FADJARIANSYAH 12115031

%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;

%INVERSI TANPA BOBOT


g=[ones(7,1) x'];
m1=inv(g'*g)*g'*yout1';
m2=inv(g'*g)*g'*yout2';

ylin1=m1(1,1)+m1(2,1)*x';
ylin2=m2(1,1)+m2(2,1)*x';

%INVERSI DENGAN BOBOT


g=[ones(7,1) x'];
m11=inv(g'*wf*g)*g'*wf*yout1';
m22=inv(g'*wf2*g)*g'*wf2*yout2';

%DATA HASIL INVERSI


ylin1=m1(1,1)+m1(2,1)*x'; %KASUS 1 TANPA BOBOT
ylin2=m2(1,1)+m2(2,1)*x'; %KASUS 2 TANPA BOBOT
ylin11=m11(1,1)+m11(2,1)*x'; %KASUS 1 DENGAN BOBOT
ylin22=m22(1,1)+m22(2,1)*x'; %KASUS 2 DENGAN BOBOT
e1=abs(ylin11-yout1');
e2=abs(ylin22-yout2');

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')

You might also like