public final class WatsonDistribution extends java.lang.Object implements AxialDistribution
9.4.2 of Mardia and Jupp ("Directional Statistics", Wiley, 2000)
Constructor and Description |
---|
WatsonDistribution(Vector3D mean,
double k,
java.util.Random r) |
WatsonDistribution(Vector3D mean,
java.util.Random r) |
Modifier and Type | Method and Description |
---|---|
double |
concentration() |
static double |
hyper1F1(double a,
double b,
double x,
double eps)
Computes the confluent hypergeometric function of the first kind, M(a,b,x).
|
static double |
logHyper1F1(double a,
double b,
double x,
double eps) |
double |
logPDF(Vector3D x)
Evaluate the pdf of the distribution.
|
double |
logPDF(Vector3D x,
double k)
Evaluate the pdf of the distribution.
|
static double |
logPDF(Vector3D mean,
Vector3D x,
double k)
Evaluate the pdf of any Watson distribution.
|
Vector3D |
meanAxis() |
Vector3D |
nextVector()
Gets the next Vector from the distribution.
|
Vector3D |
nextVector(double k) |
static Vector3D |
nextVector(double meanTheta,
double meanPhi,
double k,
java.util.Random ran) |
Vector3D |
nextVector(Vector3D mean,
double k) |
static Vector3D |
nextVector(Vector3D mean,
double k,
java.util.Random r) |
double |
pdf(Vector3D x)
Evaluate the pdf of the distribution.
|
double |
pdf(Vector3D x,
double k)
Evaluate the pdf of the distribution.
|
static double |
pdf(Vector3D mean,
Vector3D x,
double k)
Evaluate the pdf of any Watson distribution.
|
static double |
sumLogPDF(Vector3D mean,
Vector3D[] x,
double k)
Calculate the log likelihood of a set of axes.
|
public WatsonDistribution(Vector3D mean, java.util.Random r)
mean
- the mean direction of a bipolar distribution
(or polar direction of a girdle distribution).public WatsonDistribution(Vector3D mean, double k, java.util.Random r)
mean
- the mean direction of a bipolar distribution
(or polar direction of a girdle distribution).k
- the concentration that will be used if the no-arg nextVector() is called.public double pdf(Vector3D x)
pdf
in interface AxialDistribution
x
- a unit vector on the unit sphere.public double logPDF(Vector3D x)
x
- a unit vector on the unit sphere.public double pdf(Vector3D x, double k)
x
- a unit vector on the unit sphere.k
- the concentration parameter of the distribution.public double logPDF(Vector3D x, double k)
x
- a unit vector on the unit sphere.k
- the concentration parameter of the distribution.public static double pdf(Vector3D mean, Vector3D x, double k)
mean
- the mean axis of the distribution.x
- a unit vector on the unit sphere.k
- the concentration parameter of the distribution.public static double logPDF(Vector3D mean, Vector3D x, double k)
mean
- the mean axis of the distribution.x
- a unit vector on the unit sphere.k
- the concentration parameter of the distribution.public static double sumLogPDF(Vector3D mean, Vector3D[] x, double k)
mean
- the mean axis of the distribution.x
- an array of unit vectors.k
- the concentration parameter of the distribution.public Vector3D meanAxis()
public double concentration()
public Vector3D nextVector()
AxialDistribution
nextVector
in interface AxialDistribution
public Vector3D nextVector(double k)
k
- the concentration parameter.public static Vector3D nextVector(double meanTheta, double meanPhi, double k, java.util.Random ran)
public static double hyper1F1(double a, double b, double x, double eps)
eps
- the maximum fractional error. The function will return when the series
has converged to within this amount.
This is taken, with some modification from Thompson, "Atlas for computing mathematical functions:
an illustrated guide for practitioners, with programs in C and Mathematica" (Wiley, 1997)public static double logHyper1F1(double a, double b, double x, double eps)