g01er returns the probability associated with the lower tail of the von Mises distribution between and through the function name.
Syntax
C# |
---|
public static double g01er( double t, double vk, out int ifail ) |
Visual Basic |
---|
Public Shared Function g01er ( _ t As Double, _ vk As Double, _ <OutAttribute> ByRef ifail As Integer _ ) As Double |
Visual C++ |
---|
public: static double g01er( double t, double vk, [OutAttribute] int% ifail ) |
F# |
---|
static member g01er : t : float * vk : float * ifail : int byref -> float |
Parameters
- t
- Type: System..::..DoubleOn entry: , the observed von Mises statistic measured in radians.
- vk
- Type: System..::..DoubleOn entry: the concentration parameter , of the von Mises distribution.Constraint: .
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Return Value
g01er returns the probability associated with the lower tail of the von Mises distribution between and through the function name.
Description
The von Mises distribution is a symmetric distribution used in the analysis of circular data. The lower tail area of this distribution on the circle with mean direction and concentration parameter kappa, , can be written as
where is reduced modulo so that and . Note that if then g01er returns a probability of . For very small the distribution is almost the uniform distribution, whereas for all the probability is concentrated at one point.
The method of calculation for small involves backwards recursion through a series expansion in terms of modified Bessel functions, while for large an asymptotic Normal approximation is used.
In the case of small the series expansion of Pr(: ) can be expressed as
where is the modified Bessel function. This series expansion can be represented as a nested expression of terms involving the modified Bessel function ratio ,
which is calculated using backwards recursion.
For large values of (see [Accuracy]) an asymptotic Normal approximation is used. The angle is transformed to the nearly Normally distributed variate ,
where
and is computed from a continued fraction approximation. An approximation to order of the asymptotic normalizing series for is then used. Finally the Normal probability integral is evaluated.
For a more detailed analysis of the methods used see Hill (1977).
References
Hill G W (1977) Algorithm 518: Incomplete Bessel function : The Von Mises distribution ACM Trans. Math. Software 3 279–284
Mardia K V (1972) Statistics of Directional Data Academic Press
Error Indicators and Warnings
Errors or warnings detected by the method:
On entry, and g01er returns .
Accuracy
g01er uses one of two sets of constants depending on the value of machine precision. One set gives an accuracy of six digits and uses the Normal approximation when , the other gives an accuracy of digits and uses the Normal approximation when .
Parallelism and Performance
None.
Further Comments
Using the series expansion for small the time taken by g01er increases linearly with ; for larger , for which the asymptotic Normal approximation is used, the time taken is much less.
If angles outside the region are used care has to be taken in evaluating the probability of being in a region if the region contains an odd multiple of , . The value of will be negative and the correct probability should then be obtained by adding one to the value.
Example
This example inputs four values from the von Mises distribution along with the values of the parameter . The probabilities are computed and printed.
Example program (C#): g01ere.cs