Estimating the intrinsic dimension of datasets by a minimal neighborhood information