# Indoor Localization Using Semi-Supervised Manifold Alignment with Dimension Expansion
## 3 Algorithm Description
### Manifold Alignment with Dimension Expansion
\begin{array}{c}\arg\min_{\mathbf{P}_{x},\mathbf{P}_{y}}\{\mathrm{Tr}( \mathbf{P}_{x}{}^{\mathrm{T}}\mathbf{H}\mathbf{H}^{\mathrm{T}}\mathbf{P}_{x}+ \mathbf{P}_{y}{}^{\mathrm{T}}\mathbf{G}\mathbf{G}^{\mathrm{T}}\mathbf{P}_{y}- \mathbf{P}_{x}{}^{\mathrm{T}}\mathbf{H}\mathbf{G}^{\mathrm{T}}\mathbf{P}_{y}- \mathbf{P}_{y}{}^{\mathrm{T}}\mathbf{G}\mathbf{H}^{\mathrm{T}}\mathbf{P}_{x}) +\\ 2\mathrm{Tr}(\mathbf{P}_{x}{}^{\mathrm{T}}\mathbf{H}\mathbf{L}_{x}\mathbf{H}^{ \mathrm{T}}\mathbf{P}_{x})+2\mathrm{Tr}(\mathbf{P}_{y}{}^{\mathrm{T}} \mathbf{G}\mathbf{L}_{y}\mathbf{G}^{\mathrm{T}}\mathbf{P}_{y})\}\end{array}  \tag{6}\]  
\[\mathrm{Let}\ \mathbf{P}=\left( \begin{array}{cc}\mathbf{P}_{x}\\ \mathbf{P}_{y}\end{array} \right),\mathbf{Z}=\left( \begin{array}{cc}\mathbf{ H}&\mathbf{0}\\ \mathbf{0}&\mathbf{G}\end{array} \right)\text{ and }\mathbf{\Omega}=\left( \begin{array}{cc}\mathbf{I}+2\mathbf{L}_{x}&- \mathbf{I}\\ -\mathbf{I}&\mathbf{I}+2\mathbf{L}_{y}\end{array} \right),\text{ where }\mathbf{I}\text{ is a }l\times l\text{ unit matrix. }\]  
Then, we can simply rewrite (6) as:  
\[\arg\min_{\mathbf{P}}\left\{\mathrm{Tr}\left(\mathbf{P}^{\mathrm{T}}\mathbf{Z} \mathbf{\Omega}\mathbf{Z}^{\mathrm{T}}\mathbf{P}\right)\right\} \tag{7}\]  
By applying the scale and translation invariance constrains of the solution to (7), we set \(\mathbf{P}^{\mathrm{T}}\mathbf{Z}\mathbf{Z}^{\mathrm{T}}\mathbf{P}=\mathbf{I}^ {\prime}\) and \(\mathbf{P}^{\mathrm{T}}\mathbf{Z}\mathbf{e}=\mathbf{0}\), where \(\mathbf{I}^{\prime}\) is a \(m\times m\) unit matrix and \(\mathbf{e}\) is a \(2l\times m\) all one matrix. Using the Lagrange multiplier approach, we can construct the Lagrange equation in (8). \[L(\mathbf{P})=\mathbf{P}^{\mathrm{T}}\mathbf{Z}\mathbf{\Omega}\mathbf{Z}^{ \mathrm{T}}\mathbf{P}-\lambda(\mathbf{P}^{\mathrm{T}}\mathbf{Z}\mathbf{Z}^{ \mathrm{T}}\mathbf{P}-\mathbf{I}^{\prime})-\mu\mathbf{P}^{\mathrm{T}}\mathbf{Z} \mathbf{e} \tag{8}\]  
where \(\lambda\) and \(\mu\) are the Lagrange coefficients. Calculating the partial derivative of \(L(\mathbf{P})\) with respect to \(\mathbf{P}\), we obtain:  
\[\frac{\partial L(\mathbf{P})}{\partial\mathbf{P}}=2\mathbf{Z}\mathbf{\Omega} \mathbf{Z}^{\mathrm{T}}\mathbf{P}-2\lambda\mathbf{Z}\mathbf{Z}^{\mathrm{T}} \mathbf{P}-\mu\mathbf{Z}\mathbf{e} \tag{9}\]  
By setting (9) equal to zero, one has:  
\[2\mathbf{Z}\mathbf{\Omega}\mathbf{Z}^{\mathrm{T}}\mathbf{P}-2\lambda\mathbf{Z} \mathbf{Z}^{\mathrm{T}}\mathbf{P}-\mu\mathbf{Z}\mathbf{e}=\mathbf{0} \tag{10}\]  
Meanwhile, by multiplying \(\mathbf{V}\mathbf{P}^{\mathrm{T}}\) to (10), we can have:  
\[\mathbf{V}\mathbf{P}^{\mathrm{T}}(2\mathbf{Z}\mathbf{\Omega}\mathbf{Z}^{ \mathrm{T}}\mathbf{P}-2\lambda\mathbf{Z}\mathbf{Z}^{\mathrm{T}}\mathbf{P})-\mu \mathbf{V}\mathbf{P}^{\mathrm{T}}\mathbf{Z}\mathbf{e}=\mathbf{0} \tag{11}\]  
where \(\mathbf{V}\) is a \(2m\times m\) matrix satisfying \(\mathbf{V}\mathbf{P}^{\mathrm{T}}=\mathbf{I}^{\prime\prime}\) and \(\mathbf{I}^{\prime\prime}\) is a \(2m\times 2m\) unit matrix; we note that \(\mathbf{P}^{\mathrm{T}}\mathbf{Z}\mathbf{e}=\mathbf{0}\); thus, we can obtain:  
\[2\mathbf{Z}\mathbf{\Omega}\mathbf{Z}^{\mathrm{T}}\mathbf{P}-2\lambda\mathbf{Z} \mathbf{Z}^{\mathrm{T}}\mathbf{P}=\mathbf{0} \tag{12}\]  
Let \(\mathbf{Z}\mathbf{\Omega}\mathbf{Z}^{\mathrm{T}}=\mathbf{E}\) and \(\mathbf{Z}\mathbf{Z}^{\mathrm{T}}=\mathbf{M}\). Then, we can rewrite (12) as:  
\[\mathbf{E}\mathbf{P}=\lambda\mathbf{M}\mathbf{P} \tag{13}\]  
Finally, since \(\mathbf{P}^{\mathrm{T}}\mathbf{Z}\mathbf{\Omega}\mathbf{Z}^{\mathrm{T}}\mathbf{P}\)=\(\lambda\mathbf{P}^{\mathrm{T}}\mathbf{Z}\mathbf{Z}^{\mathrm{T}}\mathbf{P}\)=\(\lambda\mathbf{I}^{\prime}\), the solution to (7) is equivalent to the solution of the \(m\) generalized eigenvectors, which are corresponding to the \(m\) non-zero smallest generalized eigenvalues in (13).