Changeset 288 for mpdm

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

experiments

Location:
mpdm
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • mpdm/CMakeLists.txt

    r278 r288  
    11# Make sure the compiler can find include files from our Bdm library. 
    22include_directories (${BDM_SOURCE_DIR}/bdm) 
    3  
    4 # Make sure the linker can find the Hello library once it is built. 
    53link_directories (${BDM_BINARY_DIR}/bdm) 
    64 
    7 ## Save all needed libraries in variable BdmLibs 
    8 #SET(BdmLibs bdm itpp_debug) 
    9  
    10 IF(WIN32) 
    11         SET(AddLib libacml_dll) 
    12 ENDIF(WIN32) 
    13  
    14 # Define macro for testing a file 
    15 MACRO(TEST FN) 
    16         add_executable (${FN} ${FN}.cpp) 
    17         target_link_libraries (${FN} debug itpp_debug) 
    18         target_link_libraries (${FN} optimized itpp) 
    19         target_link_libraries (${FN} bdm ${AddLib}) 
    20 ENDMACRO(TEST) 
    21  
    22 # Add executable called "helloDemo" that is built from the source files 
    23 # "demo.cxx" and "demo_b.cxx".  The extensions are automatically found. 
    24 TEST(merg_pred) 
    25 TEST(merg_giw) 
    26 TEST(merger_iter_cond) 
    27 TEST(merg_2a) 
     5EXEC(merg_pred) 
     6EXEC(merg_giw) 
     7EXEC(merger_iter_cond) 
     8EXEC(merg_2a) 
  • 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 
  • mpdm/merg_giw.cpp

    r278 r288  
    6868 
    6969        Array<const epdf*> A ( 3 ); A ( 0 ) = &g0; A ( 1 ) =&g1; A ( 2 ) = &g2; 
    70         eprod G0 ( A ); 
     70        eprod G0; G0.set_parameters ( A ); 
    7171 
    7272        for ( t=0; t<ndat; t++ ) {