function [scaledpix, maxlog] = mixtureScaledPiX(X, compParams)
  logpix = zeros(size(X,1),length(compParams));
  for i=1:length(compParams)
    logpix(:,i) = logmultigaussian(X, compParams(i).mean, compParams(i).cov) ...
	+ log(compParams(i).prior);
  end
  maxlog = max(logpix,[],2);
  scaledpix = exp(op(logpix,'-',maxlog));
  
