Accord.Statistics.Circular.estimateKappa C# (CSharp) Method

estimateKappa() private static method

Computes the maximum likelihood estimate of kappa given by Best and Fisher (1981).

This method implements the approximation to the Maximum Likelihood Estimative of the kappa concentration parameter as suggested by Best and Fisher (1981), cited by Zheng Sun (2006) and Hussin and Mohamed (2008). Other useful approximations are given by Suvrit Sra (2009).

References: A.G. Hussin and I.B. Mohamed, 2008. Efficient Approximation for the von Mises Concentration Parameter. Asian Journal of Mathematics & Statistics, 1: 165-169. Suvrit Sra, "A short note on parameter approximation for von Mises-Fisher distributions: and a fast implementation of $I_s(x)$". (revision of Apr. 2009). Computational Statistics (2011). Available on: http://www.kyb.mpg.de/publications/attachments/vmfnote_7045%5B0%5D.pdf Zheng Sun. M.Sc. Comparing measures of fit for circular distributions. Master thesis, 2006. Available on: https://dspace.library.uvic.ca:8443/bitstream/handle/1828/2698/zhengsun_master_thesis.pdf

private static estimateKappa ( double r ) : double
r double
return double
        private static double estimateKappa(double r)
        {
            // Best and Fisher (1981) gave a simple
            //   approximation to the MLE of kappa:

            double r3 = r * r * r;

            if (r < 0.53)
            {
                double r5 = r3 * r * r;
                return (2.0 * r) + (r3) + (5.0 * r5 / 6.0);
            }

            if (r < 0.85)
            {
                return -0.4 + 1.39 * r + 0.43 / (1.0 - r);
            }

            return 1.0 / (r3 - 4 * r * r + 3 * r);

            // However, Sun (2006) mentions this estimate of k
            // is not reliable when r is small, such as when r < 0.7.
        }