Given the kernel matrix that characterises a central subspace, this function estimates the dimension of the subspace.

`dimhat(M)`

A single integer giving the estimated dimension.

- M
Kernel of subspace. A symmetric, non-negative definite, numeric matrix, typically obtained from

`sdr`

.

Matlab original by Yongtao Guan, translated to R by Suman Rakshit.

This function computes the maximum descent estimate of
the dimension of the central subspace with a given kernel matrix `M`

.

The matrix `M`

should be the kernel matrix of a central subspace,
which can be obtained from `sdr`

. It must be a symmetric,
non-negative-definite, numeric matrix.

The algorithm finds the eigenvalues \(\lambda_1 \ge \ldots \ge \lambda_n\) of \(M\), and then determines the index \(k\) for which \(\lambda_k/\lambda_{k-1}\) is greatest.

Guan, Y. and Wang, H. (2010)
Sufficient dimension reduction for spatial point
processes directed by Gaussian random fields.
*Journal of the Royal Statistical Society, Series B*,
**72**, 367--387.

`sdr`

, `subspaceDistance`