Strongly Correlated Variables in a Bayesian View Reading about bayesian graphical models, I have come up with an example that I don't really know how to best adress. Let me start with some prose on what I am thinking about, and then get to the problem of how to infer.
Suppose you have meeting room in an office building. There is a sign at the door, that users of this meeting room can flip to "occupied" if they are using the room for a meeting, and "free", if they are not using the room. A typical problem is. This works most of the times, but every now and then, people forgot to flip the sign either when they left the room (so the room is free, but the sign says occupied) or the other way around.
Representing an occupied room by $R=0$ and a free room by $R=1$, and a sign for an occupied room by $S=0$ and a sign for a free room by $S=1$. I think the inference problem boils down to finding $\Pr(R|S, r_0, s_0, r_1, s_1, \ldots r_N, s_N)$. with $r_i$, $s_i$  for $i <N$ being past observations of the situation.
Aproaches to Solving
My first thoughts were, that probably the individual observations of $(r_i, s_i)$ pairs are conditionally independent, which could mean, that we could find some factorization when applying Bayes rule. However, I am a bit unsure on how this problem could be approached and solved.
$$\Pr(R|S, r_0, s_0, r_1, s_1, \ldots r_N, s_N)\propto \Pr(S, r_0, s_0, r_1, s_1, \ldots r_N, s_N|R)\Pr(R) = \Pr(S|R) \cdot \left(\Pi_{i=0}^N \Pr (r_i, s_i)\right)\Pr(R)$$
In that case, I would still be unsure on how to model $\Pr(S|R)$. Especially since they would be strongly correlated. The physicist in me would mix $\alpha\cdot\delta(s-r) + \beta\cdot f(s,r) $ pdf, but I don't know if this is a good approach.
One other idea I had was, that one needed to model a latent variable representing the tendency to err of a room user.
Any ideas?
 A: The following framework can be used to address the question.
There are four possible combinations of $r_i$ and $s_i$: 
\begin{equation}
(r_i,s_i) \in \Omega = \{(0,0),\,(0,1),\,(1,0),\,(1,1)\}
\end{equation}
We can express the joint distribution as
\begin{equation}
p(r_i = j, s_i = k|\theta) = \theta_{jk} \qquad \text{for $(j,k) \in \Omega$} .
\end{equation}
where $\theta = (\theta_{00},\theta_{01},\theta_{10},\theta_{11})$ and
\begin{equation}
\theta_{00} + \theta_{01} + \theta_{10} + \theta_{11} = 1 .
\end{equation}
With this setup, the conditional distribution is 
\begin{equation}
p(r_i=j|s_i=k) = \frac{p(r_i=j,s_i=k)}{p(s_i=k)} = \frac{\theta_{jk}}{\theta_{0k} + \theta_{1k}} .
\end{equation} 
However, we do not know the value of $\theta$.
Now suppose we have the following observations: $y_{1:n} = (y_1, \ldots, y_n)$ where $y_i = (r_i, s_i) \in \Omega$ and $p(y_i=(j,k)|\theta) = \theta_{jk}$. Using the observations, the likelihood is given by
\begin{equation}
p(y_{1:n}|\theta) = \prod_{i=1}^n p(y_i|\theta) = \theta_{00}^{c_{00}}\, \theta_{01}^{c_{01}}\, \theta_{10}^{c_{10}}\, \theta_{11}^{c_{11}}
\end{equation}
where $c_{jk}$ is the number of times $y_i = (j,k)$ occurs in $y_{1:n}$. Note $c_{00} + c_{01} + c_{10} + c_{11} = n$. 
Let the prior for $\theta$ be Dirichlet:
\begin{equation}
p(\theta) = \textsf{Dirichlet}(\theta|\alpha) \propto \theta_{00}^{\alpha_{00}-1}\, \theta_{01}^{\alpha_{01}-1}\, \theta_{10}^{\alpha_{10}-1}\, \theta_{11}^{\alpha_{11}-1},
\end{equation}
where $\alpha = (\alpha_{00},\alpha_{01},\alpha_{10},\alpha_{11})$. Then the posterior distribution is
\begin{equation}
p(\theta|y_{1:n}) = \textsf{Dirichlet}(\theta|\alpha+c) \propto \theta_{00}^{\alpha_{00}+c_{00}-1}\, \theta_{01}^{\alpha_{01}+c_{01}-1}\, \theta_{10}^{\alpha_{10}+c_{10}-1}\, \theta_{11}^{\alpha_{11}+c_{11}-1} .
\end{equation}
The mean of this distribution is characterized by
\begin{equation}
E[\theta_{jk}|y_{1:n}] = \frac{\alpha_{jk}+c_{jk}}{A+ n} ,
\end{equation}
where $A= \alpha_{00}+\alpha_{01}+\alpha_{10}+\alpha_{11}$. 
We can approximate the conditional distribution using posterior expectations:
\begin{equation}
\theta_{j|k} \approx \frac{E[\theta_{jk}|y_{1:n}]}{E[\theta_{0k}|y_{1:n}]+E[\theta_{1k}|y_{1:n}]} = \frac{\alpha_{jk} + c_{jk}}{\alpha_{0k}+c_{1k} + \alpha_{0k} + c_{1k}} .
\end{equation}
The fully Bayesian approach would involve integrating out the posterior uncertainty in $\theta_{j|k}$ directly, obtaining a $\textsf{Multinomial-Dirichlet}$ distribution. 
