Changeset 700 for applications/bdmtoolbox/tutorial
- Timestamp:
- 11/04/09 22:54:58 (15 years ago)
- Location:
- applications/bdmtoolbox/tutorial
- Files:
-
- 5 modified
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/tutorial/merging/pdfs.m
r568 r700 38 38 'rv', ab); 39 39 Gb_a=struct('class','mgamma', 'beta',2, 'k',1, 'rv',b, 'rvc',a); % f(b|a) 40 Ga_ =struct('class','mepdf','epdf',Ga); % convert f(a) to f(a|) 41 Gba = struct('class','mprod', 'mpdfs',{{Gb_a,Ga_}}); 40 Gba = struct('class','mprod', 'pdfs',{{Gb_a,Ga}}); 42 41 43 42 pd.Ga=Ga; -
applications/bdmtoolbox/tutorial/userguide/arx_basic_example.m
r631 r700 1 1 % load data created by the MpdfDS_example 2 load mpdfds_results2 load pdfds_results 3 3 4 4 DS.class = 'MemDS'; … … 17 17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 18 % plot results 19 ndat = size(M. u,1);19 ndat = size(M.DS_u,1); 20 20 21 21 subplot(1,2,1); 22 22 hold off 23 plot((true_theta' *ones(1,ndat))','-.'); 24 title(' Regression parameters \theta') 25 hold on 26 plot(M.mean_theta(1:ndat,:)); 27 co = get(gca,'ColorOrder'); 28 for i=1:size(M.mean_theta,2) 29 ind =1:10:ndat; 30 h=errorbar(ind,M.mean_theta(ind,i),... 31 M.mean_theta(ind,i)-M.lb_theta(ind,i),M.mean_theta(ind,i)-M.ub_theta(ind,i),'.'); 32 set(h,'color',co(i,:)); 33 end 34 23 plotestimates(true_theta, ... 24 M.Est0_apost_mean_theta, ... 25 M.Est0_apost_lb_theta, ... 26 M.Est0_apost_ub_theta); 35 27 set(gca,'YLim',[-1.5,1]); 36 28 37 29 subplot(1,2,2); 38 30 hold off 39 plot(true_R*ones(1,ndat),'-.'); 31 plotestimates(true_R, ... 32 M.Est0_apost_mean_r, ... 33 M.Est0_apost_lb_r, ... 34 M.Est0_apost_ub_r); 35 40 36 title('Variance parameters r') 41 hold on42 plot(M.mean_r(1:ndat,:));43 co = get(gca,'ColorOrder');44 ind =1:10:ndat;45 for i=1:size(M.mean_r, 2)46 h=errorbar(ind,M.mean_r(ind,i),...47 M.mean_r(ind,i)-M.lb_r(ind,i),M.mean_r(ind,i)-M.ub_r(ind,i),'.');48 set(h,'color',co(i,:));49 end -
applications/bdmtoolbox/tutorial/userguide/arx_selection_example.m
r631 r700 1 1 % load data created by the MpdfDS_example 2 load mpdfds_results2 load pdfds_results 3 3 4 4 DS.class = 'MemDS'; … … 30 30 31 31 %%%% Process results 32 lls = [sum(M.A1 ll) sum(M.A2ll) sum(M.A3ll)]32 lls = [sum(M.A1_ll_ll) sum(M.A2_ll_ll) sum(M.A3_ll_ll)] 33 33 34 34 ells=exp(lls-max(lls)); -
applications/bdmtoolbox/tutorial/userguide/epdfds_example.m
r618 r700 12 12 M=simulator(DS,experiment); 13 13 14 M. a14 M.DS_a -
applications/bdmtoolbox/tutorial/userguide/frg_estim.m
r661 r700 17 17 %%%%%% Random walk on frg - Dirichlet 18 18 phi_pdf.class = 'mDirich'; % random walk on coefficient phi 19 phi_pdf.rv = RV( 'phi',2); % 2D random walk - frg is the first element19 phi_pdf.rv = RV({'phi','1_phi'}); % 2D random walk - frg is the first element 20 20 phi_pdf.k = 0.01; % width of the random walk 21 21 phi_pdf.betac = [0.01 0.01]; % stabilizing elememnt of random walk … … 26 26 E.parameter_pdf = phi_pdf; % Random walk is the parameter evolution model 27 27 E.res_threshold = 1.0; % resampling parameter 28 E.n = 20; % number of particles28 E.n = 10; % number of particles 29 29 E.prior.class = 'eDirich'; % prior on non-linear part 30 30 E.prior.beta = [2 1]; % … … 36 36 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 37 % plot results 38 ndat = size(M. u,1);38 ndat = size(M.DS_u,1); 39 39 40 40 figure(1); 41 41 subplot(2,2,1); 42 plotestimates(true_theta, M.MPF mean_theta, M.MPFlb_theta, M.MPFub_theta);42 plotestimates(true_theta, M.MPF_apost_mean_theta, M.MPF_apost_lb_theta, M.MPF_apost_ub_theta); 43 43 title(' Regression parameters \theta') 44 44 set(gca,'YLim',[-1.5,1]); 45 45 46 46 subplot(2,2,2); 47 plotestimates(true_R, M.MPF mean_r,M.MPFlb_r,M.MPFub_r);47 plotestimates(true_R, M.MPF_apost_mean_r,M.MPF_apost_lb_r,M.MPF_apost_ub_r); 48 48 title('Variance parameters r') 49 49 50 50 subplot(2,2,3); 51 plotestimates(1, M.MPF mean_phi(:,1),M.MPFlb_phi(:,1),M.MPFub_phi(:,1));51 plotestimates(1, M.MPF_apost_mean_phi(:,1),M.MPF_apost_lb_phi(:,1),M.MPF_apost_ub_phi(:,1)); 52 52 title('Forgetting factor') 53 53 -
applications/bdmtoolbox/tutorial/userguide/pdfds_example.m
r631 r700 20 20 DS.class = 'MpdfDS'; 21 21 DS.mpdf.class = 'mprod'; 22 DS.mpdf.mpdfs = {fy, epdf2mpdf(fu)};22 DS.mpdf.mpdfs = {fy, fu}; 23 23 DS.init_rv = RVtimes([y,y,y], [-1,-2,-3]); 24 24 DS.init_values = [0.1, 0.2, 0.3]; … … 30 30 31 31 %%% store results 32 Data=[M. y'; M.u'];32 Data=[M.DS_y'; M.DS_u']; 33 33 drv = RVjoin([y,u]); 34 34 true_theta=[fy.A fy.const];