Changeset 211 for mpdm/merg_2a.cpp

Show
Ignore:
Timestamp:
11/13/08 20:00:53 (16 years ago)
Author:
smidl
Message:

prejmenovani evalpdflog a evalcond

Files:
1 copied

Legend:

Unmodified
Added
Removed
  • mpdm/merg_2a.cpp

    r205 r211  
    1313        // Setup model 
    1414        RV y ( "{y }" ); 
    15         RV u1 ( "{u1 }" ); 
    16         RV u2 ( "{u2 }" ); 
    17         RV uu=u1; uu.add ( u2 ); 
    18  
    19         double a1t = 1.5; 
    20         double a2t = 0.8; 
    21         double sqr=0.10; 
     15        RV u ( "{u }" ); 
     16        RV um = u; um.t(-1); 
     17        RV z ( "{z }" ); 
     18        RV a ("{a }"); 
     19        RV b ("{b }"); 
     20        RV c ("{c }"); 
     21        RV r ("{r }"); 
     22         
     23        double at = 1.5; 
     24        double bt = 0.8; 
     25        double ct = 0.50; 
     26        double sig = 0.10; 
    2227        // Full system 
    23         vec thg =vec_2 ( a1t,a2t ); //Simulated system - zero for constant term 
    24         vec Th = concat ( thg, sqr ); //Full parameter 
    25  
    26         // Estimated systems ARX(2) 
    27         RV a1 ( "{a1 }" ); 
    28         RV a2 ( "{a2 }" ); 
    29         RV r ( "{r }" ); 
    30         RV all =a1; all.add ( a2 ); all.add ( r ); 
    31         RV allj =a1; allj.add ( r ); allj.add ( a2 ); 
    32         vec Thj=vec_3 ( a1t,sqr,a2t ); 
    33         // Setup values 
     28        vec thy =vec_2 ( at,bt ); //Simulated system - zero for constant term 
     29        vec thu =vec_2 ( at,ct ); //Simulated system - zero for constant term 
     30        vec Thy = concat ( thy, vec_1(sig) ); //Full parameter 
     31        vec Thu = concat ( thu, vec_1(sig) ); //Full parameter 
    3432 
    3533        //ARX constructor 
    36         mat V0 = 0.001*eye ( 2 ); V0 ( 0,0 ) = 1; // 
    37         mat V0g = 0.001*eye ( 3 ); V0g ( 0,0 ) = 1; // 
     34        mat V0 = 0.001*eye ( 3 ); V0 ( 0,0 ) = 1; // 
    3835 
    39         ARX P1 ( concat ( a1,r ), V0, -1 ); 
    40         ARX P2 ( concat ( a2,r ), V0, -1 ); 
    41         ARX PG ( all, V0g, -1 ); //or -1? 
    42 //      ARX PGk ( all, V0g, -1 ); 
     36        ARX P1 ( concat ( a, concat(b,r) ), V0, -1 ); 
     37        ARX P2 ( concat ( a, concat(c,r) ), V0, -1 ); 
    4338 
    4439        //Test estimation 
     
    4742 
    4843        // Logging 
    49         dirfilelog L ( "exp/merg_giw",ndat ); 
     44        dirfilelog L ( "exp/merg_2a",ndat ); 
    5045        int Li_Data = L.add ( RV ( "{Y U1 U2 }" ), "" ); 
    5146        int Li_LL   = L.add ( RV ( "{G M }" ), "LL" ); 
    52         int Li_P1m   = L.add ( RV ( "{a1 r }" ), "P1" ); 
    53         int Li_P2m   = L.add ( RV ( "{a2 r }" ), "P2" ); 
    54         int Li_Gm   = L.add ( RV ( "{a1 a2 r }" ), "G" ); 
    55         int Li_Mm   = L.add ( RV ( "{a1 r a2 }" ), "M" ); 
     47        int Li_P1m   = L.add ( RV ( "{a b r }" ), "P1" ); 
     48        int Li_P2m   = L.add ( RV ( "{a c r }" ), "P2" ); 
    5649        L.init(); 
    5750 
    5851        vec Yt ( ndat ); 
    5952        vec yt ( 1 ); 
    60  
    61         vec LLs ( 2 ); 
    62         vec rgrg ( 2 ); 
    6353 
    6454        //Proposal 
     
    9686                Array<mpdf*> A ( 2 ); A ( 0 ) =&eG1;A ( 1 ) =&eG2; 
    9787                merger M ( A ); 
    98                 M.set_parameters ( 1.5, 100,3 ); //M._Mix().set_method(QB); 
     88                M.set_parameters ( 10, 100,3 ); //M._Mix().set_method(QB); 
    9989                //M2.set_parameters ( 100.0, 1000,3 ); //M2._Mix().set_method(QB); 
    10090                M.merge ( &G0 );