load urn
idep=1

Pi = [];
for i=1:nkeep;
  p             = keep((i-1)*6+1:i*6,:);
  pi            = zeros(7);
  pi(1:5,1:5)   = p(1:5,1:5);
  if idep==1;
    pi(6,1)     = .22*p(6,1);
    pi(7,1)     = .78*p(6,1);
    pi(6,2)     = .57*p(6,2);
    pi(7,2)     = .43*p(6,2);
    pi(6,3)     = .53*p(6,3);
    pi(7,3)     = .47*p(6,3);
    pi(6,4)     = .49*p(6,4);
    pi(7,4)     = .51*p(6,4);
    pi(6,5)     = .56*p(6,5);
    pi(7,5)     = .44*p(6,5);
    pi(1:6,6)   = p(:,6);
    pi(7,6)     = 0.;
    pi(1:5,7)   = p(1:5,6);
    pi(7,7)     = p(6,6)-min(.5,p(6,6));
    pi(6,7)     = min(.5,p(6,6));
  end;
  if idep==2;
    pi(1:6,1:6) = p(1:6,1:6);
    pi(7,7)     = 1.;
  end;
  if idep==3;
    pi(7,1:5)   = p(6,1:5);
    pi(1:5,7)   = p(1:5,6);
    pi(6,6)     = 1.;
    pi(7,7)     = p(6,6);
  end;
  Pi   = [Pi;pi];
end;

diary chains_dep.inp
  disp(nkeep)
  disp(Pi)
diary
