pmi=0.5;
pmit=[0.8,0.4,0.8,0.8,0.8;0.8,0.8,0.4,0.4,0.8;0.4,0.4,0.4,0.4,0.4;0.4,0.8,0.4,0.8,0.4]
pmiz=[]
pmizOdds=[]
pmizLogs=[]
for j=1:size(pmit,1)
    pmizl=pmit(j,1);
    for i = 2:size(pmit,2)
        pmizc= 1/(1+((1-pmit(j,i))/(pmit(j,i))*(1-pmizl)/(pmizl)* pmi/(1-pmi)));
        pmizl= pmizc;
    end
    pmiz(j)=pmizl;
end
pmiz

for j=1:size(pmit,1)
    pmizl=pmit(j,1)/(1-pmit(j,1));
    for i = 2:size(pmit,2)
        pmizc= (pmizl)*(pmit(j,i))/(1-pmit(j,i))* (1-pmi)/(pmi);
        pmizl= pmizc;
    end
    pmizOdds(j)=pmizl;
end
pmizOdds

for j=1:size(pmit,1)
    pmizl=log(pmit(j,1)/(1-pmit(j,1)));
    for i = 2:size(pmit,2)
        pmizc= (pmizl)+log(pmit(j,i))-log(1-pmit(j,i))+ log(1-pmi)-log(pmi);
        pmizl= pmizc;
    end
    pmizLogs(j)=pmizl;
end
pmizLogs