# maximum likelihood estimation of intrinsic dimension

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

# Introduction

In dimensionality reduction (or manifold-learning), the foundation of all methods is the belief that the observed data $\left\{ \mathbf{x}_{j} \right\}$ are not truly in the high-dimensional $\mathbb{R}^{D}$. Rather, there exists a diffemorphic mapping $\varphi$ such that the data can be efficiently represented in a lower-dimensional space $\mathbb{R}^{m}$ ($0\lt m\lt D$, called intrinsic dimension) by the mapping: $\mathbf{y}=\varphi(\mathbf{x}), \mathbf{y} \in \mathbb{R}^{m}$. Most methods (such as PCA, MDS, LLE, ISOMAP, etc.) focus on recover the embedding of high-dimensional data, i.e. $\left\{ \widehat{\mathbf{y}} \right\}$. However, there is no consensus on how this intrinsic dimension $m$ should be determined.

Constructing a reliable estimator of intrinsic dimension will clearly improve the performance of dimensionality reduction methods. Even in supervised learning (such as classification) --where the intrinsic dimensionality can be determined by cross-validation-- a reliable estimate is still helpful as a guideline to reduce the computational cost of cross-validation.

The problem of estimating the intrinsic dimension is set up as the following: Suppose a set of data points $\left\{ \mathbf{y}_{j} \right\}$ are sampled i.i.d. from a smooth density $f(\mathbf{y})$ on $\mathbb{R}^{m}$, and mapped into $\mathbb{R}^{D}$ by a smooth mapping $\,\psi$, i.e. $\mathbf{x}_{j}=\psi(\mathbf{y}_{j}),\mathbf{x}_{j} \in \mathbb{R}^{D}$. The mapping $\,\psi$ is assumed to be local isometric (not necessarily globally isometric) to ensure that close points in $\mathbb{R}^{m}$ are mapped closely in $\mathbb{R}^{D}$. We only observe $\left\{ \mathbf{x}_{j} \right\}$. The low-dimensional data $\left\{ \mathbf{y}_{j} \right\}$, intrinsic dimension $m$, the density $f$ and the mapping $\psi$ are all unknown. The task is to give an estimator of $m$ based on above settings.

This paper reviewed several previous works in this topic and proposed a new estimator of intrinsic dimension. The properties of the estimator are discussed and the comparison between this estimator and others is carried out in the numeral experiments.

# Previous works

The existing methods for estimating the intrinsic dimensionality can be roughly classified into two types: eigenvalue methods (PCA-based), and geometric methods (fractal dimensions).

From Bayesian perspective, there are other studies which focus on putting prior on the intrinsic partition such as Dirichlet Process Mixture Models (See Teh, Yee Whye. <ref name="ver"> Teh, Yee Whye. "Dirichlet Process." (2010): 280-287. [1] </ref>). In the model, we assume that observed data points come from linear mixture of intrinsic points (linear transformation).

## Eigenvalue methods

PCA can be used to estimate the dimensionality of a globally linear subspace. It assumes in the high-dimensional space, only a linear subspace carries the main variability (main features), and the remaining variabilities are treated as noises. Thus, in global PCA methods, the intrinsic dimension is determined by the number of eigenvalues that are greater than a given threshold.

Global PCA would fail if the underlying manifold is nonlinear. It is intuitive to generalize the idea to local PCA (See Fukunaga and Olsen<ref>Fukunaga, K. and Olsen, D. R. An algorithm for finding intrinsic dimensionality of data. IEEE Trans. on Computers, 1971. </ref> and Bruske and Sommer<ref>Bruske, J. and Sommer, G. Intrinsic dimensionality estimation with optimally topology preserving maps. IEEE Trans. on PAMI, 20(5):572-575, 1998. </ref>). The idea is to choose a set of neighboring points (which is believed to be locally linear) for each points, and apply PCA methods to estimate the dimension of each local region, and the global dimensionality is obtained by summarizing (such as averaging) the local dimensions.

The PCA based methods are intuitive and easy to implement. But the problem is that it is quite sensitive to the choice of local regions (neighborhood size) and thresholds (See Verveer and Duin<ref name="ver">Verveer, P. and Duin, R. An evaluation of intrinsic dimensionality estimators. IEEE Trans. on PAMI, 17(1):81-86, 1995. </ref>).

## Geometric methods

The geometric methods try to reveal the intrinsic geometric structure of the observed data. They are usually based on fractal dimension, which is a generalization of topological dimension. The term fractal dimension refers to several different dimension that used to characterize fractals, such as information dimension, capacity dimension, and correlation dimension.

Compared to eigenvalue methods, geometric methods requires less data points to yield a reliable estimate (See Lee <ref name="lee">Lee, J. A. Nonlinear Dimensionality Reduction. Springer, New York, Chapter 3, 2007. </ref>). But on the other hand, the geometric methods are computationally more expensive than eigenvalue methods, and they are easier to underestimating the intrinsic dimension for high-dimensional datasets (Verveer and Duin <ref name="ver">Reference</ref>).

Clearly, another potential concern is that the geometric methods still depend on the tuning parameter $k$ or $R$.

# MLE of intrinsic dimension

The maximum likelihood estimator in general belongs to the geometric methods.

The key assumption for deriving the maximum likelihood estimator of intrinsic dimension is that: For every point $y\in \mathbb{R}^{m}$, there exists a small sphere $S_{y}(R)$ of radius $R$ around $y$, such that the density $f(y) \approx const$ within the sphere (i.e. the data points are approximately uniform in each small local region).

For the fixed point $\,x=\psi(y)$, consider the spatial point process (for more math details about spatial point process, see [2]) $\left\{ N(t,x), 0 \leq t \leq R \right\}$,

$N(t,x)=\sum^{n}_{i=1}I(\mathbf{x}_{i} \in S_{x}(t))$

which counts observations within distance $t$ from point $x$.

With the key assumption and recall the fact that we assume the mapping $\,\psi$ is local isometric, we can approximate $\,N(t,x)$ by a poisson process. For the fixed $x$, ignore the dependence of $\,N(t,x)$ on $x$ for now, the rate $\,\lambda(t)$ of $\,N(t)$:

$\,\lambda(t)=f(y)V(m)mt^{m-1}$

where $\,V(m)=\pi^{m/2}[\Gamma(m/2+1)]^{-1}$ is the volume of the unit sphere in $\mathbb{R}^{m}$. This follows the Poisson process property because $V(m)mt^{m-1}=\frac{d}{dt}(V(m)t^m)$ is the surface of $S_x(t)$.

Letting $\,\theta=\log f(y)$, we can write the log-likelihood of the observed process $N(t)$ using the product integration (for details see Snyder<ref>Snyder, D. L. Random Point Process. Wiley, New York, 1975. </ref>):

$\ell(m,\theta)=\int_{0}^{R}\log \lambda(t)dN(t)-\int_{0}^{R}\lambda(t)dt$

The MLEs for $m$ and $\theta$ exist and are unique with probability goes to 1 as the sample size goes to infinity. The likelihood equations are obtained by taking the partial derivative:

$\frac{\partial \ell}{\partial \theta}=\int_{0}^{R}dN(t)-\int_{0}^{R}\lambda(t)dt=N(R)-e^{\theta}V(m)R^{m}=0$
$\frac{\partial \ell}{\partial m}=\left( \frac{1}{m}+\frac{V^{\prime}(m)}{V(m)} \right)N(R)+\int_{0}^{R}\log t dN(t)-e^{\theta}V(m)R^{m}\left( \log R+\frac{V^{\prime}(m)}{V(m)} \right)=0$

Solving the likelihood equations gives the MLE for the intrinsic dimension $m$:

$\widehat{m}_{R}(x)=\left[ \frac{1}{N(R,x)}\sum^{N(R,x)}_{j=1}\log \frac{R}{T_{j}(x)} \right]^{-1}$

where $\,T_{j}(x)$ is the Euclidean distance from the fixed point $x$ to its $j$-th nearest neighbor in the sample.

In practice, it can be also expressed in term of the number of neighbors $k$ rather than the radius of the sphere $R$:

$\widehat{m}_{k}(x)=\left[ \frac{1}{k-1}\sum^{k-1}_{j=1}\log \frac{T_{k}(x)}{T_{j}(x)} \right]^{-1}$

Remark:

(1). This estimator is a function of a fixed point $x \in \mathbb{R}^{D}$ and the neighborhood size ($R$ or $k$), so it is an estimate of the local dimensionality at point $x$.

(2). Like almost all local methods, the choice of neighborhood size clearly affects the performance of the estimator. The general principal of choosing $k$ (or $R$) is to let the sphere to contain sufficiently many data points, and also small enough to satisfy the assumption that $\,f$ is approximately constant within the sphere.

(3). In the second formula, one may use $\frac{1}{k-2}$ instead of $\frac{1}{k-1}$ to get asymptotically unbiased estimator (details will be shown in next subsection).

(4). $\widehat{\theta}$ can be used to obtain an instant estimate of the entropy of the density $f$ (See Costa and Hero<ref>Costa, J. and Hero, A. O. Geodesic entropic graphs for dimension and entropy estimation in manifold learning. IEEE Trans. on Signal Processing, 2004. </ref>).

The (global) intrinsic dimension can be estimated by averaging the local dimensions over the whole sample:

$\widehat{m}_{k}=\frac{1}{n}\sum^{n}_{i=1}\widehat{m}_{k}(\mathbf{x}_{i})$

One naive way to make the estimator less sensitive to the choice of neighborhood size $k$ is to average over a range of different values:

$\widehat{m}_{(k_{1},k_{2})}=\frac{1}{k_{2}-k_{1}+1}\sum^{k_{2}}_{k=k_{1}}\widehat{m}_{k}$

## Asymptotic behavior of the estimator

The paper also discuss the asymptotic behavior of the estimator. Recall that if we use $k-2$ to normalize and use the estimator:

$\widehat{m}_{k}(x)=\left[ \frac{1}{k-2}\sum^{k-1}_{j=1}\log \frac{T_{k}(x)}{T_{j}(x)} \right]^{-1}$

Assuming $m$ is fixed, $n\rightarrow \infty$, $k\rightarrow \infty$, and $k/n\rightarrow 0$ (or $R\rightarrow 0$). For fixed $x$, the inhomogeneous process $\,N(t,x)$ converges weakly to the Poisson process with rate $\,\lambda(t)$, then $\,m\log(T_{k}/T_{j})$ are (asymptotically) distributed as the $j$-th order statistic of a sample (with size $k-1$) from standard exponential distribution. To a first order approximation, this gives:

$U= \frac{1}{m} \sum^{k-1}_{j=1}\log \frac{T_{k}(x)}{T_{j}(x)} \sim Gamma(k-1,1)$

We can calculate the expectation $\,E(U^{-1})=1/(k-2)$. Thus we have:

$E(\widehat{m}_{k}(x))=m$
$Var(\widehat{m}_{k}(x))=\frac{m^{2}}{k-3}$

Remarks:

(1). The estimator of global intrinsic dimension is also asymptotically (in terms of $n \rightarrow \infty$) unbiased: $E(\widehat{m}_{(k_{1},k_{2})})=E(\widehat{m}_{k})=m$. The variance of $\widehat{m}_{k}$ is tricky because of the dependence among $\widehat{m}_{k}(\mathbf{x}_{j})$. The paper argues that it can be shown the variance is of order $n^{-1}$.

(2). The above result is based on a first order approximation, as both $n,k \rightarrow \infty$, normalizing by $k-1$ or $k-2$ would both yeild asymptotically unbiased result.

# Experiments and comparison

The paper conducts several numerical experiments:

(1). The first experiment is to investigate the properties of the estimator throughout simulations. The estimator $\widehat{m}_{k}$ is plotted as a function of neighborhood size $k$ for different sample size (Fig. 1(a)) and different intrinsic dimension (Fig. 1(b)). The result is shown in figure 1.

From figure 1, we can see the effect of $n,m,k$ on the estimator. Overall, the performance of the MLE is stable and reliable. Certainly the ideal choice of tuning parameter is different for every combination of $m$ and $n$, but as can be seen clearly from Fig. 1(a), as the ratio $k/n$ increases (i.e. the data become sparse and the neighborhood size becomes relatively large), the estimator tends to underestimate the intrinsic dimension.

(2). The second experiment is on a 5-dimensional correlated Gaussian distribution wth mean 0 and covariance matrix $\sigma_{ij}=\rho$ (for $i\neq j$), the result is shown in Fig. 2(a). Futhermore, other estimators (correlation dimension, regression dimension) are applied on the same data, and the result is shown in Fig. 2(b).

(3). The last experiment is to conduct a comparison between MLE and other estimators on three popular manifold datasets: swiss roll, face image, and hand image. The result is summarized in table 1.

As can be seen, for swiss roll data (small dimension, large sample size), the MLE provide the best result among three. But as dimension increases (and sample size decreases), the MLE does not work so well.

# Discussion

(1). Under certain assumptions the MLE of intrinsic dimension has nice asymptotic properties, and the simulated data and some real dataset also show the performance of MLE is reliable (comparing to other geometric method).

(2). The MLE does NOT work so well on high-dimensional data (suffer from a negative bias), because the key assumption (sufficiently many observations within a small sphere) is always violated in real high-dimensional space (the curse of dimensionality), so it is almost impossible to find a ideal neighborhood size. The effect is similar to what has been shown in Fig. 1(a).

(3). For some datasets, such as points in a unit cube, there is also the issue of edge effects, which will also cause the negative bias. One can potentially reduce the bias by removing the edge points by some criterion. However, the author claims that the edge effects are small compared to the sample size problem.

(4). The paper uses Poisson distribution assumption and in order to use MLE, they assume that all the sample points share the same parameter. However, the density around each sample points is different for real data. This might affect the estimation of dimensionality.

<references />