Changeset 288 for mpdm/merg_2a.cpp

Show
Ignore:
Timestamp:
03/05/09 14:04:30 (15 years ago)
Author:
smidl
Message:

experiments

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • mpdm/merg_2a.cpp

    r278 r288  
    1010using std::endl; 
    1111 
    12 /*! The purpose of this experiment is to test merging fragmental pdfs between two participants sharing the same parameter, a. However, this parameter has a different role in each model. 
     12/*! \file 
     13Experiment for distributed identification using log-normal merging 
     14 
     15The purpose of this experiment is to test merging fragmental pdfs between two participants sharing the same parameter, a. However, this parameter has a different role in each model. 
    1316 
    1417Lets assume that: 
    15  u -> |a,r| -> y -> |a,r| -> z 
     18\dot 
     19digraph compart{ 
     20 
     21  edge [fontname="FreeSans",fontsize=10,labelfontname="FreeSans",labelfontsize=10]; 
     22  node [fontname="FreeSans",fontsize=10,shape=record]; 
     23 
     24rankdir=LR; 
     25 
     26 U [label="u",height=0.2,width=0.4,color="white", fillcolor="white", style="filled" fontcolor="black"]; 
     27 AR1 [label="a,b,r",height=0.2,width=0.4,color="black", fillcolor="white", style="filled" fontcolor="black"] 
     28 U -> AR1 [color="midnightblue",style="solid"];  
     29 AR2 [label="a,c,r",height=0.2,width=0.4,color="black", fillcolor="white", style="filled" fontcolor="black"] 
     30 AR1 -> AR2 [color="midnightblue",style="solid",label="y"];  
     31 Z [label="z",height=0.2,width=0.4,color="white", fillcolor="white", style="filled" fontcolor="black"]; 
     32 AR2 -> Z [color="midnightblue",style="solid"];  
     33 
     34  
     35} 
     36\enddot  
    1637*/ 
    1738 
     
    3960        mat V0 = 0.001*eye ( 3 ); V0 ( 0,0 ) = 1; // 
    4061 
    41         ARX P1; 
    42         P1.set_statistics(2, V0, -1 ); 
    43         ARX P2; 
    44          P2.set_statistics(2, V0, -1 ); 
     62        ARX P1; P1.set_rv(concat(ab,r)); 
     63        P1.set_statistics(1, V0, -1 ); 
     64        ARX P2; P2.set_rv(concat(ac,r)); 
     65         P2.set_statistics(1, V0, -1 ); 
    4566 
    4667        //Test estimation 
     
    6485 
    6586        //Proposal 
    66         enorm<ldmat> g0;  
     87        enorm<ldmat> g0; g0.set_rv(ab);  
    6788        g0.set_parameters ( "1 1 ",mat ( "1 0; 0 1" ) ); 
    68         egamma g1;  
     89        egamma g1;g1.set_rv(r);  
    6990        g1.set_parameters ( "2  ", "2" ); 
    70         enorm<ldmat> g2;  
     91        enorm<ldmat> g2; g2.set_rv(c);  
    7192        g2.set_parameters ( "1 ",mat ( "1" ) ); 
    7293 
    7394        Array<const epdf*> A ( 3 ); A ( 0 ) = &g0; A ( 1 ) =&g1; A(2) = &g2;  
    74         eprod G0 ( A ); 
     95        eprod G0; G0.set_parameters ( A ); 
    7596 
    7697        vec rgru(2); 
     
    107128                L.logit(Li_P2m, P2._e()->mean()); 
    108129                L.logit(Li_Mm, M.mean()); 
    109                 L.logit(Li_Th, concat(thy,vec_2(ct,rt))); 
     130                L.logit(Li_Th, concat(thy,vec_2(ct,rt*rt))); 
    110131                L.step ( ); 
    111132