root/applications/dual/experiment/itermc.m @ 1044

Revision 723, 0.7 kB (checked in by smidl, 15 years ago)

Big commit of LQG stuff

  • Property svn:eol-style set to native
Line 
1% configuracni struktura se bude jmenovat "c"
2c.b =1;
3c.sigma = 0.1;
4c.ndat = 50;
5yr = 1;
6
7% nejlepsi mozny regulator - zna b
8C1.class='exact_ctrl';
9C1.yr   = yr;
10C1.b    = c.b;
11
12% CE regulator - b se odhaduje
13C2.class='ce_ctrl';
14C2.yr   = yr;
15C2.b0   = 0;
16C2.P0   = 1;
17
18% monte carlo study
19n=100;
20losses=zeros(10,1);
21seeds=32000*rand(1,n);
22for i=1:n
23    c.b = randn();
24    c.seed = seeds(i);
25    c.controller = C1;
26    Mmc=iterativemc(c);
27    losses(i) = sum((Mmc.S_y-yr*ones(size(Mmc.S_y))).^2);
28   
29    c.controller = C2;
30    Mmc=iterativemc(c);
31    looo= sum((Mmc.S_y-yr*ones(size(Mmc.S_y))).^2)
32%     keyboard
33    losses2(i) = looo;
34end
35[min(losses) median(losses) max(losses)]
36[min(losses2) median(losses2) max(losses2)]
37
Note: See TracBrowser for help on using the browser.