Daniel@0: function CPD = update_params(CPD, ev, counts) Daniel@0: % UPDATE_PARAMS Update the Dirichlet pseudo counts and compute the new MAP param estimates (tabular) Daniel@0: % Daniel@0: % CPD = update_params(CPD, ev) uses the evidence on the family from a single case. Daniel@0: % Daniel@0: % CPD = update_params(CPD, [], counts) does a batch update using the specified suff. stats. Daniel@0: Daniel@0: if nargin < 3 Daniel@0: n = length(ev); Daniel@0: data = cat(1, ev{:}); % convert to a vector of scalars Daniel@0: counts = compute_counts(data(:)', 1:n, mysize(CPD.CPT)); Daniel@0: end Daniel@0: Daniel@0: CPD.prior = CPD.prior + counts; Daniel@0: CPD.CPT = mk_stochastic(CPD.prior);