Cross Validated Asked by Swiss Army Man on December 13, 2021
Is there a way to calculate an estimate of the parameter $kappa$ from data for the von Mises distribution?
It seems very easy to do in R, http://rgm2.lab.nig.ac.jp/RGM2/func.php?rd_id=CircStats:A1inv, but python doesn’t have an A1inv function to calculate the ratio of the first and zeroth order Bessel functions of the first kind.
Yes, the Von-Mises distribution family is an exponential family, so you can find the maximum likelihood estimate of its parameters as you would for any exponential family: set the expectation parameters to the average of the sufficient statistics $T(x) = x$ whose magnitude we'll call $bar r$. You'll have to convert these parameters to your parametrization after to get $kappa$. See @mic's answer for the equation.
Just in case you're wondering how you implement @mic's solution in Python: I would use scipy.optimize to find the root of your function: the ratio of Bessel functions minus $bar r$.
Answered by Neil G on December 13, 2021
According to Banerjee et al., Clustering on the Unit Hypersphere using von Mises-Fisher Distributions (J. Mach. Learning Res. 6 (2005)), you can estimate the von Mises-Fisher parameters $mu$ and $kappa$ with maximum likelihood.
Let $x_i$ be the $n$ points in dimension $d$ from your sample.
Let $r = sum_i x_i$.
Let $overline{r} = frac{||r||_2}{n}$ (the Euclidean distance from the barycenter to the origin). Then
$$hat{mu} = frac{r}{||r||_2}$$
(the unit vector in the direction of the barycenter) and
$$hat{kappa} approx frac{overline{r}d - overline{r}^3}{1 - overline{r}^2}$$
approximates the Maximum Likelihood estimate, which to be found exactly is obtained (numerically) as the solution to
$$I_{d/2}(kappa) / I_{d/2-1}(kappa) = overline{r}.$$
$I_m$ is the modified Bessel function of the first kind of order $m$. The approximation can be used as the starting point for Newton-Raphson iteration--but the authors point out that for "high-dimensional" data this can be "quite slow" compared to the cost of computing just the approximate value.
Answered by mic on December 13, 2021
Check out the est.kappa()
function in the CircStats package for R:
Computes the maximum likelihood estimate of kappa, the concentration parameter of a von Mises distribution, given a set of angular measurements.
Answered by Mike Lawrence on December 13, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP