# An Algorithm for Maximal Correlation

Given a pair of random variables $(X,Y)$ over a product space $\mathcal{X}\times \mathcal{Y}$, the maximal correlation coefficient is defined as $$\rho_2(X;Y):=\sup\frac{\mathbb{E}[f(X)g(Y)]}{||f||_2||g||_2},$$ where supremum is taken over all pair of functions $(f,g)$ such that $\mathbb{E}[f(X)]=\mathbb{E}[g(Y)]=0$ and $f\in L^2(\mathcal{X})$ and $g\in L^2(\mathcal{Y})$.

Renyi showed that that $\rho_2(X;Y)=0$ if and only if $X$ and $Y$ are independent and $\rho_2(X;Y)=1$ if there exists a pair of functions $f$ and $g$ such that $f(X)=g(Y)$ with probability one.

I am looking for an algorithm in R or MATLAB to estimate the maximal correlation for a (discrete or continuous) given joint distribution $P_{XY}$.

• How will the joint distribution be described? Is it perhaps given by a set of data, or is it specified analytically, or maybe in some other way? – whuber Apr 23 '15 at 17:40
• This paper users.soe.ucsc.edu/~draper/… proposes an estimator. Another paper is stat.fsu.edu/techreports/M835.pdf – kjetil b halvorsen Apr 23 '15 at 17:48
• @kjetilbhalvorsen thanks a lot for these two papers. Are they appropriate for any distributions? Even continuous distributions? – SAmath Apr 27 '15 at 15:05