\section{Recursive State Estimation}
\label{sec:rse}

We consider indoor localization to be a time-sequential, non-linear and non-Guassian state estimation problem. 
The filtering equation to calculate the posterior is given by the recursion
%
\begin{equation}
	\arraycolsep=1.2pt
	\begin{array}{ll}
		&p(\mStateVec_{t} \mid \mObsVec_{1:t}) \propto\\ 
			&\underbrace{p(\mObsVec_{t} \mid \mStateVec_{t})}_{\text{evaluation}}
			\int \underbrace{p(\mStateVec_{t} \mid \mStateVec_{t-1}, \mObsVec_{t-1})}_{\text{transition}}
			\underbrace{p(\mStateVec_{t-1} \mid \mObsVec_{1:t-1})d\vec{q}_{t-1}}_{\text{recursion}}
	\end{array}
	\enspace ,
	\label{equ:bayesInt}
\end{equation}
%
where $\mStateVec_t$ is the hidden state and $\mObsVec_t$ provides the corresponding observation vector at time $t$.
As realization of \eqref{equ:bayesInt} we use the well-known CONDENSATION particle filter \cite{Isard98:CCD}.
Here, the transition is used as proposal distribution and a resampling step is utilized to handle the phenomenon of weight degeneracy.

The state $\mStateVec$ is given by 
%
\begin{equation}
	\mStateVec = (x, y, z, \mStateHeading),\enskip
	x, y, z, \mStateHeading \in \R \enspace,
\end{equation}
%
where $x, y, z$ represent the position in 3D space and $\mStateHeading$ is the user's current (absolute) heading. 
In context of particle filtering, a particle is thus a weighted representation of one possible state $\mStateVec$.
The observation vector is defined as 
%
\begin{equation}
	\mObsVec = (\mRssiVec_\text{wifi}, \mObsHeading, \mObsSteps, \mObsActivity) \enspace .
\end{equation}
%
Here, $\mRssiVec_\text{wifi}$ contains the signal strength measurements of all \docAP{}s currently visible to the phone. $\mObsHeading$ provides the relative angular change and $\mObsSteps$ the number of steps since the last filter-step.
The result of a simple activity recognition using the phone's barometer and acceleromter is given by $\mObsActivity$, which is one of: "standing", "walking", "walking up" or "walking down". 
