Suppose we are in $R^3$ and we have a set of points distributed within a sphere of radius $\rho$. I want to have a measure of "density" of points in spherical shells of the sphere.
To visualize this, I draw a histogram where the $n'th$ point on the x-axis represents the $n'th$ spherical shell, covering some radius $0\leq (r_n \pm\epsilon) \leq \rho$, and the y-axis represents the number of points belonging to the corresponding shell.
Of course, this would give me a biased measure of density because shells further away from the center of the sphere have greater volume, hence more points in them, but are not necessarily denser. To remedy that, I divide the number of points in each shell by its volume $\frac{4}{3} \pi (r_2^3-r_1^3)$ where $0\leq r_1 \leq r_2 \leq \rho$ are the radial distances defining the shell.
My statistical knowledge is extremely limited, is this a proper/usual method of normalizing in this context?
To test this I distributed points uniformly in a sphere and proceeded with this method to normalize the density, and here's some graphs:
Measuring the actual number of points per spherical shell: x-axis spherical shell. y-axis number of points in it Before normalization
Now here's the same plot after normalizing as I describe above
To somebody inexperienced in dealing with data, like myself, this would mean the method is fine it just needs a lot more shells and a lot more points, and it will converge to a good measure of normalized density (i.e. it will flatten to a line). However, this is for 50,000 points and 500 shells. I ran this for 500,000 points and 1000 shells, it didn't get much better. Perhaps it's a matter of slow convergence, but I do think there seems to be a problem near the origin, as I have observed in the specific problem I'm trying to solve. Any ideas out there?
n'th
? :) The proper way to get a density would be to actually divide into 'onion rings'. Your method is a way of smoothing the density and it will not capture properly if there is a spike of high probability in one of the onion-ring bands. $\endgroup$