Hi @tom. Thank you for your reply!
Do you mean that I should write the expression for the log of p directly, instead of computing p and then applying log() to p? That seems a good idea, I will check if that works.
EDIT: After thinking a bit, that does not seem to be useful when I have more than one Gaussian component. Suppose that my Gaussian mixture has two components. Then, p is given by:
p = a0exp(b0(x-u0)^2) + a1exp(b1(x-u1)^2)
where a0, b0, a1 and b1 are some constants and u0 and u1 are the means. If we apply log() to p, there is no obvious way to simplify the expression, since we get the logarithm of a sum…