Ans3 PDF
Ans3 PDF
........................................................................................................................................ 1
Perfect observation and distances ........................................................................................... 1
a. Perturb observation with random normal error ...................................................................... 1
b. LSA (x4hat, y4hat) .......................................................................................................... 1
Statistical Tests ................................................................................................................... 2
Counting number of inliers ................................................................................................... 3
clc;
clear all;
x4_init = 102;
y4_init = 168;
fprintf('\n\nInitial Parameter Approximations:\nx4 = %d; y4 = %d
\n',x4_init,y4_init);
1
% LSA for perturbed observations
for i = 1:10000
x4_0 = x4_init;
y4_0 = y4_init;
Delta = 1;
B = [dF1_dx4 dF1_dy4;
dF2_dx4 dF2_dy4;
dF3_dx4 dF3_dy4];
W = eye(n);
Delta = inv(B'*W*B)*B'*W*f;
x4_0 = x4_0 + Delta(1);
y4_0 = y4_0 + Delta(2);
end
v_d1d2d3(i,:) = (f - B*Delta)';
x4_final(i,1) = x4_0;
y4_final(i,1) = y4_0;
end
Statistical Tests
Q_del = inv(B'*W*B);
sig_xy = variance^2*Q_del;
[V D] = eig(sig_xy);
a = sqrt(D(1,1)*chi_p2);
b = sqrt(D(2,2)*chi_p2);
2
theta = atan2(V(1,2),V(1,1));
scatter(x4_final,y4_final,'.b');
hold on;
draw_ell(x4_perf, y4_perf, a, b, theta);
d1 = 82.462113
d2 = 108.166538
d3 = 80.622577
3
100.160016 100.203680
100.473112 99.889821
100.187451 99.776051
170.444772 170.510378
169.989655 170.277318
169.919833 169.670539
169.541650 170.354047
170.238683 169.778931