TITLE: Sampling from the von-Mises Fisher distribution?
QUESTION [6 upvotes]: This topic has already been tackled on this website (here). 
But, unfortunately, no clear cut answers were given. 
In (Wood,1994), there is apparently a rejection algorithm for sampling from this distribution, but I can't find it on the web.
I am thus looking for a pseudo-code (I have not much experience with sampling random variables). Many thanks!

REPLY [2 votes]: The above answer by @mic does not work if $\mu$ and $v$ are not orthogonal, because the resulting $v\sqrt{1 - w^2} + w \mu$ does not lie on the sphere in that case.
His procedure can be used with $\mu=(1,0,\ldots,0)$ and $v=(0, \tilde v)$ to enforce orthogonality, then the samples can be mapped around an arbitrary mean $\mu$ by applying a rotation matrix (this does not change the distribution).
For info, the sampling method is available in the open source Python package geomstats, and can be used with the following:
from geomstats.geometry.hypersphere import Hypersphere

sphere = Hypersphere(dim=4)

kappa = 10.
mean = sphere.random_uniform()

samples = sphere.random_von_mises_fisher(
    mu=mean, kappa=kappa, n_samples=1000)

The python code is available here.