edu.ucla.stat.SOCR.util
Class BesselFunction

java.lang.Object
  extended by edu.ucla.stat.SOCR.util.BesselConstants
      extended by edu.ucla.stat.SOCR.util.BesselFunction

public class BesselFunction
extends BesselConstants

BesselFunction and Airy functions.


Field Summary
protected static double[] A_i0
          Chebyshev coefficients for exp(-x) I0(x) in the interval [0,8].
protected static double[] A_i1
          Chebyshev coefficients for exp(-x) I1(x) / x in the interval [0,8].
protected static double[] A_k0
          COEFFICIENTS FOR METHODS k0, k0e *
protected static double[] A_k1
          COEFFICIENTS FOR METHODS k1, k1e *
protected static double[] B_i0
          Chebyshev coefficients for exp(-x) sqrt(x) I0(x) in the inverted interval [8,infinity].
protected static double[] B_i1
           
protected static double[] B_k0
           
protected static double[] B_k1
           
 
Fields inherited from class edu.ucla.stat.SOCR.util.BesselConstants
big, biginv, LOGPI, MACHEP, MAXGAM, MAXLOG, MINLOG, SQRTH, SQTPI
 
Constructor Summary
protected BesselFunction()
          Makes this class non instantiable, but still let's others inherit from it.
 
Method Summary
static double i0(double x)
          Returns the modified BesselFunction function of order 0 of the argument.
static double i0e(double x)
          Returns the exponentially scaled modified BesselFunction function of order 0 of the argument.
static double i1(double x)
          Returns the modified BesselFunction function of order 1 of the argument.
static double i1e(double x)
          Returns the exponentially scaled modified BesselFunction function of order 1 of the argument.
static double in(int alpha, double y)
          Returns the modified BesselFunction function of the first kind of order nn of the argument.
static double j0(double x)
          Returns the BesselFunction function of the first kind of order 0 of the argument.
static double j1(double x)
          Returns the BesselFunction function of the first kind of order 1 of the argument.
static double jn(int n, double x)
          Returns the BesselFunction function of the first kind of order n of the argument.
static double k0(double x)
          Returns the modified BesselFunction function of the third kind of order 0 of the argument.
static double k0e(double x)
          Returns the exponentially scaled modified BesselFunction function of the third kind of order 0 of the argument.
static double k1(double x)
          Returns the modified BesselFunction function of the third kind of order 1 of the argument.
static double k1e(double x)
          Returns the exponentially scaled modified BesselFunction function of the third kind of order 1 of the argument.
static double kn(int nn, double x)
          Returns the modified BesselFunction function of the third kind of order nn of the argument.
static double y0(double x)
          Returns the BesselFunction function of the second kind of order 0 of the argument.
static double y1(double x)
          Returns the BesselFunction function of the second kind of order 1 of the argument.
static double yn(int n, double x)
          Returns the BesselFunction function of the second kind of order n of the argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

A_i0

protected static final double[] A_i0
Chebyshev coefficients for exp(-x) I0(x) in the interval [0,8]. lim(x->0){ exp(-x) I0(x) } = 1.


B_i0

protected static final double[] B_i0
Chebyshev coefficients for exp(-x) sqrt(x) I0(x) in the inverted interval [8,infinity]. lim(x->inf){ exp(-x) sqrt(x) I0(x) } = 1/sqrt(2pi).


A_i1

protected static final double[] A_i1
Chebyshev coefficients for exp(-x) I1(x) / x in the interval [0,8]. lim(x->0){ exp(-x) I1(x) / x } = 1/2.


B_i1

protected static final double[] B_i1

A_k0

protected static final double[] A_k0
COEFFICIENTS FOR METHODS k0, k0e *


B_k0

protected static final double[] B_k0

A_k1

protected static final double[] A_k1
COEFFICIENTS FOR METHODS k1, k1e *


B_k1

protected static final double[] B_k1
Constructor Detail

BesselFunction

protected BesselFunction()
Makes this class non instantiable, but still let's others inherit from it.

Method Detail

i0

public static double i0(double x)
                 throws java.lang.ArithmeticException
Returns the modified BesselFunction function of order 0 of the argument.

The function is defined as i0(x) = j0( ix ).

The range is partitioned into the two intervals [0,8] and (8, infinity). Chebyshev polynomial expansions are employed in each interval.

Parameters:
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

i0e

public static double i0e(double x)
                  throws java.lang.ArithmeticException
Returns the exponentially scaled modified BesselFunction function of order 0 of the argument.

The function is defined as i0e(x) = exp(-|x|) j0( ix ).

Parameters:
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

i1

public static double i1(double x)
                 throws java.lang.ArithmeticException
Returns the modified BesselFunction function of order 1 of the argument.

The function is defined as i1(x) = -i j1( ix ).

The range is partitioned into the two intervals [0,8] and (8, infinity). Chebyshev polynomial expansions are employed in each interval.

Parameters:
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

i1e

public static double i1e(double x)
                  throws java.lang.ArithmeticException
Returns the exponentially scaled modified BesselFunction function of order 1 of the argument.

The function is defined as i1(x) = -i exp(-|x|) j1( ix ).

Parameters:
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

j0

public static double j0(double x)
                 throws java.lang.ArithmeticException
Returns the BesselFunction function of the first kind of order 0 of the argument.

Parameters:
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

j1

public static double j1(double x)
                 throws java.lang.ArithmeticException
Returns the BesselFunction function of the first kind of order 1 of the argument.

Parameters:
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

jn

public static double jn(int n,
                        double x)
                 throws java.lang.ArithmeticException
Returns the BesselFunction function of the first kind of order n of the argument.

Parameters:
n - the order of the BesselFunction function.
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

k0

public static double k0(double x)
                 throws java.lang.ArithmeticException
Returns the modified BesselFunction function of the third kind of order 0 of the argument.

The range is partitioned into the two intervals [0,8] and (8, infinity). Chebyshev polynomial expansions are employed in each interval.

Parameters:
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

k0e

public static double k0e(double x)
                  throws java.lang.ArithmeticException
Returns the exponentially scaled modified BesselFunction function of the third kind of order 0 of the argument.

Parameters:
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

k1

public static double k1(double x)
                 throws java.lang.ArithmeticException
Returns the modified BesselFunction function of the third kind of order 1 of the argument.

The range is partitioned into the two intervals [0,2] and (2, infinity). Chebyshev polynomial expansions are employed in each interval.

Parameters:
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

k1e

public static double k1e(double x)
                  throws java.lang.ArithmeticException
Returns the exponentially scaled modified BesselFunction function of the third kind of order 1 of the argument.

k1e(x) = exp(x) * k1(x).

Parameters:
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

in

public static double in(int alpha,
                        double y)
                 throws java.lang.ArithmeticException
Returns the modified BesselFunction function of the first kind of order nn of the argument.

This is an approximate solution using the formula here: http://en.wikipedia.org/wiki/Noncentral_chi-square_distribution I_\nu(z) is a modified [[Bessel function]] of the first kind given by I_a(y) = (y/2)^a \sum_{j=0}^\infty \frac{ (y^2/4)^j}{j! \Gamma(a+j+1)} .

Parameters:
nn - the order of the BesselFunction function.
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

kn

public static double kn(int nn,
                        double x)
                 throws java.lang.ArithmeticException
Returns the modified BesselFunction function of the third kind of order nn of the argument.

The range is partitioned into the two intervals [0,9.55] and (9.55, infinity). An ascending power series is used in the low range, and an asymptotic expansion in the high range.

Parameters:
nn - the order of the BesselFunction function.
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

y0

public static double y0(double x)
                 throws java.lang.ArithmeticException
Returns the BesselFunction function of the second kind of order 0 of the argument.

Parameters:
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

y1

public static double y1(double x)
                 throws java.lang.ArithmeticException
Returns the BesselFunction function of the second kind of order 1 of the argument.

Parameters:
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException

yn

public static double yn(int n,
                        double x)
                 throws java.lang.ArithmeticException
Returns the BesselFunction function of the second kind of order n of the argument.

Parameters:
n - the order of the BesselFunction function.
x - the value to compute the bessel function of.
Throws:
java.lang.ArithmeticException