Changeset 761

Show
Ignore:
Timestamp:
01/06/10 22:30:00 (14 years ago)
Author:
smidl
Message:

changes to dist identific example + wrapper for variance

Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • applications/bdmtoolbox/mex/CMakeLists.txt

    r742 r761  
    2020 
    2121MEX(epdf_mean) 
     22MEX(epdf_variance) 
    2223MEX(epdf_sample_mat) 
    2324MEX(lqg_redesign) 
  • applications/bdmtoolbox/mex/merger.cpp

    r760 r761  
    7575// COMPUTE RESULTS 
    7676        Merger->set_sources ( Sources ); 
     77        Merger->validate(); 
    7778        Merger->merge(); 
    7879 
  • applications/bdmtoolbox/tutorial/mpdm/dist_estim_example.m

    r759 r761  
    1616fz.rvc   = RVtimes([u,u], [0, -1]); 
    1717fz.A     = [1.8, -0.9]; 
    18 fz.const = -0.2; 
     18fz.const = 0.2; 
    1919fz.R     = 1e-2; 
    2020 
     
    3535A1.rgr = RVtimes([z,z],[0,-1]) ; % correct structure is {y,y} 
    3636A1.options ='logfull,logll'; 
     37A1.rv_param = RV({'a','b','c','r'}); 
    3738A1.frg = 0.95; 
    3839A1.constant = 1; 
     
    4041A2=A1; 
    4142A2.rv  = z; 
     43A2.rv_param = RV({'a','b','c','r'}); 
    4244A2.rgr = RVtimes([u,u],[0,-1]) ; % correct structure is {y,y} 
    4345 
     
    5254Merger.stop_niter=10; 
    5355Merger.effss_coef=0.9; 
     56%Merger.dbg_file = 'm.it'; 
     57 
     58M2.class = 'merger_base'; 
     59M2.method='lognormal'; 
     60M2.beta=1.2; 
    5461 
    5562support.class='discrete_support'; 
    56 support.epdf= struct('class','enorm<ldmat>','mu',[1,1,1,1,0.1],'R',eye(5)); 
    57 support.npoints=[100]; 
     63support.epdf= struct('class','enorm<ldmat>','mu',[2,-1,0,0.1],'R',eye(4)); 
     64support.npoints=[300]; 
    5865 
     66support2.class='rectangular_support'; 
     67support2.ranges= {[0,5],[-2,2],[-2,2],[0.001,3]}; 
     68support2.gridsizes = [10,10,10,10]; 
    5969 
    6070 
     
    6979A1_mean = zeros(4,ndat); 
    7080A2_mean = zeros(4,ndat); 
    71 MG_mean = zeros(5,ndat); 
     81MG_mean = zeros(4,ndat); 
    7282 
    7383for t=1:ndat 
    7484    f1=Set.Est0_apost{t}; 
    75     f1.rv = RV({'a','b','c','r'}); 
    7685    f2=Set.Est1_apost{t}; 
    77     f2.rv = RV({'a','b','d','r'}); 
    78      
     86    if t>5 
     87%        support.epdf = f1; 
     88    end 
     89 
    7990    [res,ftilde] = merger({f1,f2},support,Merger); 
    80      
     91 
    8192    A1_mean(:,t) = epdf_mean(f1); 
    8293    A2_mean(:,t) = epdf_mean(f2); 
     
    100111 
    101112figure(2) 
    102 subplot(2,2,1); 
    103 plot(A1_mean'); 
    104 subplot(2,2,2); 
    105 plot(A2_mean'); 
    106 subplot(2,2,3); 
     113plot(A1_mean',':'); 
     114hold on; 
     115plot(A2_mean','--'); 
    107116plot(MG_mean'); 
  • library/bdm/stat/exp_family.cpp

    r739 r761  
    9696 
    9797double egiw::evallog_nn ( const vec &val ) const { 
     98        bdm_assert_debug(val.length()==nPsi+dimx,"Incorrect cond in egiw::evallog_nn" ); 
     99         
    98100        int vend = val.length() - 1; 
    99101 
  • library/bdm/stat/merger.h

    r750 r761  
    221221        void set_sources ( const Array<shared_ptr<pdf> > &S ) { 
    222222                merger_base::set_sources ( S ); 
    223                 Nsources = S.length(); 
     223                //Nsources = S.length(); 
    224224        } 
    225225