I'm trying to create a Bayes classificator in 1 dimension with 3 classes. I have created the following graph, where you can see that from zero to $x_{bnd1}$ is the first area $R1$, then from $x_{bnd1}$ to $x_{bnd2}$ is $R2$ and finally $R3$, from $x_{bnd2}$ to one.
My problem is, how do I integrate in order to find the error?
Take for example the first area $R1$ where the accepted class is $ω_{1}$. The error here, I think, will be the following :
$$P\left(\omega_2 \right) \int \limits_{R_1}p\left( x |\omega_2 \right) dx + P\left(\omega_3 \right) \int \limits_{R_1}p\left( x |\omega_3 \right)dx\\$$
However, I'm not sure that this is correct. By doing this, I add the area below the red line two times, aren't I? Or is it ok to add it 2 times because it's 2 different errors?
(Of course the error will have more terms related to areas $R2, R3$, where the same problem occurs.)
In case someone wonders, the conditional pdfs I have are $$ p(x|\omega_1)=1 $$ $$p(x|\omega_2)=6x(1-x)$$ $$p(x|\omega_3)=2x$$ and the prior probabilities of the classes are $P(\omega_1)=1/6, P(\omega_2)=1/3$ and $P(\omega_3)=1/2$.
Sorry if my thoughts are a bit jumbled.. Thanks in advance.