public VonMisesFisherDistribution(double[] mean, double concentration)
: base(mean.Length)
{
if (concentration < 0)
throw new ArgumentOutOfRangeException("concentration", "Concentration parameter kappa must be non-negative.");
if (!Norm.Euclidean(mean).IsEqual(1, 1e-10))
throw new ArgumentOutOfRangeException("mean", "The mean vector must have unit length.");
this.mean = mean;
this.kappa = concentration;
int p = Dimension;
double num = Math.Pow(concentration, p / 2 - 1);
double den = Math.Pow(2 * Math.PI, p / 2) * Bessel.I(p / 2 - 1, concentration);
this.constant = num / den;
}