## 3 System Overview
### Cell Training Data
#### 3.2.2 Missing Data Imputation  
In a real open space environment, many APs can be scanned, which leads to a high-dimensional fingerprint database. Due to the RSS variability, APs may not be visible in every scan, leading to missing data. Missing data can reduce the statistical power of an investigation and produce biased estimates, leading to invalid conclusions [48]. Before we apply the MVGMM to estimate probabilistic fingerprint distributions for each cell, we need to handle the missing data problem.  
In the case of the missing RSS values from some APs in RSS measurement vectors, the simplest way for imputing missing values is to set a constant, the lowest possible reading or the mean RSS value of each AP [49]. Howeverm this will alter the shape of the distribution and bias the covariance. A scenario may arise when RSS values from certain APs are available in the survey phase but are not observed in the online stage. A common approach is to find the effective APs which are visible in both the training and positioning phase [50]. The system in [51] created RSS reference surfaces for each AP using the Support Vector Regression (SVR) Machine to infer the missing data. Then, during the localisation stage, the measured RSS from each AP will be searched in the corresponding surface. In [52], a multilayer perceptron (MLP) artificial neural network (ANN) with fingerprinting approach has been investigated to handle the problem of missing APs in online matching stage. All the aforementioned approaches neglect the spatial correlation to simplify generation of theoretical RSS datasets for each missing APs in the offline phase, which will result in poorer localisation performance.  
In this paper, we implement the expectation maximisation (EM) algorithm for incomplete data parameter estimation, assuming the missing data mechanism under the missing at random (MAR) assumption. A detailed description of the algorithm can be found in [53; 54; 55].  
The EM algorithm is an iterative process that finds the maximum likelihood estimation (MLE) of the parameters until they converge in the presence of missing data. In general, the E (expectation) step calculates the expectation of the log-likelihood function given the observed data. The M (maximisation) step is to update the new parameters that maximise the expected log-likelihood from the E step. Suppose the complete dataset \(Y\) is partitioned into \(Y=(Y_{obs},Y_{miss})\), where \(Y_{obs}\) represents the observed part of \(Y\), while \(Y_{miss}\) is the missing part. The unknown parameter model \(\theta\) of \(Y\) can be written as:  
\[P(Y|\theta)=P(Y_{obs},Y_{miss}|\theta)=P(Y_{obs}|\theta)P(Y_{miss}|Y_{obs},\theta) \tag{3}\]  
Given an initial guess of \(\theta^{(t)}\), it is possible to calculate the distribution of the missing data \(P(Y_{miss}|Y_{obs},|\theta^{(t)})\). The E step is to calculate the expected complete data log-likelihood ratio \(Q(\theta|\theta^{(t)})\) with respect to the imputation model of missing data.  
\[Q(\theta|\theta^{(t)})=\int\log[p(Y_{obs},Y_{miss}|\theta)]P(Y_{miss}|Y_{obs},\theta^{(t)})dY_{miss} \tag{4}\]  
The M step maximises \(Q(\theta|\theta^{(t)})\) from the previous E step:  
\[Q(\theta^{(t+1)})=\arg\max Q(\theta|\theta^{(t)}) \tag{5}\]  
\begin{table}
\begin{tabular}{c c c} \hline
**Device ID** & **Brand** & **Average Time for One Scan (s)** \\ \hline
1 & Samsung S8 & 2.87 \\
2 & Samsung Galaxy A6 & 3.565 \\
3 & Samsung S3 & 3.665 \\
4 & Samsung S3 & 3.46 \\
5 & Google Pixel & 3.50 \\
6 & Moto G3 & 0.575 \\
7 & Huawei Mate 7 & 2.55 \\
8 & Oneplus 1 & 3.06 \\
9 & LG G4 & 3.355 \\ \hline \end{tabular}
\end{table}
Table 1: Device specification.