are considered equivalent.

![\[fig:discretization\]Asynchronous sensor pulses (a); derived continuous signal using dwell time (b); resulting discrete-time occupancy percentage (c).](discretization)

From this we estimate the occupancy at time $k+1$ using $$\begin{alignedat}{2}{\mathbb{P}\left(\Gamma_{k+1}=1\mid\Gamma_{k}\right)} & = & \Gamma_{k} & {\mathbb{P}\left(\gamma_{k+1}=1\mid\gamma_{k}=1\right)}\\
 &  & +\,(1-\Gamma_{k}) & {\mathbb{P}\left(\gamma_{k+1}=1\mid\gamma_{k}=0\right)}\\
 & = & \Gamma_{k} & {\mathbb{E}\left[p_{k}\right]}+(1-\Gamma_{k}){\mathbb{E}\left[q_{k}\right]},
\end{alignedat}$$ where the expectation operator reflects the fact that $p_{k}$ and $q_{k}$ are estimated via $f_{k}(p_{k})$ and $g_{k}(q_{k})$. At each step $k$, there are four possible state transitions with associated posterior distributions $$\begin{alignedat}{2}\gamma_{k}=1 & \to\gamma_{k+1}=1:\quad & f_{k,j}^{(1)}(p_{k}) & \sim\Phi(p_{k},1)f_{k,j-1}(p_{k}),\\
\gamma_{k}=1 & \to\gamma_{k+1}=0: & f_{k,j}^{(0)}(p_{k}) & \sim\Phi(p_{k},0)f_{k,j-1}(p_{k}),\\
\gamma_{k}=0 & \to\gamma_{k+1}=1: & g_{k,j}^{(1)}(q_{k}) & \sim\Phi(q_{k},1)g_{k,j-1}(q_{k}),\\
\gamma_{k}=0 & \to\gamma_{k+1}=0: & g_{k,j}^{(0)}(q_{k}) & \sim\Phi(q_{k},0)g_{k,j-1}(q_{k}),
\end{alignedat}$$ where $f_{k,j}^{(1)}$ is the updated posterior distribution as if $\gamma_{k}=1$ and $\gamma_{k+1}=1$ had been observed, $f_{k,j}^{(0)}$ is similar to $f_{k,j}^{(1)}$ but updated as if $\gamma_{k+1}=0$ had been observed, and likewise for $g_{k,j}^{(1)}$ and $g_{k,j}^{(0)}$. To obtain $f_{k,j}(p_{k})$, we blend $f_{k,j}^{(1)}(p_{k})$ and $f_{k,j}^{(0)}(p_{k})$ according to the later observation $\Gamma_{k+1}$. We then weight the training according to $\Gamma_{k}$, which reflects how likely the space was to have started occupied; values of $\Gamma_{k}$ closer to one apply more training to $f_{k}(p_{k})$, while those closer to zero cause heavier training of $g_{k}(q_{k})$. The training for $g_{k,j}(q_{k})$ 