Page 65 - Classification Parameter Estimation & State Estimation An Engg Approach Using MATLAB
P. 65
54 PARAMETER ESTIMATION
for i ¼ 1:length(z)
[dummy,ind] ¼ max(px_z(x,z(i))); x_map(i) ¼ x(ind);
x_mse(i) ¼ sum(pz_x(z(i),x).*px(x).*x)
./.sum(pz_x(z(i),x).*px(x));
ind ¼ find((cumsum(px_z(x,z(i))) ./ .sum(px_z(x,z(i))))>0.5);
x_mae(i) ¼ x(ind(1));
end
figure; clf; plot(zset,xset,‘.’); hold on;
plot(z,x_map,‘k-.’); plot(z,x_mse,‘k--’);
plot(z,x_mae,‘k-’);
legend(‘realizations’,‘MAP’,‘MSE’,‘MAE’);
return
function ret ¼ px(x)
global a b; ret ¼ betapdf(x,a,b);
return
function ret ¼ pz_x(z,x)
global Np; ret ¼ (z>0).*(Np./x).*gampdf(Np*z./x,Np,1);
return
function ret ¼ pz(z)
global xrange; ret ¼ sum(px(xrange).*pz_x(z,xrange));
return
function ret ¼ px_z(x,z)
ret ¼ pz_x(z,x).*px(x)./pz(z);
return
3.1.1 MMSE estimation
The solution based on the quadratic cost function (3.6) is called the
minimum mean square error estimator, also called the minimum vari-
ance estimator for reasons that will become clear in a moment. Sub-
stitution of (3.6) and (3.9) in (3.10) gives:
Z
T
x
x
^ x x MMSE ðzÞ¼ argmin ð^ x xÞ ð^ x xÞpðxjzÞdx ð3:12Þ
^ x x x
Differentiating the function between braces with respect to ^ x (see Appen-
x
dix B.4), and equating this result to zero yields a system of M linear
equations, the solution of which is:
Z
^ x x MMSE ðzÞ¼ xpðxjzÞdx ¼ E½xjz ð3:13Þ
x