Revision 1249, 501 bytes
(checked in by zimamiro, 14 years ago)
|
|
Line | |
---|
1 | function mc_study(system,apriori,n) |
---|
2 | |
---|
3 | for i=1:n |
---|
4 | system.x=apriori.H(:,1)+sqrt(diag(apriori.H(:,2:5))).*randn(4,1); |
---|
5 | [losses(1,i) losses(2,i) losses(3,i)]=srovnej(system,apriori); |
---|
6 | end |
---|
7 | |
---|
8 | losses(1,:)=losses(1,:)./losses(3,:); |
---|
9 | losses(2,:)=losses(2,:)./losses(3,:); |
---|
10 | losses(3,:)=losses(3,:)./losses(3,:); |
---|
11 | |
---|
12 | hist(losses(1,:)); |
---|
13 | title([mean(losses(1,:)) median(losses(1,:))]) |
---|
14 | AXIS([0 5 ylim]) |
---|
15 | |
---|
16 | figure |
---|
17 | hist(losses(2,:)); |
---|
18 | title([mean(losses(2,:)) median(losses(2,:))]) |
---|
19 | AXIS([0 ylim]) |
---|
20 | |
---|
21 | end |
---|