Suppose we have the following Bayesian net (or a probabilistic graphical model):
$L \rightarrow X \leftarrow F$, i.e. $P(L,X,F) = P(X|L,F)P(L)P(F)$ and all of these probabilities are known.
Let $\delta(x)$ be a decision rule: given a $x$ it outputs the value of $L$ with the highest posterior. $\delta(x) = \rm{argmax}_\ell P(L=\ell|x)$.
I want to compute the value of $F$ which maximizes the probability of giving a correct decision:
$\rm{argmax}_f \;\;P(\delta(X)=L | F=f) =?$
I'm confused on how to proceed from here. The fact that the decision rule uses the prior probability of L confuses me. So,
$ P(\delta(X)=L | F=f) = \sum_{i=1}^N P(\delta(x)=i | F=f, L=i) P(L=i|F=f)$
In the first term (right handside), the event $L=i$ is given, so in that case, how can $\delta(x)$ function correctly?
I'm either formulating the objective wrongly, or there are some problems with my notation. Any leads, hints will be highly appreciated.