Changeset 288 for mpdm/merg_2a.cpp
- Timestamp:
- 03/05/09 14:04:30 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
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