Hi again everyone,

the first milestones proposed here have been implemented:
- sampling from the hypersphere
- directional sample statistics (direction mean and mean resultant length)

I would like to propose to further add the most commonly used analogue of the normal distribution on the hypersphere: the von Mises-Fisher distribution (vMF). A reference implementations for sampling from it is available in geomstats and fitting and evaluating pdf/logpdf should not be too difficult to implement by ourselves.

Having worked with directional data a lot, I have seen many people struggle with these distributions. I do not think that all kinds of spherical distributions should become part of SciPy, but the vMF is so fundamental that it would be very valuable to the general community.

Best



Am Mo., 24. Okt. 2022 um 12:12 Uhr schrieb Daniel Schmitz <danielschmitzsiegen@googlemail.com>:
Hi again,

Yesterday a PR was opened to sample uniformly from the surface of the unit sphere: ENH: Random direction distribution by dschmitz89 · Pull Request #17277 · scipy/scipy (github.com)

The API is the following: a multivariate distribution scipy.stats.random_direction(dim) with a .rvs() method. Setting the dimension is required. The .rvs(size) method follows the convention of numpy's multivariate_normal: for size=(m, n) it will generate samples of the shape (m, n, dim).

If this sounds interesting to you, please join the discussion on github.

Best

Am So., 5. Juni 2022 um 20:09 Uhr schrieb Pamphile Roy <roy.pamphile@gmail.com>:
Hi Daniel,

I also think these would be interesting.

I am myself very interested in the sampling part, as we actually recently added poisson disk sampling which internally uses hypersphere sampling. I would be happy to help with this work.

Cheers,
Pamphile (@tupui)

On 5 Jun 2022, at 17:04, Robert Kern <robert.kern@gmail.com> wrote:


Yes, I think both have a place in scipy.stats. Thanks!

On Sun, Jun 5, 2022 at 5:55 AM Daniel Schmitz <danielschmitzsiegen@googlemail.com> wrote:
Hi everyone,

recently questions came up with regards to statistics on the unit sphere in scipy.

Issue 12041 raises the question if spherical mean/variance should be added as descriptive statistics similar to circmean/circvar . The canonical reference for all things related to statistics on the unit sphere is "Directional Statistics" by Mardia & Jupp.

Another important basic functionality is the generation of random samples on the unit sphere: discussion was started in this issue .

Any strong opinion against these? I think at least the random number generation is reimplemented every day around the world (done so myself at least 2 times) and would strongly benefit from being part of scipy.

Best
_______________________________________________
SciPy-Dev mailing list -- scipy-dev@python.org
To unsubscribe send an email to scipy-dev-leave@python.org
https://mail.python.org/mailman3/lists/scipy-dev.python.org/
Member address: robert.kern@gmail.com


--
Robert Kern
_______________________________________________
SciPy-Dev mailing list -- scipy-dev@python.org
To unsubscribe send an email to scipy-dev-leave@python.org
https://mail.python.org/mailman3/lists/scipy-dev.python.org/
Member address: roy.pamphile@gmail.com
_______________________________________________
SciPy-Dev mailing list -- scipy-dev@python.org
To unsubscribe send an email to scipy-dev-leave@python.org
https://mail.python.org/mailman3/lists/scipy-dev.python.org/
Member address: danielschmitzsiegen@googlemail.com