I have a number of points in 3d space (cartesian x,y,z) and would like to fit a ellipsoid to that in order to determine the axis ratios. The issue here is that I have a distribution of points (not points on a surface), and the solutions to this problem mainly consider the points on a surface. Also would this fit be iterative (like some optimize or mcmc type method), I work in Python.
The code i am using was given in this answer: Python: fit 3D ellipsoid (oblate/prolate) to 3D points
But this does not work for me ( I think it was meant for points on the surface of an ellipsoid). But I have more density distribution of points rather than surface points.