sphstat.distributions module

Functions to generate random data from different spherical distributions

  • uniform() generates samples from uniform spherical distribution

  • bingham() generates samples from uniform Bingham distribution

  • fisherbingham() generates samples from Fisher/Bingham distribution

  • kent() generates samples from Kent distribution

  • fisher() generates samples from Fisher distribution

  • watson() generates samples from Watson distribution

sphstat.distributions.bingham(numsamp: int, lamb: float) dict[source]

Generate Bingham distributed data on the unit sphere

Parameters
  • numsamp (int) – Number of samples

  • lamb (np.array) – Eigenvalyes of the diagpnal symmetric matrix of the Bingham distribution in decreasing order

Returns

Data dictionary of type ‘cart’ containing numsamp Bingham distributed data

Return type

dict

sphstat.distributions.fisher(numsamp: int, alpha: float, beta: float, kappa: float) dict[source]

Generate von Mises-Fisher distributed data on the unit sphere 1

Parameters
  • numsamp (int) – Number of samples to generate

  • alpha (float) – Inclination angle centroid (0<= alpha <=pi)

  • beta (float) – Azimuth angle centroid (0 <= beta < 2 * pi)

  • kappa (float) – Concentration parameter

Returns

Data dictionary of type ‘cart’ containing numsamp Fisher distributed data

Return type

dict

1

Fisher, N. I., Lewis, T. & Willcox, M. E. (1981). Tests of discordancy for samples from Fisher’s distribution on the sphere. Appl. Statist. 30, 230-237.

sphstat.distributions.fisherbingham(numsamp: int, alpha: float, beta: float, kappa: float, A: numpy.ndarray) dict[source]

Generate Fisher-Bingham distributed data on the unit sphere 2, 3

Parameters
  • numsamp (int) – number of samples

  • alpha (float) – Inclination angle of the mean (0 <= alpha < pi)

  • beta (float) – Azimuth angle of the mean (0 <= beta < 2 * pi)

  • kappa (float) – Concentration parameter

  • A – Symmetric matrix for the Bingham part

Returns

Data dictionary of type ‘cart’ containing numsamp FB distributed data

Return type

dict

2

Kent J.T., Ganeiber A.M. and Mardia K.V. (2013). A new method to simulate the Bingham and related distributions in directional data analysis with applications.

3

https://rdrr.io/cran/Directional/man/rfb.html

sphstat.distributions.kent(numsamp: int, kappa: float, beta: float, mu: numpy.array, mu0: numpy.array) dict[source]

Generate Kent (5-parameter Fisher-Bingham - FB5) distributed data on the unit sphere

Parameters
  • numsamp (int) – Number of samples to generate

  • kappa – Concentration parameter

  • beta – Ovalness parameter

  • mu (np.array) – Mean vector of Kent distribution

  • mu0 (np.array) – Mean vector of the Fisher part

Returns

Data dictionary of type ‘cart’ containing numsamp Kent distributed data

Return type

dict

sphstat.distributions.uniform(numsamp: int) dict[source]

Generate uniformly sampled data on the unit sphere

Parameters

numsamp (int) – Number of samples to generate

Returns

Data dictionary of type ‘cart’ containing numsamp uniformly distributed data

Return type

dict

sphstat.distributions.watson(numsamp: int, lamb: float, mu: float, nu: float, kappa: float) dict[source]

Generate Watson distributed data on the unit sphere 4

Parameters
  • numsamp (int) – Number of samples to generate

  • lamb (float) – Direction of cosines in the x-axis

  • mu (float) – Direction of cosines in the y-axis

  • nu (float) – Direction of cosines in the z-axis

  • kappa

Returns

Data dictionary of type ‘cart’ containing numsamp Watson distributed data

Return type

dict

4

Best, D. J. & Fisher, N. I. (1986). Goodness-of-fit and discordancy tests for samples from the Watson distribution on the sphere. Austral. J. Statist. 28, 13-31.