function [t0,p0]=DAmix(x) % Data augmentation algorithm (see Liu p 134 ) applied to a normal variance mixture with % 2 components % test using load missing2; [t,p]=DAmix(z); %e.g. [t,p1]=DAmix(normmixrnd(50,[0 0],[1 3],[2/3 1/3])); t=[.000072 .000225]; % preliminary estimates of the variance of the two components p1=.81; t0=[]; p0=[];% preliminary estimates of the two probabilities f1=normpdf(x,0,sqrt(t(1))); f2=normpdf(x,0,sqrt(t(2))); w=(f1+(1/p1-1)*f2); w=f1./max(w,.000001); delta=(abs(x)