I have a vector $x$ of random variables and a finite set of classes $C$. Also $x$ has to belong to one class. In the context of classification problems I have the transformation
$P(x) = P(x|c_1)P(c_1) + P(x|c_2)P(c_2) \ \cdots P(x|c_n)P(c_n)= \sum_{c \in C}P(x|c)P(c)$
Why is this equality true?
Thank you very much!
In this answer $X$ stands for a random vector and $x$ is one of the values that it can take. I am not sure whether this meets your question (as my comment makes clear).
Maybe it will be of help anyhow. If not then let me know. In that case I will delete it.
Formally $P\left(X=x\mid c_{i}\right)P\left(c_{i}\right)=P\left(X=x\wedge c_{i}\right)$ where $c_{i}$ stands for the event that $X$ belongs to class $i$.
Then $P\left(X=x\mid c_{1}\right)P\left(c_{1}\right)+\cdots+P\left(X=x\mid c_{n}\right)P\left(c_{n}\right)=P\left(X=x\wedge c_{1}\right)+\cdots+P\left(X=x\wedge c_{n}\right)$
Also $P\left(X=x\right)=P\left(\left[X=x\wedge c_{1}\right]\vee\cdots\vee\left[X=x\wedge c_{n}\right]\right)=P\left(X=x\wedge c_{1}\right)+\cdots+P\left(X=x\wedge c_{n}\right)$
This because $X$ must belong to exactly one class.
So LHS of first equality equals LHS of second equality.