All All: % A Program To Determine Estimator Performance

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

%A Pr ogr amt o det er mi ne Est i mat or Per f or mance.

cl c;
cl ose al l ;
cl ear al l ;
cl f ;
%I ni t i al i zat i ons
A = 1;
num_poi nt s = 100;
num_r eal i z = 500;
nbi ns = 20;
A_cap( num_r eal i z, : ) = 0;
A_t i d( num_r eal i z, : ) = 0;
%gener at i ong si gnal
%x = A + r andn( 1, num_poi nt s) ;
x = A + wgn( 1, num_poi nt s, 1) ;
%est i mat i ng mean
f or i = 1: num_r eal i z;
% x = A + r andn( 1, num_poi nt s) ;
x = A + wgn( 1, num_poi nt s, 1) ;
A_cap( i , : ) = sum( x) / num_poi nt s;
A_t i d( i , : ) = x( 1) ;
end
mean_A_cap = mean( A_cap) ;
var _A_cap = var ( A_cap) ;
mean_A_t i d = mean( A_t i d) ;
var _A_t i d = var ( A_t i d) ;
%pl ot t i ng r esul t
f i gur e( 1) ;
pl ot ( x) ;
t i t l e( ' Unknown Si gnal ' ) ;
f i gur e( 2) ;
hi st ( A_cap, nbi ns) ;
axi s( [ - 3 3 0 35] ) ;
t i t l e( ' Sampl e mean of 1st
est i mat or ' ) ; xl abel ( ' Acap' ) ; yl abel ( ' Number of out comes' ) ;
f i gur e( 3) ;
hi st ( A_t i d, nbi ns) ;
axi s( [ - 3 3 0 35] ) ;
t i t l e( ' Sampl e mean of 2nd
est i mat or ' ) ; xl abel ( ' At i d' ) ; yl abel ( ' Number of out comes' ) ;

You might also like