1 | function [m n losses]=mc_study(system,apriori,n)
|
---|
2 | p=0;
|
---|
3 | [H C]=load_H;
|
---|
4 | losses=zeros(3,n);
|
---|
5 |
|
---|
6 | for i=1:n
|
---|
7 | system.b=apriori.b0 + sqrt(apriori.P0)*randn;
|
---|
8 | while (system.b==0)
|
---|
9 | system.b=apriori.b0 + sqrt(apriori.P0)*randn;
|
---|
10 | end
|
---|
11 | seed=randn(1,system.horizont);
|
---|
12 |
|
---|
13 | losses(1,i)=cc(system,apriori,seed);
|
---|
14 | losses(2,i)=rizeni(H,C,system,apriori,seed);
|
---|
15 | losses(3,i)=alstr(system,apriori,seed);
|
---|
16 |
|
---|
17 | end
|
---|
18 | %losses=min(losses,10);
|
---|
19 | m=mean(losses,2);
|
---|
20 | n=median(losses,2);
|
---|
21 | if p==1
|
---|
22 | losses=losses/m(3);
|
---|
23 | m=mean(losses,2);
|
---|
24 | n=median(losses,2);
|
---|
25 | a=2;
|
---|
26 | figure
|
---|
27 | for i=1:size(losses,1)
|
---|
28 | subplot(3,1,i)
|
---|
29 | losses(i,:)=min(losses(i,:),a);
|
---|
30 | hist(losses(i,:),100); hold on
|
---|
31 | AXIS([0 a 0 80]);
|
---|
32 | plot(0*(1:80)+m(i), 1:80,'r')
|
---|
33 | plot(0*(1:80)+n(i), 1:80,'g')
|
---|
34 | switch(i)
|
---|
35 | case(1)
|
---|
36 | text(0.1,60,'\fontsize{18} CC')
|
---|
37 | ylabel('\fontsize{18} �nost');
|
---|
38 | case(2)
|
---|
39 | text(0.1,60,'\fontsize{18} SIDPS')
|
---|
40 | case(3)
|
---|
41 | text(0.1,60,'\fontsize{18} DP')
|
---|
42 | end
|
---|
43 |
|
---|
44 | end
|
---|
45 | xlabel('\fontsize{18} relativn�tr�');
|
---|
46 | y_0=num2str(apriori.y0); b_0=num2str(apriori.b0); P_0=num2str(apriori.P0);
|
---|
47 | %text(1.8,250,['\fontsize{18}P_0 = ',P_0]);
|
---|
48 | text(1.8,265,['{}_{^{\fontsize{18}\theta}}^{\fontsize{20}\^}_{\fontsize{14}0} \fontsize{18} = ',b_0]);
|
---|
49 | %text(1.8,278,['\fontsize{18}y_0 = ',y_0]);
|
---|
50 | set( get(gcf, 'Children'), 'FontSize', 18);
|
---|
51 | end
|
---|
52 |
|
---|
53 |
|
---|
54 | end |
---|