Abstract: In the era of big data, reducing data dimensionality is critical in many areas of science. Widely used Principal Component Analysis (PCA) addresses this problem by computing a low dimensional data embedding that maximally explain variance of the data. However, PCA has two major weaknesses. Firstly, it only considers linear correlations among variables (features), and secondly it is not suitable for categorical data. We resolve these issues by proposing Maximally Correlated Principal Component Analysis (MCPCA). MCPCA computes transformations of variables whose covariance matrix has the largest Ky Fan norm. Variable transformations are unknown, can be nonlinear and are computed in an optimization. MCPCA can also be viewed as a multivariate extension of Maximal Correlation. For jointly Gaussian variables we show that the covariance matrix corresponding to the identity (or the negative of the identity) transformations majorizes covariance matrices of non-identity functions. Using this result we characterize global MCPCA optimizers for nonlinear functions of jointly Gaussian variables for every rank constraint. For categorical variables we characterize global MCPCA optimizers for the rank one constraint based on the leading eigenvector of a matrix computed using pairwise joint distributions. For a general rank constraint we propose a block coordinate descend algorithm and show its convergence to stationary points of the MCPCA optimization. We compare MCPCA with PCA and other state-of-the-art dimensionality reduction methods including Isomap, LLE, multilayer autoencoders (neural networks), kernel PCA, probabilistic PCA and diffusion maps on several synthetic and real datasets. We show that MCPCA consistently provides improved performance compared to other methods.

\section{Introduction}\label{sec:intro}
Let $X_1$ and $X_2$ be two mean zero and unit variance random variables. Pearson's correlation \cite{pearson1895note} defined as
\begin{align}\label{eq:corr}
\rho_{Pearson}(X_1,X_2)=\mathbb{E}[X_1 X_2]
\end{align}
is a basic statistical parameter and plays a central role in many statistical and machine learning methods such as linear regression \cite{neter1996applied}, principal component analysis \cite{jolliffe2002principal}, and support vector machines \cite{steinwart2008support}, partially owing to its simplicity and computational efficiency. Pearson's correlation however has two main weaknesses: firstly it only captures linear dependency between variables, and secondly for discrete (categorical) variables the value of Pearson's correlation depends somewhat arbitrarily on the labels. To overcome these weaknesses, {\it Maximal Correlation} (MC) has been proposed and studied by Hirschfeld \cite{hirschfeld1935connection}, Gebelein \cite{gebelein1941statistische}, Sarmanov \cite{sarmanov1962maximum} and R\'enyi \cite{renyi1959measures}, and is defined as
\begin{align}\label{eq:mc}
\rho_{MC}(X_1, X_2)=
	\sup_{\phi_1(.), \phi_{2}(.)}\ &\mathbb{E}[\phi_1(X_1)\ \phi_{2}(X_{2})],\\
& \mathbb{E}[\phi_i(X_i)]=0,\quad i=1,2,\nonumber\\
& \mathbb{E}[\phi_i(X_i)^2]=1,\quad i=1,2.\nonumber
\end{align}
Transformation functions $\{\phi_i(.)\}_{i=1}^{2}$ are assumed to be Borel measurable whose ranges are in $\mathbb{R}$. MC has also been studied by Witsenhausen \cite{witsenhausen1975sequences}, Ahlswede and G\'acs \cite{ahlswede1976spreading}, and Lancaster \cite{lancaster1957some}. MC tackles the two main drawbacks of the Pearson's correlation: it models a family of nonlinear relationships between the two variables. For discrete variables, the MC value only depends on the joint distribution and does not rely on labels. Moreover the MC value between $X_1$ and $X_2$ is zero iff they are independent \cite{renyi1959measures}.

For the multivariate case with variables $X=(X_1$,...,$X_p)^T$ where $p\geq 2$, Pearson's correlation can be extended naturally to the covariance matrix $\mathbf{K}_X \in \mathbb{R}^{p\times p}$ where $\mathbf{K}_X(i,i')=\mathbb{E}[X_i X_{i'}]$ (assuming $X_i$ has zero mean and unit variance). Similarly to the bivariate case, the covariance matrix analysis suffers from two weaknesses of only capturing linear dependencies among variables and being label dependent when variables are discrete (categorical). One way to extend the idea of MC to the multivariate case is to consider the set of covariance matrices of transformed variables. Let $\phi(X)=(\phi_1(X_1),...,\phi_p(X_p))^T$ be the vector of transformed variables with zero means and unit variances. I.e., $\mathbb{E}[\phi_i(X_i)]=0$ and $\mathbb{E}[\phi_i(X_i)^2]=1$ for $1\leq i\leq p$. Let $\mathbf{K}_{\phi(X)}\in \mathbb{R}^{p\times p}$ be the covariance matrix of transformed variables $\phi(X)$ where $\mathbf{K}_{\phi(X)}(i,i')=\mathbb{E}[\phi_i(X_i) \phi_{i'}(X_{i'})]$. The set of covariance matrices of transformed variables is defined as follows:

\begin{align}\label{eq:MC-covariance-set}
\mathcal{K}_{X}\triangleq \Big\{\mathbf{K}_{\phi(X)}\in \mathbb{R}^{p\times p}:~\mathbb{E}[\phi_i(X_i)]=0,~\mathbb{E}[\phi_i(X_i)^2]=1,~ 1\leq i,i'\leq p \Big\}.
\end{align}

Similarly to the bivariate case, functions $\{\phi_i(.)\}_{i=1}^p$ are assumed to be Borel measurable whose ranges are in $\mathbb{R}$. If variables $\{X_i\}_{i=1}^{p}$ are continuous, functions $\{\phi_i(.)\}_{i=1}^{p}$ are assumed to be continuous. The set $\mathcal{K}_{X}$ includes infinitely many covariance matrices corresponding to different transformations of variables. In order to have an operational extension of MC to the multivariate case, we need to select one (or finitely many) members of $\mathcal{K}_{X}$ through an optimization.

\begin{figure}
\centering
  \includegraphics[width=0.8\linewidth]{Fig1-new3.pdf}
\caption{An illustration of the Maximally Correlated Principal Component Analysis (MCPCA) Framework. MCPCA computes transformations of features $\phi_i(X_i)$ so that variance of the transformed data can be explained maximally by a few meta features. Feature transformations are unknown, can be nonlinear and are computed in an optimization.}
\label{fig:MCPCA}
\end{figure}

Here we propose the following optimization over $\mathcal{K}_{X}$ that aims to select a covariance matrix $\mathbf{K}^*\in \mathcal{K}_{X}$ with the maximum $q$-Ky Fan norm (i.e., with the maximum sum of top $q$ eigenvalues):
\begin{align}\label{opt:MCPCA-main}
\max_{\mathbf{K}}\quad & \sum_{r=1}^{q} \lambda_r(\mathbf{K})\\
& \mathbf{K}\in \mathcal{K}_{X}.\nonumber
\end{align}
Since the trace of all matrices in $\mathcal{K}_{X}$ is equal to $p$, maximizing the Ky Fan norm over $\mathcal{K}_{X}$ results in a low rank or an approximately low rank covariance matrix. We refer to this optimization as {\it Maximally Correlated Principal Component Analysis} with parameter $q$ or for simplicity, the MCPCA optimization. The optimal MCPCA value is denoted by $\rho_q^*(X)$. When no confusion arises we use $\rho_q^*$ to refer to it.

Principal Component Analysis (PCA) \cite{jolliffe2002principal} aims to find $q$ eigenvectors corresponding to the top eigenvalues of the covariance matrix. These are called Principal Components (PCs). On the other hand, we show that the MCPCA optimization aims to find possibly nonlinear transformations of variables that can be approximated optimally by $q$ orthonormal vectors. Thus, MCPCA can be viewed as a generalization of PCA over possibly nonlinear transformations of variables with zero means and unit variances.

We summarize our main contributions below:
\begin{itemize}
  \item We introduce MCPCA as a multivariate extension of MC and a generalization of PCA.
  \item   For jointly Gaussian variables we show that the covariance matrix corresponding to the identity (or the negative of the identity) transformations majorizes covariance matrices of non-identity functions. Using this result we characterize global MCPCA optimizers for nonlinear functions of jointly Gaussian variables for every $q$.
  \item For finite discrete variables,
  \begin{itemize}
    \item [-] we compute a globally optimal MCPCA solution when $q=1$ based on the leading eigenvector of a matrix computed using pairwise joint distributions.
    \item [-] for an arbitrary $q$ we propose a block coordinate descend algorithm and show its convergence to stationary points of the MCPCA optimization.
  \end{itemize}
\item We study the consistency of sample MCPCA (an MCPCA optimization computed using empirical distributions) for both finite discrete and continuous variables.
\end{itemize}

We compare MCPCA with PCA and other state-of-the-art nonlinear dimensionality reduction methods including Isomap \cite{isomap}, LLE \cite{LLE}, multilayer autoencoders (neural networks) \cite{lee2007nonlinear,hinton2006reducing}, kernel PCA \cite{scholkopf1997kernel,scholkopf1998nonlinear,hoffmann2007kernel,mika1998kernel}, probabilistic PCA \cite{roweis1998algorithms} and diffusion maps \cite{lafon2006diffusion} on several synthetic and real datasets. Our real dataset experiments include breast cancer, Parkinson’s disease, diabetic retinopathy, dermatology, gene splicing and adult income datasets. We show that MCPCA consistently provides improved performance compared to other methods.

\subsection{Prior Work}\label{subsec:prior}
MCPCA can be viewed as a dimensionality reduction method whose goal is to find possibly nonlinear transformations of variables with a low rank covariance matrix. Other nonlinear dimensionality reduction methods include manifold learning methods such as Isomap \cite{isomap}, Locally Linear Embedding (LLE) \cite{LLE}, kernel PCA  \cite{scholkopf1997kernel,scholkopf1998nonlinear,hoffmann2007kernel,mika1998kernel}, maximum variance unfolding \cite{weinberger2004learning}, diffusion maps \cite{lafon2006diffusion}, Laplacian eigenmaps \cite{belkin2001laplacian}, Hessian LLE \cite{donoho2003hessian}, Local tangent space analysis \cite{zhang2004principal}, Sammon mapping \cite{sammon1969nonlinear}, multilayer autoencoders \cite{lee2007nonlinear,hinton2006reducing}, among others. For a comprehensive review of these methods, see reference \cite{van2009dimensionality}. Although these techniques show an advantage compared to PCA in artificial datasets, their successful applications to real datasets have been less convincing \cite{van2009dimensionality}. The key challenge is to have an appropriate balance among generality of the model, computational complexity of the method and statistical significance of inferences.

MCPCA is more general than PCA since it considers both linear and nonlinear feature transformations. In kernel PCA methods, transformations of variables are {\it fixed} in advance. This is in contrast to MCPCA that optimizes over transformations resulting in an optimal low rank approximation of the data. Manifold learning methods such as Isomap and LLE aim to find a low dimensional representation of the data such that sample distances in the low dimensional space are the same, up to a scaling, to sample geodistances (i.e., distances over the manifold), assuming there exists such a manifold that the data lies on. These methods can be viewed as extensions of PCA fitting a nonlinear model to the data. Performance of these methods has been shown to be sensitive to noise and model parameters \cite{van2009dimensionality}. Through experiments on several synthetic and real datasets we show that the performance of MCPCA is robust against these factors. Note that MCPCA allows features to be transformed only individually, thus avoiding a combinatorial optimization and resulting in statistically significant inferences. However because of this MCPCA cannot capture low dimensional structures such as the swiss roll example since underlying transformation depend on pairs of variables.

Unlike existing dimensionality reduction methods that are only suitable for data with continuous features, MCPCA is suitable for both categorical and continuous data. The reason is that even if the data is categorical, transformed values computed by MCPCA are real. Moreover we compare computational and memory complexity of MCPCA and manifold learning methods (Isomap and LLE) in Remark \ref{remark:complexity}. Unlike Isomap and LLE methods whose computational and memory complexity scales in a quadratic or cubic manner with the number of samples, computational and memory complexity of the MCPCA algorithm scales linearly with the number of samples, making it more suitable for data sets with large number of samples.

MCPCA can be viewed as a multivariate extension of MC. Other extensions of MC to the multivariate case have been studied in the literature. For example, reference \cite{feizi2015network} introduces an optimization over $\mathcal{K}_{X}$ that aims to maximize sum of arbitrary chosen elements of the matrix $\mathbf{K}\in \mathcal{K}_{X}$. \cite{feizi2015network} shows that this optimization can be useful in nonlinear regression and graphical model inference. Moreover, \cite{feizi2015network} provides an algorithm to find local optima of the proposed optimization. Reference \cite{beigi2015duality} introduces another optimization that aims to select a covariance matrix whose minimum eigenvalue is maximized. \cite{beigi2015duality} briefly discuses computational and operational aspects of the proposed optimization.

\subsection{Notation}\label{sec:notation}
For matrices we use bold-faced upper case letters, for vectors we use bold-faced lower case letters, and for scalars we use regular lower case letters. For random variables we use regular upper case letters. For example, $\mathbf{X}$ represents a matrix, $\mathbf{x}$ represents a vector, $x$ represents a scalar number, and $X$ represents a random variable. $I_{n}$ and $1_{n}$ are the identity and all one matrices of size $n\times n$, respectively. When no confusion arises, we drop the subscripts. $\mathbf{1}\{x=y\}$ is the indicator function which is equal to one if $x=y$, otherwise it is zero. $Tr(\mathbf{X})$ and $\mathbf{X}^T$ represent the trace and the transpose of the matrix $\mathbf{X}$, respectively. $diag(\mathbf{x})$ is a diagonal matrix whose diagonal elements are equal to $\mathbf{x}$, while $diag(\mathbf{X})$ is a vector of the diagonal elements of the matrix $\mathbf{X}$. $\|\mathbf{x}\|_{2}=\mathbf{x}^T \mathbf{x}$ is the second norm of the vector $\mathbf{x}$. When no confusion arises, we drop the subscript. $||\mathbf{X}||$ is the operator norm of the matrix $\mathbf{X}$. $<\mathbf{x},\mathbf{y}>$ is the inner product between vectors $\mathbf{x}$ and $\mathbf{y}$. $\mathbf{x} \perp \mathbf{y}$ indicates that vectors $\mathbf{x}$ and $\mathbf{y}$ are orthogonal. The matrix inner product is defined as $<\mathbf{X},\mathbf{Y}>=Tr(\mathbf{X} \mathbf{Y}^T)$.

The eigen decomposition of the matrix $\mathbf{X}\in\mathbb{R}^{n\times n}$ is denoted by $\mathbf{X}=\sum_{i=1}^{n} \lambda_i(\mathbf{X}) \mathbf{u}_i(\mathbf{X}) \mathbf{u}_i(\mathbf{X})^T$, where $\lambda_i(\mathbf{X})$ is the $i$-th largest eigenvalue of the matrix $\mathbf{X}$ corresponding to the eigenvector $\mathbf{u}_i(\mathbf{X})$. We have $\lambda_1(\mathbf{X})\geq \lambda_2(\mathbf{X})\geq \cdots$. $\lambda(\mathbf{X})=(\lambda_1(\mathbf{X}),\lambda_2(\mathbf{X}),\cdots)^T$. $\mathbf{u}_i(\mathbf{X})$ has a unit norm. Similarly the singular value decomposition of the matrix $\mathbf{Y}\in \mathbb{R}^{n\times m}$ is denoted by $\mathbf{Y}=\sum_{i=1}^{min(n,m)} \sigma_{i}(\mathbf{Y}) \mathbf{u}_i(\mathbf{Y}) \mathbf{v}_i(\mathbf{Y})^T$ where $\sigma_i(\mathbf{Y})$ is the $i$-th largest singular value of the matrix $\mathbf{Y}$ corresponding to the left and right singular eigenvectors $\mathbf{u}_i(\mathbf{Y})$ and $\mathbf{v}_i(\mathbf{Y})$, respectively. We have $\sigma_1(\mathbf{Y})\geq \sigma_2(\mathbf{Y})\geq \cdots$. $\sigma(\mathbf{Y})=(\sigma_1(\mathbf{Y}),\sigma_2(\mathbf{Y}),\cdots)^T$. $\mathbf{u}_i(\mathbf{Y})$ and $\mathbf{v}_i(\mathbf{Y})$ are unit norm vectors.

\section{MCPCA: Basic Properties and Relationship with Matrix Majorization}\label{sec:properties}
\subsection{Basic Properties of MCPCA}\label{sec:properties}
In reference \cite{renyi1959measures}, R\'enyi shows that MC between the two variables $X_1$ and $X_2$ is zero iff they are independent, while MC is one iff the two variables are strictly dependent (i.e., there exist mean zero, unit variance transformations of variables that are equal.). Here we study some of these properties for the multivariate case of MCPCA:

\begin{theorem}\label{thm:prop-MCPCA}
 Let $\rho_q^*$ be the optimal MCPCA value for random variables $X_1$,...,$X_p$.
\begin{itemize}
  \item [(i)] $1\leq \rho_q^*\leq p$, for $1\leq q\leq p$.
  \item [(ii)] $\rho_1^*=1$ iff $X_i$ and $X_{i'}$ are independent, for $1\leq i\neq i'\leq p$.
  \item [(iii)] $\rho_1^*=p$ iff $X_1$,...,$X_p$ are strictly dependent. I.e., there exist zero mean, unit variance transformation functions $\{\phi_i(.)\}_{i=1}^{p}$ such that for all $1\leq i,i'\leq p$, $\phi_i(X_i)=\phi_{i'}(X_{i'})$.
  \item [(iv)] If $\{\phi_i(.)\}_{i=1}^{p}$ are one-to-one transformation functions, $\rho_q^*(X)=\rho_q^*(\phi(X))$.
\end{itemize}
 \end{theorem}
\begin{proof}
To prove part (i), for any $\mathbf{K}\in \mathcal{K}_{X}$, we have $Tr(\mathbf{K})=\sum_{r=1}^{p} \lambda_r(\mathbf{K})=p$ because $\phi_i(X_i)$ has zero mean and unit variance for $1\leq i\leq p$. Moreover, since $\lambda_1(\mathbf{K})\geq \lambda_2(\mathbf{K})\geq \dots \lambda_p(\mathbf{K})\geq 0$, we have $\lambda_1(\mathbf{K})\geq 1$. Thus, $1\leq \rho_q^*\leq p$, for $1\leq q\leq p$. This completes the proof of part (i).

To prove part (ii), suppose $\lambda_1(\mathbf{K}^*)=1$. Thus, for every $\mathbf{K}\in \mathcal{K}_{X}$, we have $1\geq \lambda_1(\mathbf{K})\geq \lambda_2(\mathbf{K})\geq \dots \lambda_p(\mathbf{K})\geq 0$. However since the sum of all eigenvalues are equal to $p$, we have $\lambda_i(\mathbf{K})=1$ for every $\mathbf{K}\in \mathcal{K}_{X}$ and $1\leq i\leq p$. Therefore, $\mathbf{K}=I_p$ for every $\mathbf{K}\in \mathcal{K}_{X}$. This means $\rho_{MC}(X_i,X_{i'})=0$, for $1\leq i\neq i'\leq p$, which indicates that $X_i$ and $X_{i'}$ are independent \cite{renyi1959measures}. To prove the other direction of part (ii), if $X_i$ and $X_{i'}$ are independent, for every zero mean and unit variance functions $\phi_i(.)$ and $\phi_{i'}(.)$, we have $\mathbb{E}[\phi_i(X_i) \phi_i(X_i)]=0$ \cite{renyi1959measures}. Thus, for every $\mathbf{K}\in \mathcal{K}_{X}$, we have $\mathbf{K}=I_p$. This completes the proof of part (ii).

To prove part (iii), let $\rho_1^*=p$. Thus, $1_{p} \in \mathcal{K}_{X}$. It means that there exist transformation functions $\{\phi_i^*\}_{i=1}^{p}$ with zero means and unit variances such that for all $1\leq i,i'\leq p$, $\mathbb{E}[\phi_i^*(X_i)\phi_{i'}^*(X_{i'})]=1$. It means that for $1\leq i\leq p$, $\phi_i^*(X_i)=Y$ where $Y$ has zero mean and unit variance. The proof of the inverse direction is straightforward. This completes the proof of part (iii).

To prove part (iv), we note that if $\{\phi_i(.)\}_{i=1}^{p}$ are one-to-one transformations, $\mathcal{K}_{X}=\mathcal{K}_{\phi(X)}$. Thus, $\rho_q^*(X)=\rho_q^*(\phi(X))$. This completes the proof of part (iv).
\end{proof}

In the following proposition, we show that the increase ratio of the optimal MCPCA value (i.e., $\rho_{q+1}^*/\rho_q^*-1$) is bounded above by $1/q$ which decreases as $q$ increases.

\begin{proposition}\label{prop:submodular-increase}
Let $\rho_q^*$ be the optimal MCPCA value for random variables $X_1$,...,$X_p$. We have
\begin{align}\label{eq:submodular-increase}
\rho_q^* \leq \rho_{q+1}^* \leq (1+\frac{1}{q})\rho_q^*
\end{align}
\end{proposition}
\begin{proof}
Let $\mathbf{K}^*$ be an optimal MCPCA solution for $q+1$. Since $\rho_q^*$ is an optimal MCPCA value with parameter $q$, we have
\begin{align}\label{eq:inequality-submodular}
\sum_{r\in\{1,2,...,q+1\}-\{j\}} \lambda_r(\mathbf{K}^*) \leq \rho_q^*,\quad \forall j\in\{1,...,q+1\}.
\end{align}
By summing \eqref{eq:inequality-submodular} over all $j\in\{1,...,q+1\}$, we have $q \rho_{q+1}^*\leq (q+1) \rho_q^*$. This completes the proof.
\end{proof}
\subsection{Relationship between MCPCA and Matrix Majorization}\label{subsec:majorization}
A vector $\mathbf{x}=(x_1,x_2,\cdots,x_p)^T\in\mathbb{R}^p$ {\it weakly majorizes} vector $\mathbf{y}=(y_1,y_2,\cdots,y_p)^T$ (in symbols, $\mathbf{x}\succ_w \mathbf{y}$) if $\sum_{r=1}^{q}x_{[r]}\geq \sum_{r=1}^{q}y_{[r]}$, for all $1\leq q\leq p$. The symbols $x_{[1]}\geq x_{[2]}\geq \cdots \geq x_{[p]}$ stand for the elements of the vector $\mathbf{x}$ sorted in a decreasing order. If $\mathbf{x}\succ_w \mathbf{y}$ and $\sum_{r=1}^{p} x_{r}=\sum_{r=1}^{p} y_{r}$, then we say vector $\mathbf{x}$ {\it majorizes} vector $\mathbf{y}$ and denote it by $\mathbf{x}\succ \mathbf{y}$.

Let $\mathbf{A}$ and $\mathbf{B}$ be two Hermitian matrices in $\mathbb{R}^{p\times p}$. We say $\mathbf{A}$ majorizes $\mathbf{B}$ is $\lambda(\mathbf{A})\succ \lambda(\mathbf{B})$. We have the following equivalent formulation for matrix majorization that we will use in later parts of the paper.
\begin{lemma}\label{lem:unitary-eq}
The following conditions for Hermitian matrices $\mathbf{A}$ and $\mathbf{B}$ are equivalent:
\begin{itemize}
\item $\mathbf{A}\prec \mathbf{B}$
\item There exist unitary matrices $\mathbf{U}_j$ and positive numbers $t_j$ such that
\begin{align}
\mathbf{A}=\sum_{j=1}^{N} t_j \mathbf{U}_j \mathbf{B} \mathbf{U}_j^*,
\end{align}
where $\sum_{j=1}^{N} t_j=1$.
\end{itemize}
\end{lemma}
\begin{proof}
See Theorem 7.1 in \cite{ando1989majorization}.
\end{proof}
The following proposition makes a connection between an optimal MCPCA solution and the majorization of covariance matrices in $\mathcal{K}_{X}$.
\begin{lemma}\label{prop:connection-major}
If $\mathbf{K}^*\in \mathcal{K}_{X}$ majorizes all $\mathbf{K}\in \mathcal{K}_{X}$, then $\mathbf{K}^*$ is an optimal solution of the MCPCA optimization \eqref{opt:MCPCA-main}, for $1\leq q\leq p$.
\end{lemma}
\begin{proof}
Since $\mathbf{K}^*\in \mathcal{K}_{X}$ majorizes all $\mathbf{K}\in \mathcal{K}_{X}$, $\sum_{r=1}^{q}\lambda_r(\mathbf{K}^*)\geq \sum_{r=1}^{q}\lambda_r(\mathbf{K})$, for all $1\leq q\leq p$. Thus $\mathbf{K}^*$ is an optimal solution of optimization \eqref{opt:MCPCA-main}, for $1\leq q\leq p$.
\end{proof}
\subsection{MCPCA as an Optimization over Unit Variance Functions}\label{subsec:alternative-formulations}
The feasible set of optimization \eqref{opt:MCPCA-main} includes functions of variables with zero means and unit variances. In the following we consider an alternative optimization whose feasible set includes functions of variables with unit variances and show the relationship between its optimal solutions with the ones of the MCPCA optimization. This formulation becomes useful in simplifying the MCPCA optimization for finite discrete variables (Section \ref{sec:discrete}).
\begin{lemma}\label{lem:MC-PCA-variance}
Consider the following optimization:
\begin{align}\label{opt:MC-PCA-variance}
\max_{\{\phi_i\}_{i=1}^{p}}\quad &\sum_{r=1}^{q} \lambda_{r}(\mathbf{K})\\
&\mathbf{K}(i,i')=\mathbb{E}\left[\left(\phi_i(X_i)-\bar{\phi_i}(X_i)\right)\left(\phi_{i'}(X_{i'})-\bar{\phi_{i'}}(X_{i'})\right)\right],\quad 1\leq i,i'\leq p\nonumber\\
&var(\phi_i(X_i))=1,\quad 1\leq i \leq p\nonumber,
\end{align}
where $var(.)$ denotes the variance of a random variables and $\bar{\phi_i}(X_i)=\mathbb{E}[\phi_i(X_i)]$. Let $\varrho_1$ and $\varrho_2$ be optimal values of objective functions of optimizations \eqref{opt:MCPCA-main} and \eqref{opt:MC-PCA-variance}, respectively. We have $\varrho_1=\varrho_2$. Moreover if $\{\phi_i^{**}\}_{i=1}^{p}$ is an optimal solution of optimization \eqref{opt:MC-PCA-variance}, then $\{\phi_i^{*}\}_{i=1}^{p}$ is an optimal solution of optimization \eqref{opt:MCPCA-main}, where $\phi_i^{*}(X_i)=\phi_i^{**}(X_i)-\bar{\phi_i}^{**}(X_i)$, and vice versa.
\end{lemma}
\begin{proof}
First we have the following lemma:
\begin{lemma}\label{thm:MC-PCA-trace}
Let $(\mathbf{K}^*,\mathbf{W}^*)$ be an optimal solution of the following optimization:
\begin{align}\label{opt:MC-PCA-trace}
\max_{\mathbf{W}, \{\phi_i\}_{i=1}^{p}}\quad &Tr(\mathbf{W} \mathbf{K})\\
& Tr(\mathbf{W})=q,\nonumber\\
& 0 \preceq \mathbf{W} \preceq I, \nonumber\\
&\mathbf{K}(i,i')=\mathbb{E}[\phi_i(X_i)\phi_{i'}(X_{i'})],\quad 1\leq i,i'\leq p\nonumber\\
&\mathbb{E}[\phi_i(X_i)^2]=1,\quad 1\leq i \leq p\nonumber\\
&\mathbb{E}[\phi_i(X_i)]=0,\quad 1\leq i \leq p.\nonumber
\end{align}
Then $\mathbf{K}^*$ is an optimal solution of optimization \eqref{opt:MCPCA-main} and $\sum_{r=1}^{q}\lambda_r(\mathbf{K}^*)=Tr(\mathbf{W}^* \mathbf{K}^*)$.
\end{lemma}
\begin{proof}
The proof follows from the fact that the $q$ Ky Fan norm of a matrix $\mathbf{K}$ is the solution of the following optimization \cite{boyd2004convex}:
\begin{align}
\max_{\mathbf{W}}\quad &Tr(\mathbf{W} \mathbf{K})\\
& Tr(\mathbf{W})=q,\nonumber\\
& 0 \preceq \mathbf{W} \preceq I. \nonumber
\end{align}
\end{proof}
Consider the trace formulation of optimizations \eqref{opt:MCPCA-main} and \eqref{opt:MC-PCA-variance} according to Lemma \ref{thm:MC-PCA-trace}:

\begin{subequations}
\begin{align}
\max_{\mathbf{W}, \{\phi_i\}_{i=1}^{p}}\quad &\sum_{i,i'} w_{i,i'} \mathbb{E}[\phi_i(X_i)\phi_{i'}(X_{i'})]\label{opt:trace1}\\
& Tr(\mathbf{W})=q,\nonumber\\
& 0 \preceq \mathbf{W} \preceq I\nonumber\\
&\mathbb{E}[\phi_i(X_i)^2]=1,\quad 1\leq i \leq p\nonumber\\
&\mathbb{E}[\phi_i(X_i)]=0,\quad 1\leq i \leq p,\nonumber\\\nonumber\\
\max_{\mathbf{W}, \{\phi_i\}_{i=1}^{p}}\quad &\sum_{i,i'} w_{i,i'} \mathbb{E}\left[\left(\phi_i(X_i)-\bar{\phi_i}(X_i)\right)\left(\phi_{i'}(X_{i'}-\bar{\phi_{i'}}(X_{i'})\right)\right]\label{opt:trace2}\\
& Tr(\mathbf{W})=q,\nonumber\\
& 0 \preceq \mathbf{W} \preceq I\nonumber\\
&var(\phi_i(X_i))=1,\quad 1\leq i \leq p.\nonumber
\end{align}
\end{subequations}
Let $\phi_i^*$ and $\mathbf{W}^*$ be an optimal solution of \eqref{opt:trace1}. The set of functions $\{\phi_i^*\}_{i=1}^{p}$ and $\mathbf{W}^*$ is feasible for optimization \eqref{opt:trace2}. Thus, $\varrho_1\leq \varrho_2$. Moreover, let $\phi_i^{**}$ and $\mathbf{W}^*$ be an optimal solution of optimization \eqref{opt:trace2}. Let $\tilde{\phi}_i= \phi_i^{**}- \bar{\phi_i}^{**}$. The set of functions $\{\tilde{\phi}_i\}_{i=1}^{p}$ and $\mathbf{W}^*$ is feasible for optimization \eqref{opt:trace1}. Thus, we have $\varrho_1\leq \varrho_2$. Therefore, we have that $\varrho_1= \varrho_2$. This completes the proof.
\end{proof}

\section{MCPCA for Jointly Gaussian Random Variables}\label{sec:gaussian}
\subsection{Problem Formulation}\label{subsec:formulation-gauss}
Let $(X_1,\cdots, X_p)$ be zero mean unit variance jointly Gaussian random variables with the covariance matrix $\mathbf{K}_X$. Thus $\mathbf{K}_X(i,i')=\rho_{i,i'}$ where $\rho_{i,i'}$ is the correlation coefficient between variables $X_i$ and $X_{i'}$. Let $|\rho_{i,i'}|< 1$ for $i\neq i'$. A sign vector $\mathbf{s}=(s_1,s_2,\cdots,s_p)^T$ is a vector in $\mathbb{R}^{p}$ where $s_i\in\{-1,1\}$ for $1\leq i\leq p$.

Let $h_{j}(.)$ be the $j$-th Hermite-Chebyshev polynomial for $j\geq 0$. These polynomials form an orthonormal basis with respect to the Gaussian distribution \cite{lancaster1957some}:
\begin{align}
\mathbb{E}[h_{j}(X_i)\ h_{j'}(X_{i'})]= (\rho_{i,i'})^{j} \mathbf{1}\{j=j'\}.\nonumber
\end{align}
Moreover, because Hermite-Chebyshev polynomials have zero means over a Gaussian distribution we have
\begin{align}
\mathbb{E}[h_{j}(X_i)]= \mathbf{1}\{j=0\}, ~~ 1\leq i\leq p.
\end{align}
Using a basis expansion approach similar to \cite{feizi2015network} we have
\begin{align}\label{eq:phi-decompos-gauss}
\phi_i(X_i) = \sum_{j=1}^{\infty} a_{i,j}\ h_{j} (X_i),
\end{align}
where $\mathbf{a}_{i}=(a_{i,1},a_{i,2},\dots)^T$ is the vector of projection coefficients. The constraint $\mathbb{E}[\phi_i(X_i)^2]=1$ translates to $||\mathbf{a}_{i}|| =1$ while the constraint $\mathbb{E}[\phi_i(X_i)]=0$ is simplified to $a_{i,0}=0$ for $1\leq i \leq p$. We also have
\begin{align}\label{eq:gauss-hilbert-covariance}
\mathbf{K}_{(\phi_1(X_1),...,\phi_p(X_p))}(i,i')= \sum_{j=1}^{\infty} a_{i,j} a_{i',j} (\rho_{i,i'})^j.
\end{align}
Thus the MCPCA optimization \eqref{opt:MCPCA-main} can be re-written as follows:
\begin{align}\label{opt:MCPCA-gauss}
\max_{\mathbf{K}}\quad & \sum_{r=1}^{q} \lambda_r(\mathbf{K})\\
& \mathbf{K}(i,i')=\sum_{j=1}^{\infty} a_{i,j} a_{i',j} (\rho_{i,i'})^j, ~~ 1\leq i,i'\leq p,\nonumber\\
& \|\mathbf{a}_i\|_{2}=1, ~~ 1\leq i \leq p.\nonumber
\end{align}
Since $|\rho_{i,i'}|<1$ for $i\neq i'$, $(\rho_{i,i'})^j\to 0$ as $j\to\infty$. Thus we can approximate optimization \eqref{opt:MCPCA-gauss} with the following optimization
\begin{align}\label{opt:MCPCA-gauss-apx}
\max_{\mathbf{K}}\quad & \sum_{r=1}^{q} \lambda_r(\mathbf{K})\\
& \mathbf{K}(i,i')=\sum_{j=1}^{N} a_{i,j} a_{i',j} (\rho_{i,i'})^j, ~~ 1\leq i,i'\leq p,\nonumber\\
& \|\mathbf{a}_i\|_{2}=1, ~~ 1\leq i \leq p,\nonumber
\end{align}
for sufficiently large $N$.
\begin{lemma}
Let $\rho_q^*$ and $\tilde{\rho}_q^*$ be optimal values of optimizations \eqref{opt:MCPCA-gauss} and \eqref{opt:MCPCA-gauss-apx}, respectively. For a given $\epsilon>0$, there exists $N_0$ such that if $N>N_0$ we have $|\rho_q^*-\tilde{\rho}_q^*|<\epsilon$.
\end{lemma}
\begin{proof}
The proof follows from the fact that the Ky Fan norm of a matrix is a continuous function of its elements and also $(\rho_{i,i'})^j\to 0$ as $j\to\infty$.
\end{proof}
For the bivariate case ($p=2$), the MCPCA optimization simplifies to the maximum correlation optimization \eqref{eq:mc}. For jointly Gaussian variables the maximum correlation optimization \eqref{eq:mc} results in global optimizers $\phi_i^*(X_i)=s_i X_i$ for $i=1,2$ \cite{lancaster1957some}. Sign variables $s_i$'s are chosen so that the correlation between $s_1 X_1$ and $s_2 X_2$ is positive. This can be immediately seen from the formulation \eqref{opt:MCPCA-gauss-apx} as well: maximizing the off-diagonal entry of a $2\times 2$ covariance matrix maximizes its top eigenvalue. For the bivariate case the global optimizer of optimization \eqref{opt:MCPCA-gauss} is $a_i^*=(\pm 1,0,0,...)$ for $i=1,2$ since $|\rho_{1,2}|> (\rho_{1,2})^j$ for $j\geq 2$. Using \eqref{eq:phi-decompos-gauss} and since $h_1(.)$ is the identity function, we obtain $\phi_i^*(X_i)=s_i X_i$ for $i=1,2$.

Let $\mathcal{K}_{ext}$ be the set of covariance matrices of variables $s_i X_i$ where $s_i=\pm 1$ for $1\leq i\leq p$. In the bivariate case we have
\begin{align}
\mathcal{K}_{ext}=\left\{\left( \begin{array}{cc}
1 & \rho_{1,2} \\
\rho_{1,2} & 1\end{array} \right),\left( \begin{array}{cc}
1 & -\rho_{1,2} \\
-\rho_{1,2} & 1\end{array} \right)\right\}.
\end{align}
Note that covariance matrices in $\mathcal{K}_{ext}$ have similar eigenvalues. Moreover in the bivariate case every covariance matrix $\mathbf{K}_{(\phi_1(X_1),\phi_2(X_2))}$ can be written as a convex combination of covariance matrices in $\mathcal{K}_{ext}$. Thus, it is majorized by covariance matrices in $\mathcal{K}_{ext}$ (Lemma \ref{lem:unitary-eq}). However in the multivariate case we may have covariance matrices that are not in the convex hull of $\mathcal{K}_{ext}$. To illustrate this, let $p=3$ and consider
\begin{align}
\mathcal{K}_{ext}=\left\{\left( \begin{array}{ccc}
1 & 0.9&0.9 \\
0.9 & 1&0.7  \\
0.9 & 0.7&1\end{array} \right),\left( \begin{array}{ccc}
1 & -0.9&-0.9 \\
-0.9 & 1&0.7  \\
-0.9 & 0.7&1\end{array} \right),\left( \begin{array}{ccc}
1 & -0.9&0.9 \\
-0.9 & 1&-0.7  \\
0.9 & -0.7&1\end{array} \right),\left( \begin{array}{ccc}
1 & 0.9&-0.9 \\
0.9 & 1&-0.7  \\
-0.9 & -0.7&1\end{array} \right)\right\}.
\end{align}
One can show that the covariance matrix
\begin{align}
\left( \begin{array}{ccc}
1 & 0.9^2&0.9^2 \\
0.9^2 & 1&0.7^2  \\
0.9^2 & 0.7^2&1\end{array} \right)
\end{align}
is not included in the convex hull of covariance matrices in $\mathcal{K}_{ext}$. This covariance matrix results from having $a_{i,2}=1$ for $1\leq i\leq 3$. Thus techniques used to characterize global optimizers of the bivariate case may not extend to the multivariate case.
\subsection{Global MCPCA Optimizers}
Here we characterize global optimizers of optimization \eqref{opt:MCPCA-gauss}. Our main result is as follows:

\begin{theorem}\label{thm:gauss-major}
$\mathbf{K}_X$ majorizes every $\mathbf{K}\in\mathcal{K}_X$.
\end{theorem}
This Theorem along with Lemma \ref{prop:connection-major} results in the following corollary.

\begin{corollary}
$\phi_i(X_i)=s_i X_i$ where $s_i\pm 1$ for $1\leq i\leq p$ provides a globally optimal solution for the MCPCA optimization \eqref{opt:MCPCA-gauss} for $1\leq q\leq p$.
\end{corollary}
Below we present the proof of Theorem \ref{thm:gauss-major}.

\begin{proof}
First we prove the following lemma:
\begin{lemma}\label{lem:A-decompos-diag}
Let $\mathbf{K}$ be a $p\times p$ positive semidefinite matrix with unit diagonal elements. Let $\mathbf{K}^{\odot j}$ be the $j$-th Hadamard power of $\mathbf{K}$. Then there exist diagonal matrices $\mathbf{E}_k$ for $1\leq k\leq p^{j-1}$ such that
\begin{align}
\mathbf{K}^{\odot j}=\sum_{k=1}^{p^{j-1}} \mathbf{E}_k \mathbf{K} \mathbf{E}_k,
\end{align}
where $\sum_{k} \mathbf{E}_k^2=\mathbf{I}$.
\end{lemma}
\begin{proof}
We prove this lemma for $j=2$. The case of $j>2$ can be shown by a successive application of the proof technique. Since $\mathbf{K}$ is a positive semidefinite matrix we can write $\mathbf{K}=\mathbf{U}^T \mathbf{U}$. Since diagonal elements of $\mathbf{K}$ are one we have $\|\mathbf{u}_i\|=1$ where $\mathbf{u}_i=(u_{1,i},...,u_{p,i})^T$ is the $i$-th column of $\mathbf{U}$. Then we have
\begin{align}
\mathbf{K}^{\odot 2}=\sum_{k=1}^{p} \mathbf{E}_k \mathbf{K} \mathbf{E}_k,
\end{align}
where
\begin{align}
\mathbf{E}_k=\left( \begin{array}{cccc}
u_{k,1} & 0&\cdots&0  \\
0 & u_{k,2}&\cdots&0  \\
\vdots & \vdots&\ddots&\vdots  \\
0 & 0&\cdots&u_{k,n} \end{array} \right).
\end{align}
Moreover we have
\begin{align}
\sum_{k=1}^{p} \mathbf{E}_k^2=\left( \begin{array}{cccc}
\|\mathbf{u}_1\|^2 & 0&\cdots&0  \\
0 & \|\mathbf{u}_2\|^2&\cdots&0  \\
\vdots & \vdots&\ddots&\vdots  \\
0 & 0&\cdots&\|\mathbf{u}_p\|^2 \end{array} \right)=\mathbf{I}.
\end{align}
\end{proof}
Next we prove the following result on matrix majorization:
\begin{lemma}\label{lem:major-A-B}
Let $\mathbf{K}$ be a $p\times p$ positive semidefinite matrix with unit diagonal elements. Let
\begin{align}
\mathbf{X}=\sum_{j=1}^{N} \mathbf{D}_j \mathbf{K}^{\odot j} \mathbf{D}_j,
\end{align}
where $\mathbf{D}_j$'s are diagonal matrices such that $\sum_{j=1}^{N}\mathbf{D}_j^2=\mathbf{I}$. Then $\lambda(\mathbf{K})\succ \lambda(\mathbf{X})$.
\end{lemma}
\begin{proof}
Using Lemma \ref{lem:A-decompos-diag} we can write
\begin{align}
\mathbf{X}=\sum_{j=1}^{M} \mathbf{F}_j \mathbf{K} \mathbf{F}_j,
\end{align}
where $M=(p^N-1)/(p-1)$ and $\sum_{j=1}^{M}\mathbf{F}_j^2=\mathbf{I}$. Then using Theorem 1 of \cite{bapat1985majorization} completes the proof.
\end{proof}
Let $\mathbf{K}_{(\phi_1(X_1),...,\phi_p(X_p))}$ be the covariance matrix of transformed variables $\{\phi_i(X_i)\}_{i=1}^{p}$. Using \eqref{eq:phi-decompos-gauss} and for sufficiently large $N$ we have
\begin{align}
\mathbf{K}_{(\phi_1(X_1),...,\phi_p(X_p))}=\sum_{j=1}^{N} \mathbf{A}_j \mathbf{K}_X^{\odot j} \mathbf{A}_j,
\end{align}
where
\begin{align}
\mathbf{A}_j=\left( \begin{array}{cccc}
a_{1,j} & 0&\cdots&0  \\
0 & a_{2,j}&\cdots&0  \\
\vdots & \vdots&\ddots&\vdots  \\
0 & 0&\cdots&a_{p,j} \end{array} \right).
\end{align}
Since $\|\mathbf{a}_i\|^2=1$ we have $\sum_{j=1}^N \mathbf{A}_j^2=\mathbf{I}$. Using Lemma \ref{lem:major-A-B} completes the proof.
\end{proof}

\section{MCPCA for Finite Discrete Random Variables}\label{sec:discrete}
\subsection{Problem Formulation}\label{subsec:disc-problem-formulation}
Let $X_i$ be a discrete random variable with distribution $P_{X_i}$ over the alphabet $\mathcal{X}_i=\{1, \dots , |\mathcal{X}_i|\}$. Without loss of generality, we assume all alphabets have positive probabilities as otherwise they can be neglected, i.e., $P_{X_i}(x)>0$ for $x\in \{1, \dots , |\mathcal{X}_i|\}$. Let $\phi_i(X_i):\mathcal{X}_i\to \mathbb{R}$ be a function of random variable $X_i$ with zero mean and unit variance. Using a basis expansion approach similar to \cite{feizi2015network}, we have
\begin{align}\label{eq:dis-basis-expansion}
\phi_i(X_i)=\sum_{i=1}^{|\mathcal{X}_i|} a_{i,j} \psi_{i,j}(X_i),
\end{align}
where
\begin{align}\label{eq:basis-discrete}
\psi_{i,j}(x)\triangleq\mathbf{1}\{x=j\} \frac{1}{\sqrt{P_{X_i}(x)}}.
\end{align}
Note that $\{\psi_{i,j}\}_{j=1}^{|\mathcal{X}_i|}$ form an orthonormal basis with respect to the distribution of $X_i$ because
\begin{align}\label{eq:orth-normal-psi}
&\mathbb{E}[\psi_{i,j}(X_i)^2]=1,\quad 1\leq j\leq |\mathcal{X}_i|\\
&\mathbb{E}[\psi_{i,j}(X_i)\psi_{i,j'}(X_i)]=0,\quad 1\leq j\neq j'\leq |\mathcal{X}_i|.\nonumber
\end{align}
Moreover we have
\begin{align}\label{eq:mean-psi}
\mathbb{E}[\psi_{i,j}(X_i)]=\sqrt{P_{X_i}(j)},\quad 1\leq j\leq |\mathcal{X}_i|.
\end{align}
Let $P_{X_i,X_{i'}}$ be the joint distribution of discrete variables $X_i$ and $X_{i'}$. Define a matrix $\mathbf{Q}_{i,i'}\in\mathbb{R}^{|\mathcal{X}_i|\times |\mathcal{X}_{i'}|}$ whose $(j,j')$ element is
\begin{align}\label{def:Q}
\mathbf{Q}_{i,i'}(j,j')\triangleq \frac{P_{X_i,X_{i'}}(j,j')}{\sqrt{P_{X_i}(j)P_{X_{i'}}(j')}}.
\end{align}
This matrix is called the $Q$-matrix of the distribution $P_{X_i,X_{i'}}$. Note that
\begin{align}
\mathbb{E}[\psi_{i,j}(X_i)\psi_{i',j'}(X_{i'})]=\mathbf{Q}_{i,i'}(j,j').
\end{align}
For $i=1, \dots, p$, let
\begin{align}\label{def:ai-sqrtpi}
&\mathbf{a}_i\triangleq \left( a_{i,1},a_{i,2},\ldots,a_{i,|\mathcal{X}_{i}| } \right) ^T \\
&\sqrt{\mathbf{p}_i}\triangleq \left( \sqrt{P_{X_i}(1)},\sqrt{P_{X_i}(2)},\ldots,\sqrt{P_{X_i}(|\mathcal{X}_{i}| )}\right) ^T.\nonumber
\end{align}
\begin{theorem}\label{thm:mcpca-opt-ai}
Let $\{\mathbf{a}_i^*\}_{i=1}^{p}$ be an optimal solution of the following optimization:
\begin{align}\label{opt:MC-PCA-ai}
\max_{\{\mathbf{a}_i\}_{i=1}^{p}}\quad &\sum_{r=1}^{q} \lambda_{r}(\mathbf{K})\\
& \mathbf{K}(i,i')=\mathbf{a}_i^T \mathbf{Q}_{i,i'} \mathbf{a}_{i'}, ~~ 1\leq i,i'\leq p,\nonumber\\
& \|\mathbf{a}_i\|_{2}=1, ~~ 1\leq i \leq p, \nonumber \\
& \mathbf{a}_i \perp \sqrt{\mathbf{p}_i}, ~~ 1\leq i \leq p. \nonumber
\end{align}
Then, $\mathbf{K}^*$ is an optimal solution of MCPCA optimization \eqref{opt:MCPCA-main}.
\end{theorem}
\begin{proof}
Consider $\mathbf{K}\in\mathcal{K}_{X}$ in the feasible region of MCPCA optimization \eqref{opt:MCPCA-main}. We have
\begin{align}
\mathbf{K}(i,i')=\mathbb{E}[\phi_i(X_i)\phi_{i'}(X_{i'})],~~ 1\leq i,i'\leq p
\end{align}
where $\mathbb{E}[\phi_i(X_i)]=0$, and $\mathbb{E}[\phi_i(X_i)^2]=1$ for all $1\leq
i\leq p$. Using \eqref{eq:dis-basis-expansion}, we can represent these functions in terms of the basis functions:
\begin{align}
\phi_i(X_i)&=\sum_{j=1}^{|\mathcal{X}_i|} a_{i,j} \psi_{i,j}(X_i),\\
\phi_{i'}(X_{i'})&=\sum_{j=1}^{|\mathcal{X}_{i'}|} a_{i',j'} \psi_{i',j'}(X_{i'}).\nonumber
\end{align}
Using \eqref{eq:orth-normal-psi}, the constraint $\mathbb{E}[\phi_i(X_i)^2]=1$ would be translated into $\|\mathbf{a}_i\|_{2}$ for $1\leq i\leq p$. Moreover using \eqref{eq:mean-psi}, the constraint $\mathbb{E}[\phi_i(X_i)]=0$ is simplified to $\sum_{j=1}^{|\mathcal{X}_i|} a_{i,j} \sqrt{P_{X_i}(j)}=0$ for $1\leq i\leq p$. We also have
\begin{align}
\mathbb{E}[\phi_i(X_i)\phi_{i'}(X_{i'})]= \sum_{j=1}^{|\mathcal{X}_{i}|} \sum_{j'=1}^{|\mathcal{X}_{i'}|} a_{i,j} a_{i',j'}\ \mathbb{E}[\psi_{i,j} (X_i) \psi_{i',j'} (X_{i'})]=\mathbf{a}_i^T \mathbf{Q}_{i,i'} \mathbf{a}_{i'}.
\end{align}
This shows every feasible point of optimization \eqref{opt:MCPCA-main} corresponds to a feasible point of optimization \eqref{opt:MC-PCA-ai}. The inverse argument is similar. This completes the proof.
\end{proof}
Recall that $\sigma_j(\mathbf{Q}_{i,i'})$ is the $j$-th largest singular value of the matrix $\mathbf{Q}_{i,i'}$ corresponding to left and right singular vectors $\mathbf{u}_j(\mathbf{Q}_{i,i'})$ and $\mathbf{v}_j(\mathbf{Q}_{i,i'})$, respectively.
\begin{lemma}\label{lem:sing-value-Q}
$\sigma_{1}(\mathbf{Q}_{i,i'})=1$, $\mathbf{u}_{1}(\mathbf{Q}_{i,i'})=\sqrt{\mathbf{p}_i}$ and $\mathbf{v}_{1}(\mathbf{Q}_{i,i'})=\sqrt{\mathbf{p}_{i'}}$.
\end{lemma}
\begin{proof}
First we show that the maximum singular value of the matrix $\mathbf{Q}_{i,i'}$ is less than or equal to one. To show that, it is sufficient to show that for every vectors $\mathbf{a}_1$ and $\mathbf{a}_2$ such that $\|\mathbf{a}_1\|=1$ and $\|\mathbf{a}_2\|=1$, we have $\mathbf{a}_1^T \mathbf{Q}_{i,i'} \mathbf{a}_2 \leq 1$. To show this, we define random variables $\Upsilon_1$ and $\Upsilon_2$ such that
\begin{align*}
\mathbb{P}\big(\Upsilon_1=\frac{a_{1,j}}{\sqrt{P_{X_i}(j)}},\Upsilon_2=\frac{a_{2,j'}}{\sqrt{P_{X_{i'}}(j')}}\big)=P_{X_{i},X_{i'}}(j,j').
\end{align*}
Using Cauchy-Schwartz inequality, we have
\begin{align*}
\mathbf{a}_1^T \mathbf{Q}_{i,i'} \mathbf{a}_2= \mathbb{E} [\Upsilon_1 \Upsilon_2] \leq \sqrt{\mathbb{E}[\Upsilon_1^2] \mathbb{E}[\Upsilon_2^2]}=||\mathbf{a}_1|| \  ||\mathbf{a}_2||= 1.
\end{align*}
Therefore, the maximum singular value of $\mathbf{Q}_{i,i'}$ is at most one.

Moreover $\sqrt{\mathbf{p}_i}$ and $\sqrt{\mathbf{p}_{i'}}$ are right and left singular vectors of the matrix $\mathbf{Q}_{i,i'}$ corresponding to the singular value one because $\mathbf{Q}_{i,i'} \sqrt{\mathbf{p}_{i'}}=\sqrt{\mathbf{p}_i}$ and $\sqrt{\mathbf{p}_i}^T \mathbf{Q}_{i,i'}=\sqrt{\mathbf{p}_{i'}}^T$.
\end{proof}

In the following we use similar techniques to the ones employed in \cite{feizi2015network} to formulate an alternative and equivalent optimization to \eqref{opt:MC-PCA-ai} without orthogonality constraints which proves to be useful in characterizing a globally optimal MCPCA solution when $q=1$.

Consider the matrix $\tilde{I}_i\triangleq I_{|\mathcal{X}_i|} - \sqrt{\mathbf{p}_i} \sqrt{\mathbf{p}_i}^T $. This matrix is positive semidefinite and the only vectors in its null space are $\mathbf{0}$ and $\sqrt{\mathbf{p}_i}$. This is because for any vector $\mathbf{x}$ we have
\begin{align}
\mathbf{x}^T \left( I_{|\mathcal{X}_i|} - \sqrt{\mathbf{p}_i} \sqrt{\mathbf{p}_i}^T \right) \mathbf{x} = ||\mathbf{x}||_2^2- (\mathbf{x} \sqrt{\mathbf{p}_i})^2 \ge 0,
\end{align}
where the Cauchy-Schwartz inequality and $||\sqrt{\mathbf{p}_i}||_2^2=1$ are used. The inequality becomes an equality if and only if $\mathbf{x}=0$ or $\mathbf{x}= \sqrt{\mathbf{p}_i}$. Moreover we have $\lambda_j(\tilde{I}_i)=1$ for $1\leq j<|\mathcal{X}_i|$ because
\begin{align}
\left(I_{|\mathcal{X}_i|} - \sqrt{\mathbf{p}_i}\sqrt{\mathbf{p}_i}^T \right) \mathbf{u}_j(\tilde{I}_i)= \mathbf{u}_j(\tilde{I}_i)- \sqrt{\mathbf{p}_i}\sqrt{\mathbf{p}_i}^T \mathbf{u}_j(\tilde{I}_i)=\mathbf{u}_j(\tilde{I}_i),
\end{align}
where the last equality follows from the fact that $\mathbf{u}_j(\tilde{I}_i)$ is orthogonal to $\mathbf{u}_{|\mathcal{X}_i|}(\tilde{I}_i)=\sqrt{\mathbf{p}_i}$.

Define $\mathbf{A}_i\in \mathbb{R}^{|\mathcal{X}_i|\times |\mathcal{X}_i|}$ as follows:
\begin{align}\label{eq:Ai-inverseBi}
\mathbf{A}_i\triangleq \Bigg( \left[\mathbf{u}_1(\tilde{I}_i), \dots, \mathbf{u}_{|\mathcal{X}_i|-1}(\tilde{I}_i) \right] \left[ \mathbf{u}_1(\tilde{I}_i), \dots, \mathbf{u}_{|\mathcal{X}_i|-1}(\tilde{I}_i) \right]^T\Bigg).
\end{align}

\begin{theorem}\label{thm:mcpca-opt-bi}
Let $\{\mathbf{b}_i^*\}_{i=1}^{p}$ be an optimal solution of the following optimization:
\begin{align}\label{opt:MC-PCA-bi}
\max_{\{\mathbf{b}_i\}_{i=1}^{p}}\quad &\sum_{r=1}^{q} \lambda_{r}(\mathbf{K})\\
& \mathbf{K}(i,i')=\mathbf{b}_i^T \left(\mathbf{Q}_{i,i'}-\sqrt{\mathbf{p}_i}\sqrt{\mathbf{p}_{i'}}^T\right) \mathbf{b}_{i'}, ~~ 1\leq i,i'\leq p,\nonumber\\
& \|\mathbf{b}_i\|_{2}=1, ~~ 1\leq i \leq p. \nonumber
\end{align}
Then, $\{\mathbf{a}_i^*\}_{i=1}^{p}$ is an optimal solution of optimization \eqref{opt:MC-PCA-ai} where $\mathbf{a}_i^*=\mathbf{A}_i \mathbf{b}_i^*$.
\end{theorem}
\begin{proof}
We consider unit variance formulation of the MCPCA optimization \eqref{opt:MC-PCA-variance}. We have
\begin{align*}
& \mathbb{E}[(\phi_i(X_i)- \bar{\phi_i}(X_i))(\phi_{i'}(X_{i'})- \bar{\phi_{i'}}(X_{i'}))]= \mathbb{E}[\phi_i(X_i) \phi_{i'}(X_{i'})] - \bar{\phi_i}(X_i) \bar{\phi_{i'}}(X_{i'}) \nonumber \\
& = \mathbf{a}_i^T \mathbf{Q}_{i,i'} \mathbf{a}_{i'}- (\mathbf{a}_i^T \sqrt{\mathbf{p}_i}) (\mathbf{a}_{i'}^T \sqrt{\mathbf{p}_{i'}})= \mathbf{a}_i^T \left( \mathbf{Q}_{i,i'}- \sqrt{\mathbf{p}_i} \sqrt{\mathbf{p}_{i'}}^T \right) \mathbf{a}_{i'}.\nonumber
\end{align*}
Moreover we have
\begin{align}
var(\phi_i(X_i))=\mathbb{E}[\phi_i(X_i)^2]- (\mathbb{E}[\phi_i(X_i)])^2= ||\mathbf{a}_i||_2^2- (\mathbf{a}_i^T \sqrt{\mathbf{p}_i})^2= \mathbf{a}_i^T \left( I - \sqrt{\mathbf{p}_i} \sqrt{\mathbf{p}_i}^T \right) \mathbf{a}_i.\nonumber
\end{align}
Therefore optimization \eqref{opt:MC-PCA-variance} can be written as
\begin{align}\label{opt:MC-PCA-variance2}
\max_{\{\mathbf{a}_i\}_{i=1}^{p}}\quad &\sum_{r=1}^{q} \lambda_{r}(\mathbf{K})\\
&\mathbf{K}(i,i')=\mathbf{a}_i^T \left( \mathbf{Q}_{i,i'}- \sqrt{\mathbf{p}_i} \sqrt{\mathbf{p}_{i'}}^T\right)\mathbf{a}_{i'},\quad 1\leq i,i'\leq p\nonumber\\
&\mathbf{a}_i^T \left( I - \sqrt{\mathbf{p}_i} \sqrt{\mathbf{p}_i}^T \right) \mathbf{a}_i=1,\quad 1\leq i \leq p\nonumber.
\end{align}
We can write $I - \sqrt{\mathbf{p}_i} \sqrt{\mathbf{p}_i}^T= \mathbf{B}_i \mathbf{B}_i^T$ (since $ I - \sqrt{\mathbf{p}_i} \sqrt{\mathbf{p}_i}^T $ is positive semidefinte) where
\begin{align}\label{eq:Bi}
\mathbf{B}_i \triangleq \sqrt{I_{|\mathcal{X}_i|}- \sqrt{\mathbf{p}_i} \sqrt{\mathbf{p}_i}^T}.
\end{align}

Define $\mathbf{b}_i\triangleq \mathbf{B}_i \mathbf{a}_i$. Thus, $\mathbf{a}_i^T \left( I - \sqrt{\mathbf{p}_i} \sqrt{\mathbf{p}_i}^T \right) \mathbf{a}_i=1$ can be written as $\mathbf{b}_i^T \mathbf{b}_i=||\mathbf{b}_i||_2^2=1$. The vector $\sqrt{\mathbf{p}_i}$ is the eigenvector corresponding to eigenvalue zero of the matrix $\mathbf{B}_i$ ($\lambda_{|\mathcal{X}_i|}(\mathbf{B}_i)=0$). Other eigenvalues of $\mathbf{B}_i$ is equal to one. Since $\mathbf{B}_i$ is not invertible, there are many choices for $\mathbf{a}_i$ as a function of $\mathbf{b}_i$.
\begin{align}\label{eq:ba-i-choices}
\mathbf{a}_i = \big( [\mathbf{u}_1(\mathbf{B}_i), \dots, \mathbf{u}_{|\mathcal{X}_i|-1}(\mathbf{B}_i)] [\mathbf{u}_1(\mathbf{B}_i), \dots, \mathbf{u}_{|\mathcal{X}_i|-1}(\mathbf{B}_i)]^T \big)\mathbf{b}_i+ \alpha_i \sqrt{\mathbf{p}_i}= \mathbf{A}_i \mathbf{b}_i + \alpha_i  \sqrt{\mathbf{p}_i},
\end{align}
where $\alpha_i$ can be an arbitrary scalar (note that $\mathbf{u}_i(\tilde{I}_i)=\mathbf{u}_i(\mathbf{B}_i)$). However since the desired $\mathbf{a}_i$ of optimization \eqref{opt:MC-PCA-ai} is orthogonal to the vector $\sqrt{\mathbf{p}_i}$, we choose $\alpha_i=0$ (i.e., according to Lemma \ref{lem:MC-PCA-variance}, in order to obtain a mean zero solution of the MCPCA optimization \eqref{opt:MCPCA-main}, we subtract the mean from the optimal solution of optimization \eqref{opt:MC-PCA-variance}.)
Therefore we have
\begin{align}\label{eq:zii'-bi-bi'}
\mathbf{a}_i^T \left( \mathbf{Q}_{i,i'}- \sqrt{\mathbf{p}_i} \sqrt{\mathbf{p}_{i'}}^T \right) \mathbf{a}_{i'} = \mathbf{b}_i^T \mathbf{A}_i^T \left(\mathbf{Q}_{i,i'}- \sqrt{\mathbf{p}_i} \sqrt{\mathbf{p}_{i'}}^T \right)\mathbf{A}_{i'} \mathbf{b}_{i'}.
\end{align}
Moreover using Lemma \ref{lem:sing-value-Q}, we have
\begin{align}
\mathbf{Q}_{i,i'}=\sqrt{\mathbf{p}_i}\sqrt{\mathbf{p}_{i'}}^T+\sum_{j\geq 2} \sigma_j(\mathbf{Q}_{i,i'}) \mathbf{u}_j(\mathbf{Q}_{i,i'}) \mathbf{u}_j(\mathbf{Q}_{i',i})^T.
\end{align}
Thus,
\begin{align}\label{eq:simplify-AiQii'}
\mathbf{A}_i^T\left(\mathbf{Q}_{i,i'}-\sqrt{\mathbf{p}_i}\sqrt{\mathbf{p}_{i'}}\right) \mathbf{A}_{i'}^T&=\mathbf{A}_i^T\left(\sum_{j\geq 2} \sigma_j(\mathbf{Q}_{i,i'}) \mathbf{u}_j(\mathbf{Q}_{i,i'}) \mathbf{u}_j(\mathbf{Q}_{i',i})^T \right)\mathbf{A}_{i'}^T\\
&=\sum_{j\geq 2} \sigma_j(\mathbf{Q}_{i,i'}) \left(\mathbf{A}_i^T \mathbf{u}_j(\mathbf{Q}_{i,i'})\right) \left(\mathbf{A}_{i'}^T \mathbf{u}_j(\mathbf{Q}_{i',i})\right)^T\nonumber\\
&\stackrel{(I)}{=}\sum_{j\geq 2} \sigma_j(\mathbf{Q}_{i,i'}) \left(\mathbf{u}_j(\mathbf{Q}_{i,i'})\right) \left(\mathbf{u}_j(\mathbf{Q}_{i',i})\right)^T\nonumber\\
&=\mathbf{Q}_{i,i'}-\sqrt{\mathbf{p}_i}\sqrt{\mathbf{p}_{i'}},\nonumber
\end{align}
where equality (I) comes from expanding $\mathbf{u}_j(\mathbf{Q}_{i,i'})$ over the basis $\{\mathbf{u}_{k}(\tilde{I}_i)\}_{k=1}^{|\mathcal{X}_i|-1}$ and the fact that $\mathbf{u}_j(\mathbf{Q}_{i,i'})\perp \sqrt{\mathbf{p}_i}$ for $j\geq 2$. Using equation \eqref{eq:simplify-AiQii'} in \eqref{eq:zii'-bi-bi'} completes the proof.
\end{proof}

\subsection{A Globally Optimal MCPCA Solution for the Rank One Constraint}\label{subsec:q=1}
In this part first we characterize an upper bound for the objective value of optimization \eqref{opt:MC-PCA-B} for $1\leq q\leq p$. Then, we construct a solution that achieves this upper bound for $q=1$.

Define a matrix $\mathbf{B}\in\mathbb{R}^{p \times \sum_{i=1}^{p} |\mathcal{X}_i|}$ such that
\begin{align}\label{eq:def-B}
\mathbf{B}\triangleq\left( \begin{array}{cccc}
\mathbf{b}_1 & 0&\cdots&0  \\
0 & \mathbf{b}_2&\cdots&0  \\
\vdots & \vdots&\ddots&\vdots  \\
0 & 0&\cdots&\mathbf{b}_p \end{array} \right).
\end{align}
Optimization \eqref{opt:MC-PCA-bi} can be written as
\begin{align}\label{opt:MC-PCA-B}
\max_{\{\mathbf{b}_i\}_{i=1}^{p},\{\mathbf{v}_r\}_{r=1}^{q}}\quad &\sum_{r=1}^{q} \mathbf{v}_r^T \mathbf{B}^T \mathbf{R} \mathbf{B} \mathbf{v}_r\\
& \mathbf{B}^T \mathbf{B}=I, \nonumber\\
& \mathbf{v}_r^T \mathbf{v}_r=1, \quad 1\leq r\leq q,\nonumber\\
& \mathbf{v}_r^T \mathbf{v}_s=0, \quad 1\leq r\neq s\leq q,\nonumber
\end{align}
where $\mathbf{B}$ has the structure defined in \eqref{eq:def-B}, and $\mathbf{R}\in\mathbb{R}^{\sum_{i=1}^{p} |\mathcal{X}_i|\times \sum_{i=1}^{p} |\mathcal{X}_i|}$ where
\begin{align}\label{eq:def-Rii'}
\mathbf{R}_{i,i'}= \left(\mathbf{Q}_{i,i'}-\sqrt{\mathbf{p}_i}\sqrt{\mathbf{p}_{i'}}^T\right).
\end{align}
\begin{lemma}\label{prop:upper-bound}
The optimal value of optimization \eqref{opt:MC-PCA-B} is upper bounded by $\sum_{r=1}^{q}\lambda_r(\mathbf{R})$.
\end{lemma}
\begin{proof}
Define $\mathbf{w}_r\triangleq \mathbf{B} \mathbf{v}_r$. We have
\begin{align}
\mathbf{w}_r^T \mathbf{w}_r&=\mathbf{v}_r^T \mathbf{B}^T \mathbf{B} \mathbf{v}_r=\mathbf{v}_r^T \mathbf{v}_r=1,\quad 1\leq r\leq q\\
\mathbf{w}_r^T \mathbf{w}_s&=\mathbf{v}_r^T \mathbf{B}^T \mathbf{B} \mathbf{v}_s=0,\quad 1\leq r\neq s\leq q.\nonumber
\end{align}
Thus,
\begin{align}\label{opt:relax-MC-PCA-B}
\max_{\{\mathbf{w}_r\}_{r=1}^{q}}\quad &\sum_{r=1}^{q} \mathbf{w}_r^T \mathbf{R} \mathbf{w}_r\\
& \mathbf{w}_r^T \mathbf{w}_r=1, \quad 1\leq r\leq q\nonumber\\
& \mathbf{w}_r^T \mathbf{w}_s=0, \quad 1\leq r\neq s\leq q\nonumber
\end{align}
is a relaxation of optimization \eqref{opt:MC-PCA-B}. The optimal solution of this optimization is achieved when $\mathbf{w}_r=\mathbf{u}_r(\mathbf{R})$ for $1\leq r\leq q$. This completes the proof.
\end{proof}

\begin{theorem}\label{thm:q=1}
Let $\mathbf{u}_1(\mathbf{R})=(\mathbf{u}_{1,1}(\mathbf{R}),\mathbf{u}_{1,2}(\mathbf{R}),\cdots,\mathbf{u}_{1,p}(\mathbf{R}))^T$ where $\mathbf{u}_{1,i}\in\mathbb{R}^{|\mathcal{X}_i|}$. Then,
\begin{align}\label{eq:bi-for-q=1}
\mathbf{b}_i^*=\frac{\mathbf{u}_{1,i}(\mathbf{R})}{\|\mathbf{u}_{1,i}(\mathbf{R})\|},\quad 1\leq i\leq p,
\end{align}
is an optimal solution of optimization \eqref{opt:MC-PCA-bi} when $q=1$.
\end{theorem}
\begin{proof}
Let $\mathbf{v}_1=(\mathbf{v}_{1,1},\cdots,\mathbf{v}_{1,p})^T$. Choosing $\mathbf{v}_{1,i}=\|\mathbf{u}_{1,i}(\mathbf{R})\|$ and $\mathbf{b}_i^*$ according to \eqref{eq:bi-for-q=1} achieves the upper bound provided in Lemma \ref{prop:upper-bound} for the case of $q=1$. This completes the proof.
\end{proof}

\subsection{MCPCA Computation Using a Block Coordinate Descend Algorithm}\label{subsec:comp-MCPCA-dis}
Here we provide a block coordinate descend algorithm to solve the MCPCA optimization for finite discrete variables with a general distribution for an arbitrary $1\leq q\leq p$. We then show that the algorithm converges to a stationary point of the MCPCA optimization.

Let $\mathbf{v}_r=(\mathbf{v}_{r,1},\cdots,\mathbf{v}_{r,p})^T$. optimization \eqref{opt:MC-PCA-ai} can be written as
\begin{align}\label{opt:MC-PCA-sum-all-blocks}
\max_{\{\mathbf{a}_i\}_{i=1}^{p},\{\mathbf{v}_r\}_{r=1}^{q}}\quad &\sum_{r=1}^{q} \sum_{i=1}^{p}\sum_{i'=1}^{p} v_{r,i} v_{r,i'} \mathbf{a}_i^T \mathbf{Q}_{i,i'}\mathbf{a}_{i'}\\
& \|\mathbf{a}_i\|=1,\quad 1\leq i\leq p, \nonumber\\
& \mathbf{a}_i\perp \sqrt{\mathbf{p}_i},\quad 1\leq i\leq p, \nonumber\\
& \mathbf{v}_r^T \mathbf{v}_r=1, \quad 1\leq r\leq q,\nonumber\\
& \mathbf{v}_r^T \mathbf{v}_s=0, \quad 1\leq r\neq s\leq q.\nonumber
\end{align}

\begin{lemma}\label{lem:update-ai}
Let
\begin{align}
\mathbf{w}_k=\sum_{r=1}^{q}\sum_{i\in\{1,...,p\}-\{k\}} v_{r,k} v_{r,i} \mathbf{Q}_{k,i} \mathbf{a}_i.
\end{align}
If all variables except $\mathbf{a}_k$ are fixed in the feasible set of optimization \eqref{opt:MC-PCA-sum-all-blocks}, then
\begin{align}\label{eq:optimal-ai-coordinate}
\mathbf{a}_k^*=\frac{\mathbf{w}_k-\sqrt{\mathbf{p}_k}^T\mathbf{w}_k \sqrt{\mathbf{p}_k}}{\|\mathbf{w}_k-\sqrt{\mathbf{p}_k}^T\mathbf{w}_k \sqrt{\mathbf{p}_k}\|}
\end{align}
is an optimal solution of the constrained optimization \eqref{opt:MC-PCA-sum-all-blocks} if $\|\mathbf{w}_k-\sqrt{\mathbf{p}_k}^T\mathbf{w}_k \sqrt{\mathbf{p}_k}\|\neq 0$. If $\|\mathbf{w}_k-\sqrt{\mathbf{p}_k}^T\mathbf{w}_k \sqrt{\mathbf{p}_k}\|=0$, every unit norm vector $\mathbf{a}_k^*\perp \mathbf{w}_k$ is an optimal solution of the constrained optimization \eqref{opt:MC-PCA-sum-all-blocks}.
\end{lemma}
\begin{proof}
Under the condition of Lemma \ref{lem:update-ai}, optimization \eqref{opt:MC-PCA-sum-all-blocks} is simplified to the following optimization:
\begin{align}
\max_{\mathbf{a}_k}\quad& \mathbf{a}_k^T \mathbf{w}_k \\
& \|\mathbf{a}_k\|=1,\nonumber\\
& \mathbf{a}_k \perp \sqrt{\mathbf{p}_k}.\nonumber
\end{align}
Writing $\mathbf{w}_k=\sqrt{\mathbf{p}_k}^T\mathbf{w}_k\sqrt{\mathbf{p}_k}+\left(\mathbf{w}_k-\sqrt{\mathbf{p}_k}^T\mathbf{w}_k\sqrt{\mathbf{p}_k}\right)$, we have
\begin{align}
\mathbf{a}_k^T \mathbf{w}_k=\mathbf{a}_k^T \left(\mathbf{w}_k-\sqrt{\mathbf{p}_k}^T\mathbf{w}_k\sqrt{\mathbf{p}_k}\right),
\end{align}
since $\mathbf{a}_k \perp \sqrt{\mathbf{p}_k}$. This completes the proof.
\end{proof}

\begin{lemma}\label{lem:update-vr}
If all variables except $\{\mathbf{v}_r\}_{r=1}^{q}$ are fixed in the feasible set of optimization \eqref{opt:MC-PCA-sum-all-blocks}, then $\mathbf{v}_r^*=\mathbf{u}_{r}(\mathbf{K})$ where $\mathbf{K}(i,i')=\mathbf{a}_{i}^T \mathbf{Q}_{i,i'}\mathbf{a}_{i'}$.
\end{lemma}
\begin{proof}
The proof follows from the eigen decomposition of the covariance matrix $\mathbf{K}$.
\end{proof}

We use Lemmas \ref{lem:update-ai} and \ref{lem:update-vr} to propose a block coordinate descend Algorithm \ref{alg:MCPCA} to compute MCPCA.

\begin{algorithm}[t]
\caption{A Block Coordinate Descend Algorithm to Compute MCPCA for Finite Discrete Variables}
\begin{algorithmic}\label{alg:MCPCA}
\STATE \textbf{Input:} $P_{X_i,X_{i'}}$ for $1\leq i,i'\leq p$, $q$
\STATE \textbf{Initialization:} $\{\mathbf{a}_i^{(0)}\}_{i=1}^{p}$ and $\{\mathbf{v}_r^{(0)}\}_{r=1}^{q}$
\STATE \textbf{for} $j=0,1, \dots$
\STATE \hspace{.2 in} \textbf{for} $k=1,..., p$
\STATE \hspace{.4 in} \textbf{compute:} $\mathbf{w}_k^{(j)}=\sum_{r=1}^{q}\sum_{i=1}^{k-1} v_{r,k}^{(j)} v_{r,i}^{(j)} \mathbf{Q}_{k,i} \mathbf{a}_i^{(j)}+\sum_{r=1}^{q}\sum_{i=k+1}^{p} v_{r,k}^{(j-1)} v_{r,i}^{(j-1)} \mathbf{Q}_{k,i} \mathbf{a}_i^{(j-1)}$
\STATE \hspace{.4 in} \textbf{update:} $\mathbf{a}_k^{(j)}=\frac{\mathbf{w}_k^{(j)}-\sqrt{\mathbf{p}_k}^T\mathbf{w}_k^{(j)} \sqrt{\mathbf{p}_k}}{\|\mathbf{w}_k^{(j)}-\sqrt{\mathbf{p}_k}^T\mathbf{w}_k^{(j)} \sqrt{\mathbf{p}_k}\|}$, if $\|\mathbf{w}_k^{(j)}-\sqrt{\mathbf{p}_k}^T\mathbf{w}_k^{(j)} \sqrt{\mathbf{p}_k}\|\neq 0$
\STATE \hspace{.2 in} \textbf{compute:} $\mathbf{K}^{(j)}$ where $\mathbf{K}^{(j)}(i,i')=(\mathbf{a}_{i}^{(j)})^T \mathbf{Q}_{i,i'}\mathbf{a}_{i'}^{(j)}$
\STATE \hspace{.2 in} \textbf{update:} $v_r^{(j)}=\mathbf{u}_r(\mathbf{K}^{(j)})$, for $1\leq r\leq q$
\STATE \hspace{.2 in} $\rho_q^{(j)}=\sum_{r=1}^{q}\lambda_r(\mathbf{K}^{(j)})$
\STATE \textbf{end}
\end{algorithmic}
\end{algorithm}

\begin{theorem}\label{thm:greedy-convergance}
The sequence $\rho_q^{(j)}$ in Algorithm \ref{alg:MCPCA} is monotonically increasing and convergent. Moreover, if $\mathbf{K}^{(j)}$ has top $q$ simple eigenvalues and $\|\mathbf{w}_k^{(j)}-\sqrt{\mathbf{p}_k}^T\mathbf{w}_k^{(j)} \sqrt{\mathbf{p}_k}\|\neq 0$ for $1\leq k\leq p$ and $j\geq 0$, then $\{\mathbf{a}_i^{(j)}\}_{i=1}^{p}$ converges to stationary points of optimization \eqref{opt:MC-PCA-ai}.
\end{theorem}
\begin{proof}
According to Lemmas \ref{lem:update-ai} and \ref{lem:update-vr}, the sequence $\rho_q^{(j)}$ is increasing. Moreover, since it is bounded above (Theorem \ref{thm:prop-MCPCA}, part [i]), it is convergent. Moreover, under the conditions of Theorem \ref{thm:greedy-convergance}, at each step, Lemmas \ref{lem:update-ai} and \ref{lem:update-vr} provide a unique optimal solution for optimizing variables $\{\mathbf{a}_i\}_{i=1}^{p}$ and $\{\mathbf{v}_r\}_{r=1}^{q}$. Thus, $\{\mathbf{a}_i^{(j)}\}_{i=1}^{p}$ converges to a stationary point of optimization \eqref{opt:MC-PCA-ai} (\cite{tseng2001convergence}).
\end{proof}

\section{Sample MCPCA}\label{sec:sample-MCPCA}
Principal component analysis is often applied to an observed data matrix whose rows and columns represent samples and features, respectively. In this part, first we review PCA and then formulate the sample MCPCA optimization (an MCPCA optimization computed over empirical distributions). We then study the consistency of sample MCPCA for both finite discrete and continuous variables.
\subsection{Review of PCA}\label{sec:review-PCA}
Let $\mathbf{X}\in \mathbb{R}^{n\times p}$ be a data matrix:
\begin{align}\label{eq:data-matrix}
\mathbf{X}=(\mathbf{x}^{1},\dots, \mathbf{x}^{p})= \left( \begin{array}{c}
\mathbf{x}_1^T \\
\vdots \\
\mathbf{x}_n^T \end{array} \right),
\end{align}
where $\mathbf{x}_i$ and $\mathbf{x}^{j}$ represent its $i$-th row and $j$-th column, respectively. Let $\mathbf{X}(i,j)$, or interchangeably $\mathbf{X}_{i,j}$, denote the $(i,j)$-th element of $X$. PCA aims to find orthonormal vectors $\mathbf{v}_1,\dots,\mathbf{v}_q$ where $\mathbf{v}_i\in\mathbb{R}^p$ and $q\leq p$ such that the average mean squared error between $\hat{\mathbf{x}}_k$ and $\mathbf{x}_k$ for $1\leq k\leq n$ is minimized:
\begin{align}\label{opt:PCA}
\min_{\{\mathbf{v}_i\}_{i=1}^{q},\mathbf{\theta}}\quad &\frac{1}{n}\sum_{k=1}^{n} \|\mathbf{x}_k-\hat{\mathbf{x}}_k\|^2\\
&\hat{\mathbf{x}}_k=\mathbf{\theta}+\sum_{i=1}^{q} \left(\mathbf{v}_i^T(\mathbf{x}_k-\mathbf{\theta})\right)\mathbf{v}_i,\quad 1\leq k\leq n\nonumber\\
&\mathbf{v}_i^T \mathbf{v}_j=0,\quad 1\leq i\neq j\leq q\nonumber\\
&\mathbf{v}_i^T \mathbf{v}_i=1,\quad 1\leq i\leq q.\nonumber
\end{align}
Let
\begin{align}
&\mathbf{\theta}_n^*\triangleq\frac{1}{n}\sum_{i=1}^{n} \mathbf{x}_i\\
&\mathbf{K}_n\triangleq\frac{1}{n}\sum_{i=1}^{n} (\mathbf{x}_i-\mathbf{\theta}^*)(\mathbf{x}_i-\mathbf{\theta}^*)^T.\nonumber
\end{align}
$\mathbf{K}_n$ and $\mathbf{\theta}_n^*$ are the empirical covariance matrix and the empirical mean of the data, respectively.
\begin{theorem}\label{thm:PCA}
$\mathbf{\theta}_n^*$ and $\mathbf{u}_1(\mathbf{K}_n)$,...,$\mathbf{u}_q(\mathbf{K}_n)$ provide an optimal solution for optimization \eqref{opt:PCA}.
\end{theorem}
\begin{proof}
See reference \cite{jolliffe2002principal}.
\end{proof}
By subtracting $\mathbf{\theta}_n^*$ from rows of the input matrix, the mean of each column becomes zero. This procedure is called {\it centring} the input data.
\subsection{Sample MCPCA for Finite Discrete Variables}\label{subsec:sample-MCPCA-disct}
Let $X_1$,..., $X_p$ be discrete variables with joint distribution $P_{X_1,...,X_p}$. Let the alphabet size of variables (i.e., $|\mathcal{X}_i|$) be finite. We observe $n$ independent samples $\{\mathbf{x}_i\}_{i=1}^{n}$ from this distribution. Let $\mathbf{X}\in \mathbb{R}^{n\times p}$ be the data matrix \eqref{eq:data-matrix}. Sample MCPCA aims to find possibly nonlinear transformations of the data (i.e., $\phi_i(\mathbf{x}^i)$ for $1\leq i\leq p$) to minimize the mean squared error (MSE) between the transformed data and its low rank approximation by $q$ orthonormal vectors $\mathbf{v}_1$,...,$\mathbf{v}_q$:

\begin{align}\label{opt:sample-MCPCA-data}
\min_{\{\mathbf{v}_i\}_{i=1}^{q},\{\phi_i\}_{i=1}^{p}}\quad &\frac{1}{n}\sum_{k=1}^{n} \|\phi(\mathbf{x}_k)-\hat{\phi}(\mathbf{x}_k)\|^2\\
&\hat{\phi}(\mathbf{x}_k)=\sum_{i=1}^{q} \left(\mathbf{v}_i^T\phi(\mathbf{x}_k)\right)\mathbf{v}_i,\quad 1\leq k\leq n\nonumber\\
&\phi(\mathbf{x}_k)= (\phi_1(\mathbf{X}_{k,1}),\dots,\phi_p(\mathbf{X}_{k,p})),\quad 1\leq k\leq n\nonumber\\
&\mathbf{v}_i^T \mathbf{v}_j=0,\quad 1\leq i\neq j\leq q,\nonumber\\
&\mathbf{v}_i^T \mathbf{v}_i=1,\quad 1\leq i\leq q,\nonumber\\
&\frac{1}{n}\sum_{k=1}^{n}\phi_i(\mathbf{X}_{k,i})=0, \quad 1\leq i\leq p,\nonumber\\
&\frac{1}{n}\sum_{k=1}^{n}\phi_i(\mathbf{X}_{k,i})^2=1, \quad 1\leq i\leq p.\nonumber
\end{align}
The constraint $\frac{1}{n}\sum_{k=1}^{n}\phi_i(\mathbf{X}_{k,i})=0$ is similar to the centring step in the standard PCA where columns of the data matrix are transformed to have empirical zero means (Theorem \ref{thm:PCA}). The additional constraint $\frac{1}{n}\sum_{k=1}^{n}\phi_i(\mathbf{X}_{k,i})^2=1$ makes columns of the transformed matrix to have equal norms.

Let $(Y_{1},\dots,Y_{p})$ be $p$ finite discrete random variables whose joint probability distribution $P_{Y_{1},\dots,Y_{p}}$ is equal to the empirical distribution of observed samples $\{\mathbf{x}_i\}_{i=1}^{n}$. I.e.,
\begin{align}\label{eq:joint-emprical}
Pr(Y_1=j_1,...,Y_p=j_p)=\frac{1}{n}\sum_{k=1}^{n} \mathbf{1}\{\mathbf{X}_{k,1}=j_1,...,\mathbf{X}_{k,p}=j_p\}\
\end{align}
for $j_i\in\{1,2,...,|\mathcal{Y}_i|\}$.

\begin{theorem}\label{thm:sample-MCPCA}
Let $\mathbf{K}^*$ be an optimal solution of the MCPCA optimization \eqref{opt:MCPCA-main} over variables $\{Y_i\}_{i=1}^{p}$ corresponding to transformation functions $\{\phi_i^*(Y_i)\}_{i=1}^{p}$. Then, $\{\mathbf{u}_r(\mathbf{K}^*)\}_{r=1}^{q},\{\phi_i^*(.)\}_{i=1}^{p}$ provide an optimal solution for optimization \eqref{opt:sample-MCPCA-data}.
\end{theorem}
\begin{proof}
Define $\mathbf{V}\in\mathbb{R}^{p\times q}$ as follows:
\begin{align}\label{eq:W}
\mathbf{V}=(\mathbf{v}_1, \cdots, \mathbf{v}_q).
\end{align}
Thus
\begin{align}\label{eq:phi-hat}
\hat{\phi}(\mathbf{x}_k)=\mathbf{V} \mathbf{V}^T \phi(\mathbf{x}_k),\quad 1\leq k\leq n.
\end{align}
We have
\begin{align}
\hat{\phi}(\mathbf{x}_k)-\phi(\mathbf{x}_k)=(I-\mathbf{V}\bV^T) \phi(\mathbf{x}_k).
\end{align}
Let $\mathbf{B}_{\mathbf{V}}\triangleq I-\mathbf{V}\bV^T$. Note that $\mathbf{B}_{\mathbf{V}}=\mathbf{B}_{\mathbf{V}}^2=\mathbf{B}_{\mathbf{V}}^T$. Therefore we have
\begin{align}
&\frac{1}{n}\sum_{k=1}^{n} \|\phi(\mathbf{x}_k)-\hat{\phi}(\mathbf{x}_k)\|^2\\
&=\frac{1}{n} \sum_{k=1}^{n} \phi(\mathbf{x}_k)^T \mathbf{B}_{\mathbf{V}}^T \mathbf{B}_{\mathbf{V}} \phi(\mathbf{x}_k)\nonumber\\
&=\frac{1}{n} \sum_{k=1}^{n} \phi(\mathbf{x}_k)^T (I-\mathbf{V}\bV^T) \phi(\mathbf{x}_k)\nonumber\\
&=Tr\left(\frac{1}{n}\sum_{k=1}^n \phi(\mathbf{x}_k) \phi(\mathbf{x}_k)^T\right)-Tr\left(\mathbf{V}^T \left(\frac{1}{n}\sum_{k=1}^n \phi(\mathbf{x}_k) \phi(\mathbf{x}_k)^T\right) \mathbf{V}\right)\nonumber\\
&= Tr(\mathbf{K})-Tr(\mathbf{V}^T \mathbf{K} \mathbf{V})= p-Tr(\mathbf{V}^T \mathbf{K} \mathbf{V}),\nonumber
\end{align}
$\mathbf{K}\triangleq \frac{1}{n}\sum_{k=1}^n \phi(\mathbf{x}_k) \phi(\mathbf{x}_k)^T$. Since $\{Y_i\}_{i=1}^{p}$ is distributed according to the empirical distribution of samples $\{\mathbf{x}_k\}_{k=1}^{n}$, we have
\begin{align}
\mathbf{K}(i,i')=\frac{1}{n}\sum_{k=1}^{n}\phi_i(\mathbf{X}_{k,i})\phi_{i'}(\mathbf{X}_{k,i'})=\mathbb{E}[\phi_i(Y_i) \phi_{i'}(Y_{i'})].
\end{align}
Similarly the constraint $\frac{1}{n}\sum_{k=1}^{n}\phi_i(\mathbf{X}_{k,i})=0$ is simplified to the constraint $\mathbb{E}[\phi_i(Y_i)]=0$, while the constraint $\frac{1}{n}\sum_{k=1}^{n}\phi_i(\mathbf{X}_{k,i})^2=1$ is translated to the constraint $\mathbb{E}[\phi_i(Y_i)^2]=1$. Therefore, optimization \eqref{opt:sample-MCPCA-data} can be written as
\begin{align}\label{opt:MC-PCA-proof1}
\min_{\mathbf{V},\mathbf{K}}\quad &p-Tr(\mathbf{V}^T \mathbf{K} \mathbf{V})\\
& \mathbf{V}^T \mathbf{V}=I_{q},\nonumber\\
& \mathbf{K}\in\mathcal{K}_{Y}.\nonumber
\end{align}
Moreover using \eqref{eq:W}, we have
\begin{align}
Tr(\mathbf{V}^T \mathbf{K} \mathbf{V})= \sum_{r=1}^{q} \mathbf{v}_r^T \mathbf{K} \mathbf{v}_r.
\end{align}
Let $\lambda=\mathbf{v}_r^T \mathbf{K} \mathbf{v}_r$. Since $\mathbf{v}_r \lambda=\mathbf{K} \mathbf{v}_r$, $\mathbf{v}_r$ is an eigenvector of $\mathbf{K}$ corresponding to eigenvalue $\lambda_r(\mathbf{K})$. This simplifies optimization \eqref{opt:MC-PCA-proof1} to optimization \eqref{opt:MCPCA-main} and completes the proof.
\end{proof}

The following Theorem discusses the consistency of sample MCPCA for finite discrete variables.

\begin{theorem}\label{thm:const-discrete}
Let $\rho_q^*$ and $\tilde{\rho_q}^{(n)}$ be optimal MCPCA values over variables $\{X_i\}_{i=1}^{p}$ and $\{Y_i\}_{i=1}^{p}$. Let $p$ and $q$ be fixed. As $n\to \infty$, with probability one, $\tilde{\rho_q}^{(n)}\to\rho_q^*$.
\end{theorem}
\begin{proof}
The proof follows form the fact that for a fixed $p$ and $q$, as $n\to\infty$, eigenvalues of the empirical covariance matrix converge to the eigenvalues of the true covariance matrix, with probability one.
\end{proof}

\begin{algorithm}[t]
\caption{A Block Coordinate Descend Algorithm to Compute Sample MCPCA For Finite Discrete Variables}
\begin{algorithmic}\label{alg:sample-MCPCA}
\STATE \textbf{Input:} $\mathbf{X}$, $q$
\STATE \textbf{Initialization:} $\{\phi_i^{(0)}\}_{i=1}^{p}$ and $\{\mathbf{v}_r^{(0)}\}_{r=1}^{q}$
\STATE \textbf{for} $j=0,1, \dots$
\STATE \hspace{.2 in} \textbf{for} $k=1,..., p$
\STATE \hspace{.4 in} \textbf{compute:} $\mathbf{w}_k^{(j)}=\sum_{r=1}^{q}\sum_{i=1}^{k-1} v_{r,k}^{(j)} v_{r,i}^{(j)} \phi_i^{(j)}(\mathbf{x}^i)+\sum_{r=1}^{q}\sum_{i=k+1}^{p} v_{r,k}^{(j-1)} v_{r,i}^{(j-1)} \phi_i^{(j-1)}(\mathbf{x}^i)$
\STATE \hspace{.4 in} \textbf{update:} $\phi_k^{(j)}=\mathbb{E}[\mathbf{w}_k^{(j)}|Y_k]/||\mathbb{E}[\mathbf{w}_k^{(j)}|Y_k]||$
, if $||\mathbb{E}[\mathbf{w}_k^{(j)}|Y_k]||\neq 0$
\STATE \hspace{.2 in} \textbf{compute:} $\mathbf{K}^{(j)}$ where $\mathbf{K}^{(j)}(i,i')=\frac{1}{n}\sum_{s=1}^{n}\phi_i^{(j)}(\mathbf{X}_{s,i})\phi_{i'}^{(j)}(\mathbf{X}_{s,i'})$
\STATE \hspace{.2 in} \textbf{update:} $v_r^{(j)}=\mathbf{u}_r(\mathbf{K}^{(j)})$, for $1\leq r\leq q$
\STATE \hspace{.2 in} $\rho_q^{(j)}=\sum_{r=1}^{q}\lambda_r(\mathbf{K}^{(j)})$
\STATE \textbf{end}
\end{algorithmic}
\end{algorithm}

\subsection{Computation of Sample MCPCA for Finite Discrete Variables}\label{subsec:sample-MCPCA-comp-disc}
One way to compute sample MCPCA is to use empirical pairwise joint distributions in Algorithm \ref{alg:MCPCA}. However, forming and storing these empirical pairwise joint distributions may be expensive. Below, we discuss computation of the sample MCPCA optimization without forming pairwise joint distributions.

Let $\mathbf{v}_r=(\mathbf{v}_{r,1},\cdots,\mathbf{v}_{r,p})^T$. The sample MCPCA optimization \eqref{opt:MCPCA-main} can be written as follows:
\begin{align}\label{opt:sample-MCPCA-trace-V}
\max_{\{\phi_i\}_{i=1}^{p},\{\mathbf{v}_r\}_{r=1}^{q}}\quad &\sum_{r=1}^{q} \sum_{i=1}^{p}\sum_{i'=1}^{p} v_{r,i} v_{r,i'} \left(\frac{1}{n}\sum_{s=1}^{n}\phi_i(\mathbf{X}_{s,i})\phi_{i'}(\mathbf{X}_{s,i'})\right)\\
&\frac{1}{n}\sum_{s=1}^{n}\phi_i(\mathbf{X}_{s,i})=0, \quad 1\leq i\leq p,\nonumber\\
&\frac{1}{n}\sum_{s=1}^{n}\phi_i(\mathbf{X}_{s,i})^2=1, \quad 1\leq i\leq p\nonumber\\
& \mathbf{v}_r^T \mathbf{v}_r=1, \quad 1\leq r\leq q\nonumber\\
& \mathbf{v}_r^T \mathbf{v}_s=0, \quad 1\leq r\neq s\leq q.\nonumber
\end{align}

Let $(Y_{1},\dots,Y_{p})$ be $p$ finite discrete random variables whose joint probability distribution $P_{Y_{1},\dots,Y_{p}}$ is equal to the empirical distribution of observed samples $\{\mathbf{x}_i\}_{i=1}^{n}$. Define the vector $\mathbf{w}_k\in \mathbb{R}^n$ as follows:
\begin{align}\label{eq:wk}
\mathbf{w}_k\triangleq\sum_{r=1}^{q}\sum_{i\in\{1,...,p\}-\{k\}} v_{r,k} v_{r,i} \phi_i(\mathbf{x}^i).
\end{align}

\begin{lemma}\label{lem:update-phi}
If all variables except $\phi_k$ are fixed in the feasible set of optimization \eqref{opt:sample-MCPCA-trace-V}, then
\begin{align}\label{eq:optimal-ai-coordinate}
\phi_k^*(Y_k)=\mathbb{E}[\mathbf{w}_k|Y_k]/||\mathbb{E}[\mathbf{w}_k|Y_k]||,
\end{align}
is the optimal solution of the constrained optimization \eqref{opt:sample-MCPCA-trace-V} if $||\mathbb{E}[\mathbf{w}_k|Y_k]||\neq 0$. If $||\mathbb{E}[\mathbf{w}_k|Y_k]||=0$, every mean zero and unit norm $\phi_k^*$ is an optimal solution of the constrained optimization \eqref{opt:sample-MCPCA-trace-V}.
\end{lemma}
\begin{proof}
If all variables except $\phi_k$ are fixed, optimization \eqref{opt:sample-MCPCA-trace-V} can be simplified to
\begin{align}\label{opt:alaki1}
\max_{\phi_k}\quad& <\phi_k(\mathbf{x}^k),\mathbf{w}_k>\\
&\mathbf{1}^T \phi_k(\mathbf{x}^k)=0,\nonumber\\
&||\phi_k(\mathbf{x}^k)||^2=n.\nonumber
\end{align}
Note that since there exists $\phi_k$ such that $<\phi_k(\mathbf{x}^k),\mathbf{w}_k>\geq 0$, the constraint $||\phi_k(\mathbf{x}^k)||^2=n$ can be replaced by the constraint $||\phi_k(\mathbf{x}^k)||^2\leq n$. Now consider the following optimization:
\begin{align}\label{opt:alaki2}
\max_{\phi_k}\quad& <\phi_k(\mathbf{x}^k),\mathbf{w}_k>\\
&||\phi_k(\mathbf{x}^k)||^2\leq n.\nonumber
\end{align}
We show that the optimal solution of optimization \eqref{opt:alaki2} has zero mean. For simplicity, we use $\phi_k$ instead of $\phi_k(\mathbf{x}^k)$. We proceed by contradiction. Suppose $\phi_k^*$ is an optimal solution of optimization \eqref{opt:alaki2} whose mean is not zero (i.e., $\bar{\phi_k^*}\neq 0$). Consider the following solution:
\begin{align}
\tilde{\phi_k}=\sqrt{n}\frac{\phi_k^*-\bar{\phi_k^*}}{||\phi_k^*-\bar{\phi_k^*}||}.
\end{align}
Note that $||\tilde{\phi_k}||^2=n$. Thus, $\tilde{\phi_k}$ belongs to the feasible set of optimization \eqref{opt:alaki2}. Moreover we have
\begin{align}
&||\phi_k^*-\bar{\phi_k^*}||^2=||\phi_k^*-\frac{\mathbf{1}^T\phi_k^*}{n}||^2\\
&=||\phi_k^*||^2+(\frac{1}{n^2}-\frac{2}{n})(\mathbf{1}^T\phi_k^*)^2<||\phi_k^*||^2\leq n.\nonumber
\end{align}
Therefore,
\begin{align}\label{eq:alaki3}
\frac{\sqrt{n}}{||\phi_k^*-\bar{\phi_k^*}||}>1.
\end{align}
Using \eqref{eq:alaki3} and the fact that $\mathbf{1}^T \mathbf{w}_k=0$, $\tilde{\phi_k}$ leads to a strictly larger objective value of optimization \eqref{opt:alaki2} than the one of $\phi_k^*$, which is a contradiction. Therefore, the optimal solution of optimization \eqref{opt:alaki2} has zero mean. Thus, optimization \eqref{opt:alaki2} is a tight relaxation of optimization \eqref{opt:alaki1}.

Define $\theta_k(Y_k)\triangleq \mathbb{E}[\mathbf{w}_k|Y_k]$. Thus, $<\phi_k(\mathbf{x}^k),\mathbf{w}_k>=\mathbb{E}[\phi_k(Y_k)\theta_k(Y_k)]$. Moreover, $||\phi_k(\mathbf{x}^k)||^2=n\mathbb{E}[Y_k^2]$. Therefore, optimization \eqref{opt:alaki2} is simplified to the following optimization:
\begin{align}\label{opt:alaki4}
\max\quad& \mathbb{E}[\phi_k(Y_k)\theta_k(Y_k)]\\
&\mathbb{E}[Y_k^2]\leq 1\nonumber.
\end{align}
Using the Cauchy-Schwartz inequality completes the proof.
\end{proof}
To update variables $\{\mathbf{v}_r\}_{r=1}^{q}$, one can use Lemma \ref{lem:update-vr}. Similarly to Algorithm \ref{alg:MCPCA}, to solve the sample MCPCA optimization for finite discrete variables, we propose Algorithm \ref{alg:sample-MCPCA} which is based on a block coordinate descend approach.

\begin{theorem}\label{thm:greedy-convergance-sample}
The sequence $\rho_q^{(j)}$ in Algorithm \ref{alg:sample-MCPCA} is monotonically increasing and convergent. Moreover, if $\mathbf{K}^{(j)}$ has top $q$ simple eigenvalues and $||\mathbb{E}[\mathbf{w}_k^{(j)}|Y_k]||\neq 0$ for $1\leq k\leq p$ and $j\geq 0$, then $\{\phi_i^{(j)}\}_{i=1}^{p}$ converges to stationary points of optimization \eqref{opt:sample-MCPCA-trace-V}.
\end{theorem}
\begin{proof}
The proof is similar to the one of Theorem \ref{thm:greedy-convergance}.
\end{proof}

\begin{proposition}\label{prop:complexity}
Each iteration of Algorithm \ref{alg:sample-MCPCA} has a computational complexity of $\mathcal{O}(p^3+np^2)$ and a memory complexity of $\mathcal{O}(np)$.
\end{proposition}

\begin{remark}\label{remark:complexity}
\textup{The computational complexity of Isomap and LLE is $\mathcal{O}(n^3)$ and $\mathcal{O}(pn^2)$ while their memory complexity is $\mathcal{O}(n^2)$ and $\mathcal{O}(pn^2)$, respectively. Unlike Isomap and LLE, computational and memory complexity of MCPCA Algorithm \ref{alg:sample-MCPCA} scales linearly with the number of samples $n$ which makes it suitable for data sets with large number of samples.}
\end{remark}

\subsection{Sample MCPCA for Continuous Variables}\label{subsec:sample-MCPCA-cont}
In this part, we consider the case where $X_1$,..., $X_p$ are continuous variables with the density function $f_{X_1,...,X_p}$. Here we assume $X_1$,...,$X_p$ have bounded ranges. Without loss of generality, let $X_i\in[0,1]$ for $1\leq i\leq p$. Moreover, let the density function satisfy $f_{X_i}(x)>0$ for $x\in[0,1]$ and $1\leq i\leq p$. We observe $n$ independent samples $\{\mathbf{x}_i\}_{i=1}^{n}$ from this distribution. The data matrix $X\in \mathbb{R}^{n\times p}$ is defined according to \eqref{eq:data-matrix}. Since $X_1$,...,$X_p$ are continuous, with probability one, each column of the matrix $X$ has $n$ distinct values. Thus, with probability one, there exists $\{\phi_i^*(.)\}$ such that $\phi_i^*(\mathbf{x}^i)=\mathbf{w}$ for $1\leq i\leq p$, where $\mathbf{w}$ is a vector in $\mathbb{R}^n$ whose mean is zero and its norm is equal to $\sqrt{n}$. Therefore, with probability one, the optimal value of optimization \eqref{opt:sample-MCPCA-data} is equal to $p$.

In the continuous case, the space of feasible transformation functions has infinite {\it degrees of freedom}. Thus, by observing $n$ samples from these continuous variables, we over-fit functions to observed samples.
Note that in the case of having observations from finite discrete variables, transformation functions have finite degrees of freedom and if the number of samples are sufficiently large, over-fitting issue does not occur (Theorem \ref{thm:const-discrete}). One approach to overcome the over-fitting issue in the continuous case is to restrict the feasible set of optimization \eqref{opt:sample-MCPCA-data} to functions whose degrees of freedom are smaller than the number of observed samples $n$. One such family of functions is piecewise linear functions with $d$ degrees of freedom:

\begin{definition}\label{def:piecewise-linear}
Let $\mathbf{w}\in\mathbb{R}^{d+1}$. $\mathcal{G}_d(\mathbf{w})$ is defined as the set of all functions $g:[0,1]\to \mathbb{R}$ such that
\begin{align}\label{eq:piecewise-linear}
g_d(x) \triangleq
\left\{
	\begin{array}{ll}
		w_j  & \mbox{if } x=\frac{j}{d}, 0\leq j\leq d \\
		(w_{j+1}-w_{j})(Mx-j)+w_j & \mbox{if } \frac{j}{d}<x<\frac{j+1}{d}, 0\leq j\leq d-1
	\end{array}
\right.
\end{align}
Moreover, $\mathcal{G}_d\triangleq \{\mathcal{G}_d(\mathbf{w}):\mathbf{w}\in\mathbb{R}^{d+1}\}$.
\end{definition}

Let $\{\mathbf{x}_k\}_{k=1}^{n}$ be observed sample from continuous variables $X_1$,...,$X_p$. Sample MCPCA aims to solve the following optimization:
\begin{align}\label{opt:sample-MCPCA-cont-data}
\min_{\{\mathbf{v}_i\}_{i=1}^{q},\{\phi_i\}_{i=1}^{p}}\quad &\frac{1}{n}\sum_{k=1}^{n} \|\phi(\mathbf{x}_k)-\hat{\phi}(\mathbf{x}_k)\|^2\\
&\hat{\phi}(\mathbf{x}_k)=\sum_{i=1}^{q} \left(\mathbf{v}_i^T\phi(\mathbf{x}_k)\right)\mathbf{v}_i,\quad 1\leq k\leq n\nonumber\\
&\phi(\mathbf{x}_k)= (\phi_1(\mathbf{X}_{k,1}),\dots,\phi_p(\mathbf{X}_{k,p})),\quad 1\leq k\leq n\nonumber\\
&\mathbf{v}_i^T \mathbf{v}_j=0,\quad 1\leq i\neq j\leq q\nonumber\\
&\mathbf{v}_i^T \mathbf{v}_i=1,\quad 1\leq i\leq q,\nonumber\\
&\frac{1}{n}\sum_{k=1}^{n}\phi_i(\mathbf{X}_{k,i})=0, \quad 1\leq i\leq p,\nonumber\\
&\frac{1}{n}\sum_{k=1}^{n}\phi_i(\mathbf{X}_{k,i})^2=1, \quad 1\leq i\leq p\nonumber\\
&\phi_i\in\mathcal{G}_d,\quad 1\leq i\leq p. \nonumber
\end{align}

\begin{theorem}\label{thm:sample-MCPCA-cont}
Consider the following optimization:
\begin{align}\label{opt:sample-MCPCA-cont}
\max_{\{\phi_i\}_{i=1}^{p}}\quad &\sum_{r=1}^{q} \lambda_{r}(\mathbf{K})\\
&\mathbf{K}(i,i')=\frac{1}{n}\sum_{k=1}^{n}\phi_i(\mathbf{X}_{k,i})\phi_{i'}(\mathbf{X}_{k,i'}),\quad 1\leq i,i'\leq p\nonumber\\
&\frac{1}{n}\sum_{k=1}^{n}\phi_i(\mathbf{X}_{k,i})^2=1,\quad 1\leq i \leq p\nonumber\\
&\frac{1}{n}\sum_{k=1}^{n}\phi_i(\mathbf{X}_{k,i})=0,\quad 1\leq i \leq p\nonumber\\
&\phi_i\in\mathcal{G}_d,\quad 1\leq i\leq p. \nonumber
\end{align}
Let $\mathbf{K}^*$ be an optimal solution of optimization \eqref{opt:sample-MCPCA-cont} corresponding to transformation functions $\{\phi_i^*\}_{i=1}^{p}$. Then, $\{\mathbf{u}_r(\mathbf{K}^*)\}_{r=1}^{q},\{\phi_i^*\}_{i=1}^{p}$ provide an optimal solution of optimization \eqref{opt:sample-MCPCA-cont-data}.
\end{theorem}
\begin{proof}
 The proof is similar to the one of Theorem \ref{thm:sample-MCPCA}.
\end{proof}

\begin{proposition}\label{prop:M=1-sampleMCPCA=PCA}
Let columns of the data matrix $\mathbf{X}$ have zero means and unit variances. If $d=1$, the sample MCPCA optimization \eqref{opt:sample-MCPCA-cont-data} is equivalent to the PCA optimization \eqref{opt:PCA}.
\end{proposition}
\begin{proof}
For $d=1$, $\mathcal{G}_{d}$ only contains linear functions. Since columns of the data matrix $\mathbf{X}$ are assumed to be normalized, optimization \eqref{opt:sample-MCPCA-cont-data} is equivalent to optimization \eqref{opt:PCA}.
\end{proof}
\subsection{Computation of MCPCA and Sample MCPCA for Continuous Variables}\label{subsec:comp-cont}
Define discrete variables $Y_{i,d}$ whose alphabets are $\{1,2,..,d\}$ and
\begin{align}\label{eq:uniform-quant-vars}
Pr(Y_{1,d}=j_1,...,Y_{p,d}=j_p)=\int_{x_1=(j_1-1)/d}^{j_1/d}\dots \int_{x_p=(j_p-1)/d}^{j_p/d} f_{X_1,...,X_p}(x_1,...,x_p) dx_1...dx_p
\end{align}

Below we establish a connection between solutions of the MCPCA optimization over continuous variables and their discretized versions. We will use this connection to compute MCPCA and sample MCPCA over continuous variables.
\begin{theorem}\label{thm:computation-cont-dist}
Let $\rho_q^*$ and $\hat{\rho}_{q,d}^*$ be optimal values of the MCPCA optimization \eqref{opt:MCPCA-main} over continuous variables $\{X_i\}_{i=1}^{p}$ and discrete variables $\{Y_{i,d}\}_{i=1}^{p}$, respectively. As $d\to\infty$, with probability one, $\hat{\rho}_{q,d}^*\to\rho_q^*$. Moreover, let $\{\hat{\phi}_{i,d}^*(.)\}$ be an optimal solution of the MCPCA optimization \eqref{opt:MCPCA-main} over discrete variables $\{Y_{i,d}\}_{i=1}^{p}$. Let $\mathbf{w}_i=\left(\hat{\phi}_{i,d}^*(1),\hat{\phi}_{i,d}^*(1),...,\hat{\phi}_{i,d}^*(d)\right)$. Then, as $d\to\infty$, with probability one, $\{g_d(\mathbf{w}_i)\}$ is an optimal solution of the MCPCA optimization \eqref{opt:MCPCA-main} over continuous variables $\{X_{i}\}_{i=1}^{p}$.
\end{theorem}
\begin{proof}
For $1\leq i\leq p$, let $\phi_i:[0,1]\to\mathbb{R}$ be a feasible function in the MCPCA optimization \eqref{opt:MCPCA-main} over continuous variables $\{X_i\}_{i=1}^{p}$. Define $\hat{\phi}_{i,d}:\{1,2,...,d\}\to\mathbb{R}$ such that
\begin{align}\label{eq:phihat}
\hat{\phi}_{i,d}(j)\triangleq \phi_i((j-1)/d).
\end{align}
Below we show that as $d\to\infty$, with probability one, $\{\hat{\phi}_{i,d}\}_{i=1}^{p}$ is feasible in the MCPCA optimization \eqref{opt:MCPCA-main} over discrete variables $\{Y_{i,d}\}_{i=1}^{p}$. We have
\begin{align}
\mathbb{E}[\hat{\phi}_{i,d}(Y_{i,d})]&=\sum_{j=1}^{d} Pr(Y_{i,d}=j) \hat{\phi}_{i,d}(j)\\
&=\sum_{j=1}^{d} \int_{x=(j-1)/d}^{j/d} f_{X_i}(x) \phi_i(\frac{j-1}{d})\nonumber\\
&\to \sum_{j=1}^{d} \int_{x=(j-1)/d}^{j/d} \phi_i(x) f_{X_i}(x) dx\nonumber\\
&=\int_{x=0}^{1} \phi_i(x) f_{X_i}(x) dx=0.\nonumber
\end{align}
Similarly as $d\to\infty$, with probability one, $\mathbb{E}[\hat{\phi}_{i,d}(Y_{i,d})^2]=1$, and
\begin{align}
\mathbb{E}[\hat{\phi}_{i,d}(Y_{i,d}) \hat{\phi}_{i',d}(Y_{i',d})]=\mathbb{E}[\phi_i(X_i)\phi_{i'}(X_{i'})].
\end{align}

Now consider $\{\hat{\phi}_{i,d}(Y_{i,d})\}_{i=1}^{p}$ as a feasible point for the MCPCA optimization \eqref{opt:MCPCA-main} over discrete variables $\{Y_{i,d}\}_{i=1}^{p}$.
For $1\leq i\leq p$, define
\begin{align}\label{eq:phi-bar}
\tilde{\phi_i}\triangleq g_d(\hat{\phi}_{i,d}(1),\hat{\phi}_{i,d}(1),\hat{\phi}_{i,d}(2),...,\hat{\phi}_{i,d}(d)).
\end{align}
Note that $\tilde{\phi_i}:[0,1]\to\mathbb{R}$. Similarly to the previous argument, as $d\to\infty$, with probability one, $\{\tilde{\phi_i}\}_{i=1}^{p}$ is a feasible point in the MCPCA optimization \eqref{opt:MCPCA-main} over continuous variables $\{X_i\}_{i=1}^{p}$. Moreover, as $d\to\infty$, with probability one, we have
\begin{align}
\mathbb{E}[\tilde{\phi_i}(X_i)\tilde{\phi_{i'}}(X_{i'})]=\mathbb{E}[\hat{\phi}_{i,d}(Y_{i,d}) \hat{\phi}_{i',d}(Y_{i',d})].
\end{align}

Consider $\{\phi_i^*\}_{i=1}^{p}$ as an optimal solution of optimization \eqref{opt:MCPCA-main} over continuous variables $\{X_i\}_{i=1}^{p}$ with the optimal value $\rho_q^*$. Construct $\{\hat{\phi}_{i,d}(.)\}_{i=1}^{p}$ according to equation \eqref{eq:phihat}. As $d\to\infty$, with probability one, $\{\hat{\phi}_{i,d}(.)\}_{i=1}^{p}$ is a feasible point for the MCPCA optimization \eqref{opt:MCPCA-main} over discrete variables $\{Y_{i,d}\}_{i=1}^{p}$ which leads to the MCPCA objective value $\hat{\rho}_{q,d}=\rho_q^*$. Thus, $\hat{\rho}_{q,d}^*\geq \rho_q^*$.

Now consider $\{\hat{\phi}_{i,d}^*\}_{i=1}^{p}$ as an optimal solution of optimization \eqref{opt:MCPCA-main} over discrete variables $\{Y_{i,d}\}_{i=1}^{p}$ which leads to the MCPCA objective value $\hat{\rho}_{q,d}^*$. Construct $\{\tilde{\phi_{i}}\}_{i=1}^{p}$ according to equation \eqref{eq:phi-bar}. As $d\to\infty$, with probability one, $\{\tilde{\phi_{i}}\}_{i=1}^{p}$ is a feasible point for the MCPCA optimization \eqref{opt:MCPCA-main} over continuous variables $\{X_i\}_{i=1}^{p}$ with the optimal value $\rho_q=\rho_{q,d}^*$. Thus, $\rho_q\geq \rho_{q,d}^*$. This completes the proof.
\end{proof}
Theorem \ref{thm:computation-cont-dist} simplifies the MCPCA computation over continuous variables $\{X_i\}_{i=1}^{p}$ to the MCPCA computation over discrete variables $\{Y_{i,d}\}_{i=1}^{d}$ which can be solved using Algorithm \ref{alg:MCPCA}. A similar approach can be taken to simplify the sample MCPCA optimization over continuous variables to the one of the discrete variables which can be solved using Algorithm \ref{alg:sample-MCPCA}.

Variable $Y_{i,d}$ provides a discretized version of the continuous variable $X_i$ where the position of knots (i.e., discretization thresholds) are uniformly spaced in the range of the variable. However the argument of Theorem \ref{thm:computation-cont-dist} can be extended to consider other nonuniform and data-dependent discretization as well. For example, in the case that we observe $n$ samples from $X_i$, one can choose the position of discretization knots to have equal number of samples in each discretization level. In the sample MCPCA implementation for continuous variables, we use such a nonuniform discretization approach.

\begin{figure}
\centering
  \includegraphics[width=\linewidth]{fig-all-p75.pdf}
\caption{(a) An illustration of latent, observed, and MCPCA absolute covariance matrices with different $q$ values. (b,c) An illustration of $q'$ Ky Fan norm of of latent, observed, and MCPCA covariance matrices with different $q$ values for $1\leq q'\leq p$ (panel b), and $q'=1,2$ (panel c). }
\label{fig:heatmap-p75}
\end{figure}

\section{MCPCA Applications to Synthetic and Real Data Sets}\label{sec:simulations}
\subsection{Synthetic Discrete Data}\label{subsec:synthetic-discrete-data}
First, we illustrate performance of MCPCA over simulated discrete data. We generate $n=1000$ independent samples from $p=50$ discrete variables whose covariance matrix is shown in Figure \ref{fig:heatmap-p75}-a (left panel). These samples are generated as discretized version of continuous jointly Gaussian samples. Alphabet sizes of variables (i.e., the number of quantization levels) are equal to 10. We then apply unknown random functions (with zero means and unit variances) to samples of each variable. The covariance matrix of observed samples (i.e., samples from transformed variables) is shown in Figure \ref{fig:heatmap-p75}-a (right panel). Owing to transformations of variables, the block diagonal structure of the latent covariance matrix has been faded in the observed one.

We apply the sample MCPCA Algorithm \ref{alg:sample-MCPCA} with parameter $q$ to the observed data matrix. We use 10 random initializations and 10 repeats of Algorithm \ref{alg:sample-MCPCA}. Figure \ref{fig:heatmap-p75}-b illustrates the covariance matrix computed by the MCPCA algorithm with parameter $1\leq q\leq 6$. MCPCA with $q=1$ highlights some of the block diagonal structure in the latent covariance matrix. MCPCA with larger $q$ recovers all the blocks. Note that the MCPCA algorithm aims to find a covariance matrix of transformed variables with the largest Ky Fan norm and is not tailored to infer a specific hidden structure in the data. Nevertheless inferring a low rank covariance matrix often captures such hidden structures in the data.

Figure \ref{fig:heatmap-p75}-c,d shows the $q'$ Ky Fan norm for the latent covariance matrix, for the observed covariance matrix (i.e., the PCA objective value), and for covariance matrices computed by MCPCA with different $q$ values. For $q=1$, Theorem \ref{thm:q=1} provides a globally optimal solution for the MCPCA optimization. We include that solution as well as the MCPCA solution computed in Algorithm \ref{alg:sample-MCPCA}. Figure \ref{fig:heatmap-p75}-c shows that the Ky Fan norm of covariance matrices computed by MCPCA are significantly larger than the one of the PCA. In Figure \ref{fig:heatmap-p75}-d, we show the $q'$ Ky Fan norm for $q'=1,2$ for different covariance matrices. Note that the method of Theorem \ref{thm:q=1} provides a globally optimal solution for $q'$ Ky Fan norm maximization when $q'=1$, while the MCPCA Algorithm \ref{alg:sample-MCPCA} provides a locally optimal solution. In this case (Figure \ref{fig:heatmap-p75}-d, the left panel), the gap between global and local optimal values is small. Moreover for the case of $q'=2$ (Figure \ref{fig:heatmap-p75}-d, the right panel), the MCPCA solution with parameter $q=2$ is outperforming other solutions. Finally in the case considered in Figure \ref{fig:heatmap-p75}-c,d, we observe that the Ky Fan norm of the covariance matrix computed by the MCPCA algorithm is not sensitive to parameter $q$.

\begin{figure}
\centering
  \includegraphics[width=0.7\linewidth]{Fig2-new.pdf}
\caption{Performance comparison of dimensionality reduction methods on synthetic datasets. The line in the middle of each box is the median result while the tops and bottoms of each box are the 25th and 75th percentiles of the results.}
\label{fig:cmp-all}
\end{figure}

\begin{figure}
\centering
  \includegraphics[width=0.9\linewidth]{Fig3-new.pdf}
\caption{This figure demonstrates the fraction of explained variance in six datasets using top q meta features computed by PCA and MCPCA.}
\label{fig:variance}
\end{figure}

\subsection{Synthetic Continuous Data}\label{subsec:synthetic-cont-data}
Next, we compare performance of different dimensionality reduction methods including MCPCA, PCA, Isomap, LLE, multilayer autoencoders (neural networks), kernel PCA, probabilistic PCA and diffusion maps on synthetic datasets. We assess the performance of different dimensionality reduction methods based on how much sample distances in the inferred and true low dimensional spaces match with each other. More precisely, let $\mathbf{X}_{latent}\in\mathbb{R}^{n\times p}$ be a matrix whose rank is $q<p$. Let $d_{i,j}$ be the distance between sample $i$ and $j$ in the $q$ dimensional representation of $\mathbf{X}_{latent}$. Let $\mathbf{N}\in\mathbb{R}^{n\times p}$ be the noise matrix. Let $\mathbf{X}\in\mathbb{R}^{n\times p}$ be the observed data matrix whose columns are transformations of columns of the matrix $\mathbf{X}_{latent}+\mathbf{N}$. These transformations are assumed to be continuous and bijective. Let $\tilde{d}_{i,j}$ be the distance between sample $i$ and $j$ in the inferred $q$ dimensional representation of $\mathbf{X}$. We asses the performance of the dimensionality reduction method by computing the Spearman's rank correlation between $d_{i,j}$ and $\tilde{d}_{i,j}$ for $1\leq i,j\leq n$.

We generate $\mathbf{X}_{latent}$ as $\mathbf{X}_{latent}=\mathbf{U} \mathbf{V}^T$ where $\mathbf{U}\in\mathbb{R}^{n\times q}$ and $\mathbf{V}\in\mathbb{R}^{p\times q}$. Elements of $\mathbf{U}$ and $\mathbf{V}$ are generated according to a Gaussian distribution with zero mean and unit variance. In the noiseless case, $\mathbf{N}$ is an all zero matrix. In the noisy case, elements of $\mathbf{N}$ are generated according to a Gaussian distribution with zero mean and unit variance. We consider two types of transformations to generate columns of $\mathbf{X}$ using columns of the matrix $\mathbf{X}_{latent}+\mathbf{N}$: (i) a polynomial transformation where for each variable we randomly select a transformation from the set $\{\mathbf{x},\mathbf{x}^3,\mathbf{x}^5\}$, and (ii) a piecewise linear transformation according to Definition \ref{def:piecewise-linear} where $w_{j+1}-w_{j}$ has an exponential distribution with parameter $100$. The positions of knots are chosen so that each bin has equal number of samples.

We use default parameters for different dimensionality reduction methods. IsoMap and LLE have a parameter $N_{ngbr}$ which determines the number of neighbors considered in their distance graphs. $N_{ngbr}$ is set to be 12. Moreover for the continuous data, MCPCA has a parameter $d$ which restricts the optimization to a set of piecewise linear functions with degree $d$. We set $d=10$. For other methods we use implementations of reference \cite{van2009dimensionality}. Experiments have been repeated 10 times in each case.

In Figure \ref{fig:cmp-all}-a we consider a relatively easy setup where $p=20$, $q=1$, transformation functions are polynomials, and there is no added noise to observed samples. In this setup, all methods except LLE and kernel PCA have good performance. Gaussian kernel PCA performed poorly in these experiments. Thus, we only illustrate performance of polynomial kernel PCA in this figure. It further highlights sensitivity of kernel PCA to the model setup. In Figure \ref{fig:cmp-all}-b we consider a similar setup to the one of panel (a) but we increase $q$ to be 5. MCPCA continues to have a good performance while the performance of other methods drop significantly. Next, we increase $p$ to 50 and $q$ to 10. We also add noise to observed samples as described above. MCPCA continues to have a good performance outperforming all other methods (Figure \ref{fig:cmp-all}-c). In Figure \ref{fig:cmp-all}-d we change nonlinear transformations from polynomials to piecewise linear functions compared to panel (c). Again, in this setup MCPCA outperforms all other methods. These experiments highlight robustness of MCPCA against model parameters and noise. Performance of other methods appears to be sensitive to these factors.

\begin{table}[t]
\centering
\resizebox{0.9\textwidth}{!}{\begin{minipage}{\textwidth}
  \begin{tabular}{ | c | c | c | c| c| }
    \hline
     \text{Data Set}& \# \text{of samples} $(n)$ &\# \text{of features} $(p)$ &\# of \text{of classes}& \text{class distribution}  \\ \hline
    \text{Breast Cancer} & 683 & 9 & 2 & (239,444) \\ \hline
    \text{Gene Splicing} & 3,175 & 60 & 2 & (1527,1648) \\ \hline
    \text{Dermatology} & 366 & 33 & 6 & (112,61,72,49,52,20) \\ \hline
    \text{Adult Income} & 30,162 & 14 & 2 & (7508,22654) \\ \hline
    \text{Parkinsons Disease} & 195 & 22 & 2 & (48,147) \\ \hline
    \text{Diabetic Retinopathy} & 1,151 & 19 & 2 & (540,611) \\ \hline
  \end{tabular}\caption{Properties of data sets considered in Section \ref{subsec:real-data}. \label{tab:dataset-prop}}
\end{minipage} }
\end{table}

\subsection{Real Data Analysis}\label{subsec:real-data}
Having illustrated effectiveness of MCPCA on synthetic datasets, we apply it to real datasets. We consider six data sets from the UCI machine learning repository data sets \cite{UCI}, namely breast cancer data set, gene splicing data set, dermatology data set, adult income data set, parkinsons disease data set, and diabetic retinopathy data set. These data sets have been chosen to span various types of input data. Some of them have discrete features, some have continuous features, while some have mixed discrete and continuous features. The number of samples ($n$) and the number of features ($p$) vary across these data sets. Samples in five of these data sets have binary labels while in one of them the number of sample classes is six. Basic properties of these data sets have been summarized in Table \ref{tab:dataset-prop}. Below we explain some of these  properties with more details:
\begin{itemize}
  \item The breast cancer data set has 683 individuals with breast cancer, among which 444 are benign and 239 are malignant (we remove 16 samples with missing values from the original data set.). Attributes in this data set include features such as clump thickness, uniformity of cell size, mitoses, etc. Values of these features are discrete in the set of $\{1,2,...,10\}$. For more information about this data set, see \cite{breast}.
  \item The gene splicing data set has 3,175 samples \footnote{We use the processed data provided in \url{http://www.cs.toronto.edu/~delve/data/datasets.html}}. Each sample is a 60 base pair subset of genome. The goal is to classify two types of splice junctions in DNA sequences: exon/intron (EI) or intron/exon (IE) sites.  Values of features are discrete in the set of $\{A,G,C,T\}$. For more information about this data set, see \cite{UCI}.
  \item The dermatology data set has 366 samples and 33 features (we ignore the age feature from the original data since it has missing values.). The classification of erythemato-squamous diseases is a difficult task in dermatology since they share clinical features of erythema and with similar scaling. This data set have samples with six diseases: psoriasis, seboreic dermatitis, lichen planus, pityriasis rosea, cronic dermatitis, and pityriasis rubra pilaris. The number of samples of each disease are 112, 61, 72, 49, 52, 20, respectively. Features include 12 clinical features and 21 histopathological features. Variables are discrete whose alphabet sizes are 2 (for one feature), 3 (for one feature), and 4 (for 31 features). For more information about this data set, see \cite{derm}.
  \item The adult income data set is the largest data set we consider in this section. It has 30,162 samples (after removing samples from the original training data with missing values.). The task is to classify individuals to two groups based on their income. This data set includes 22,654 individuals with income $\leq 50,000\$$ and $7,508$ individuals with income $>50,000\$$. Features include variables such as age, sex, race, education, work class, capital gain, capital loss, hours per week, etc. All features except one has fewer than 120 distinct alphabet values. For more information about this data set, see \cite{adult}.
  \item The parkinsons disease data set has 195 samples where 47 of them come from healthy individuals and 147 of them come from parkinsons patients. Each feature is a particular voice measure such as average vocal fundamental frequency, measures of variation in amplitude, measures of frequency variation, etc. Features are continuous with alphabet sizes ranges from 20 to 195. For more information about this data set, see \cite{parkinsons}.
  \item The diabetic retinopathy data set has 1,151 samples where 540 samples have no signs of the disease. The data contains 19 features extracted from the messidor image set to predict whether an image contains signs of diabetic retinopathy or not. The alphabet size of features range from 2 to 1,151. For more information on this data set, see \cite{diabetics}.
\end{itemize}

PCA and MCPCA aim to maximize the amount of explained variance in the data (or in the transformation of the data) using low dimensional features. PCA restricts its optimization to merely linear transformations while MCPCA considers a more general family of nonlinear transformation functions. More precisely, let $\mathbf{K}_{(\phi_1,...,\phi_p)}\in\mathbb{R}^{p\times p}$ be the covariance matrix of transformations of variables. Then $\frac{1}{p}\sum_{r=1}^{q}\lambda_r(\mathbf{K}_{\phi_1,...,\phi_p})$ is the fraction of explained variance in the transformation of the data using its optimal $q$ dimensional representation. We normalize features to have zero means and unit variances.

We perform a two-fold cross validation analysis: we choose half of the data uniformly randomly for training. Then we test performance of the methods in the remaining half of the data. In discrete data sets (i.e., breast cancer, gene splicing and dermatology data sets) we use sample MCPCA Algorithm \ref{alg:sample-MCPCA} to compute optimal transformations of features in the training data for each $q$ value. Then, we apply those transformations to the test data. In the adult income data set all features except one has fewer than 120 distinct alphabet values. For the only continuous feature in this data set we use $d=120$.  In continuous data sets (i.e., Parkinsons disease and diabetic retinopathy data sets) we use the procedure explained in Section \ref{subsec:comp-cont}. In these experiments $d=10$ is fixed. We repeat each experiment 10 times.

\begin{figure}
\centering
  \includegraphics[width=0.8\textwidth]{Fig4-new.pdf}
\caption{This figure illustrates the correlation between the top meta feature and phenotype for five datasets with binary phenotypes. }
\label{fig:corr-cross}
\end{figure}

Figure \ref{fig:variance} shows the fraction of explained variance using top $q$ meta features computed by PCA and MCPCA in a two-fold cross validation analysis. In breast cancer and adult income datasets MCPCA significantly outperforms PCA for all values of $q$, while in other datasets their performance is comparable. The fact that MCPCA shows higher or comparable performance to PCA in holdout datasets indicates that MCPCA captures meaningful nonlinear correlations among features whenever they exist.

Next, we examine how predictive of phenotype extracted meta features are. Similarly to the previous experiment we use a two-fold cross validation analysis. We choose half of samples uniformly randomly to train the methods, and test their performance in the remaining half. We repeat each experiment 10 times. In continuous data sets, we consider $d\in\{1,5,10,15\}$. For the Isomap in the training phase we consider $N_{ngbr}\in\{10,15,20\}$. In the Isomap case, since the method does not have the so-called {\it parametric out-of-sample} property \cite{van2009dimensionality} (meaning that we cannot use the low dimensional embedding of the training data to compute a low dimensional embedding of the test data), we run the method on the test data using optimal parameters learned in the training step. This issue occurs in other nonlinear dimensionality reduction methods. In those cases we run the methods in the test data using their default parameters \cite{van2009dimensionality}.

Figure \ref{fig:corr-cross} shows the correlation between the top extracted meta feature using different dimensionality reduction methods and phenotype. The implementation of LLE crashed in these experiments, thus excluded from this figure. In all cases MCPCA consistently outperforms all other methods in different ranges of correlation between the meta feature and phenotype. For example, correlation between the meta feature and phenotype is high in the breast cancer dataset, is average in the adult income dataset, and is low in gene splicing and diabetic retinopathy datasets. Nevertheless, in all cases MCPCA shows a significant gain over all other methods.

\section{Discussion}
Here we introduced Maximally Correlated Principal Component Analysis (MCPCA) as a multivariate extension of maximal correlation and a generalization of PCA. MCPCA computes, possibly nonlinear, transformations of variables whose covariance matrix has the largest Ky Fan norm. MCPCA resolves two weaknesses of PCA by considering nonlinear correlations among features and being suitable for both continuous and categorical data. Although the MCPCA optimization is non-convex, we characterized its global optimizers for nonlinear functions of jointly Gaussian variables, and for categorical variables under some conditions. For general categorical variables, we proposed a block coordinate descend algorithm and showed its convergence to stationary points of the MCPCA optimization. Given the widespread applicability of PCA and the improved and robust performance of MCPCA compared to state-of-the-art dimensionality reduction methods, we expect the proposed method to find broad use in different areas of science. Moreover, techniques developed for efficiently optimizing feature transformations over a broad family of linear and nonlinear functions can be employed in several other statistical and machine learning problems such as nonlinear regression and deep learning.

Machine Learning (stat.ML); Information Theory (cs.IT); Machine Learning (cs.LG)