本文章基本是对https://stats.stackexchange.com/questions/130998/explanation-of-formula-for-median-closest-point-to-origin-of-n-samples-from-unit 的翻译。
解决问题为Element of Statistical Learning (ESL, https://web.stanford.edu/~hastie/ElemStatLearn/)课后习题2.3.
题目简介
Consider N data points uniformly distributed in a p-dimensional unit ball centered at the origin. Suppose we consider a nearest-neighbor estimate at the origin. The median distance from the origin to the closest data point is given by the expression
简单翻译一下,p维空间有N个样本点,均匀分布。求离原点最近的点(/最近邻)到原点的距离的中值。
解答
先求最近邻距离为
k
的概率,任意一个样本点距离原点距离大于
对于连续变量,中值的意思是概率为
1/2
的点,所以解
(1−kp)N=1/2
即可得到公式:
另注:中值与期望不同,这里为了解题方便,使用中值近似整个数据集的性质。