Hi again everyone!

So far we have implemented scipy.stats.directionalmean (https://github.com/scipy/scipy/pull/16435) which was straight forward. For circular data, the result agrees with circmean. 

Take a look at the Docs at: https://scipy.github.io/devdocs/reference/generated/scipy.stats.directionalmean.html#scipy.stats.directionalmean

API wise it was decided that Input data must be shaped as (...., n) where n denotes the dimensionality of the vector data. Then the statistic is computed over the last axis. By default, input data are also normalized to unit vectors.

Implementing the directional variance/dispersion is a bit more tricky. Unfortunately, there does not seem to be a universal definition of it in the literature. The most common definition by Mardia and Jupp is 2(1-R) where R is the mean resultant length of the input vectors. This is twice as much as for the circular variance where the definition is unambiguous.
There are two options: not implementing directional variance or to name the function directional_dispersion.

We would love to hear your thoughts on this here or in https://github.com/scipy/scipy/pull/16785 .

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