vonmisesmle#
- astropy.stats.vonmisesmle(data: NDArray | Quantity, axis: int | None = None, weights: NDArray | None = None) tuple[float | Quantity, float | Quantity] [source]#
Computes the Maximum Likelihood Estimator (MLE) for the parameters of the von Mises distribution.
- Parameters:
- data
ndarray
orQuantity
Array of circular (directional) data, which is assumed to be in radians whenever
data
isnumpy.ndarray
.- axis
int
, optional Axis along which the mle will be computed.
- weights
numpy.ndarray
, optional In case of grouped data, the i-th element of
weights
represents a weighting factor for each group such thatsum(weights, axis)
equals the number of observations. See [1], remark 1.4, page 22, for detailed explanation.
- data
- Returns:
- mu
float
orQuantity
The mean (aka location parameter).
- kappa
float
orQuantity
[:ref: ‘dimensionless’] The concentration parameter.
- mu
References
[1]S. R. Jammalamadaka, A. SenGupta. “Topics in Circular Statistics”. Series on Multivariate Analysis, Vol. 5, 2001.
[2]C. Agostinelli, U. Lund. “Circular Statistics from ‘Topics in Circular Statistics (2001)’”. 2015. <https://cran.r-project.org/web/packages/CircStats/CircStats.pdf>
Examples
>>> import numpy as np >>> from astropy.stats import vonmisesmle >>> from astropy import units as u >>> data = np.array([130, 90, 0, 145])*u.deg >>> vonmisesmle(data) (<Quantity 101.16894320013179 deg>, <Quantity 1.49358958737054>)