This is an implementation of the algorithm of Forbes and Mardia (2015) to
sample from the Bessel exponential distribution, which is the conditional
distribution of the concentration parameter of a von Mises distribution
given the mean mu. The distribution is proportional to \(exp(-
\eta g \kappa)/I_0(\kappa)^\eta\). Note that beta_0 in Forbes and
Mardia (2015) is renamed g here.
sampleKappa(etag, eta)Numeric; This is eta * g, which should
-R*cos(mu-theta_bar), where R is the posterior mean
resultant length, and theta_bar is the posterior mean, while
mu is the current value of the mean.
Integer; This is the posterior sample size, which is n + c where
c is the number of observations contained in the conjugate prior. For
uninformative, c = 0 and eta = n.
A sampled value kappa from the Bessel exponential
distribution.