function value = Q(D,postprob,CC,prior)

option = 0;

[N,M] = size(D);

LogLike = LogLikeGivenCC(D,CC,option) + repmat(log(prior),[N,1]);

value = sum(sum(LogLike.*postprob));

