,1)/Ns;   % but this is very unrealistic!

       % accumulate marginal histogram (x_i are exchangeable)
       for i = 1:Ns
           h = hist(Xmode(i,:),xr);
           Px = Px + h*Pmode(i);
       end

   end  % REPLACE_WITH_DASH_DASHREPLACE_WITH_DASH_DASHREPLACE_WITH_DASH_DASHREPLACE_WITH_DASH_DASHREPLACE_WITH_DASH_DASHREPLACE_WITH_DASH_DASHREPLACE_WITH_DASH_DASHREPLACE_WITH_DASH_DASHREPLACE_WITH_DASH_DASHREPLACE_WITH_DASH_DASHREPLACE_WITH_DASH_DASHREPLACE_WITH_DASH_DASHREPLACE_WITH_DASH_DASHRE