- Timestamp:
- 03/05/09 14:04:30 (16 years ago)
- Location:
- mpdm
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
mpdm/CMakeLists.txt
r278 r288 1 1 # Make sure the compiler can find include files from our Bdm library. 2 2 include_directories (${BDM_SOURCE_DIR}/bdm) 3 4 # Make sure the linker can find the Hello library once it is built.5 3 link_directories (${BDM_BINARY_DIR}/bdm) 6 4 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) 5 EXEC(merg_pred) 6 EXEC(merg_giw) 7 EXEC(merger_iter_cond) 8 EXEC(merg_2a) -
mpdm/merg_2a.cpp
r278 r288 10 10 using std::endl; 11 11 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 13 Experiment for distributed identification using log-normal merging 14 15 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. 13 16 14 17 Lets assume that: 15 u -> |a,r| -> y -> |a,r| -> z 18 \dot 19 digraph compart{ 20 21 edge [fontname="FreeSans",fontsize=10,labelfontname="FreeSans",labelfontsize=10]; 22 node [fontname="FreeSans",fontsize=10,shape=record]; 23 24 rankdir=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 16 37 */ 17 38 … … 39 60 mat V0 = 0.001*eye ( 3 ); V0 ( 0,0 ) = 1; // 40 61 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 ); 45 66 46 67 //Test estimation … … 64 85 65 86 //Proposal 66 enorm<ldmat> g0; 87 enorm<ldmat> g0; g0.set_rv(ab); 67 88 g0.set_parameters ( "1 1 ",mat ( "1 0; 0 1" ) ); 68 egamma g1; 89 egamma g1;g1.set_rv(r); 69 90 g1.set_parameters ( "2 ", "2" ); 70 enorm<ldmat> g2; 91 enorm<ldmat> g2; g2.set_rv(c); 71 92 g2.set_parameters ( "1 ",mat ( "1" ) ); 72 93 73 94 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 ); 75 96 76 97 vec rgru(2); … … 107 128 L.logit(Li_P2m, P2._e()->mean()); 108 129 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))); 110 131 L.step ( ); 111 132 -
mpdm/merg_giw.cpp
r278 r288 68 68 69 69 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 ); 71 71 72 72 for ( t=0; t<ndat; t++ ) {