function mc_study(system,apriori,n)

for i=1:n
    system.x=apriori.H(:,1)+sqrt(diag(apriori.H(:,2:5))).*randn(4,1);
    [losses(1,i) losses(2,i) losses(3,i)]=srovnej(system,apriori);
end

losses(1,:)=losses(1,:)./losses(3,:);
losses(2,:)=losses(2,:)./losses(3,:);
losses(3,:)=losses(3,:)./losses(3,:);

hist(losses(1,:));
title([mean(losses(1,:)) median(losses(1,:))])
AXIS([0 5 ylim])

figure
hist(losses(2,:));
title([mean(losses(2,:)) median(losses(2,:))])
AXIS([0  ylim])

end