public class Probability extends Object
Modifier and Type | Method and Description |
---|---|
static double[] |
auxzbr(double x0,
double x1,
String function,
Class[] argTypes,
double par,
int npar1,
int npar2)
yields two numbers which enclose a zero of the inputted function.
|
static double |
auxzfn(double x0,
double x1,
String function,
Class[] argTypes,
double par,
int npar1,
int npar2,
double epsiln)
Determines numerically a zero of the inputted function, enclosed by x0 and x1.
|
static double |
normalDensity(double x,
double x0,
double sigma)
Returns the normal density with the specified parameters.
|
static double |
normalDistribution(double x,
double x0,
double sigma)
Returns normal distribution.
|
static double |
normalQuantile(double p,
double x0,
double sigma)
Computes the quantile of the normal distribution.
|
static byte |
signProd(double x,
double y)
returns sign(xy).
|
static double |
standardNormalDensity(double x)
Standard normal density function.
|
static double |
standardNormalDistribution(double x)
standard normal distribution.
|
static double |
standardNormalQuantile(double p)
Standard normal quantile.
|
static double |
studentDensity(double x,
int n)
Student t-density function for n degrees of freedom.
|
static double |
studentDistribution(double x,
int n)
Student t-distribution function of n degrees of freedom.
|
static double |
studentQuantile(double p,
int n)
Computes the quantile of the Student t-distribution.
|
static double |
szstnr(double x,
double p)
Returns p minus the cumulative standardized normal of x.
|
static double |
szstud(double x,
double p,
int n)
returns p minus the cumulative Student distribution of (x, n).
|
public static double normalDensity(double x, double x0, double sigma)
x
- the current valuex0
- the average valuesigma
- the standard deviationpublic static double normalDistribution(double x, double x0, double sigma)
x
- the current valuex0
- the average valuesigma
- the standard deviationpublic static double normalQuantile(double p, double x0, double sigma)
p
- probabilityx0
- widthsigma
- standard deviationpublic static double standardNormalDensity(double x)
x
- value of random variablepublic static double standardNormalDistribution(double x)
x
- value of random variablepublic static double standardNormalQuantile(double p)
p
- the probability of the quantilepublic static double studentDensity(double x, int n)
( 1 + t^2/n )^{-(n+1)/2} f(x) = --------------------------. B(.5, .5*n) sqrt{n}where B denotes the
beta function
.x
- independent variablen
- degrees of freedomNumbers.beta(double,double)
public static double studentDistribution(double x, int n)
x
- a real numbern
- degrees of freedom of the Student t-distributionstudentDensity(double,int)
public static double studentQuantile(double p, int n)
p
- the probabilityn
- degrees of freedom of the Student t-distributionstudentDensity(double,int)
public static double szstnr(double x, double p)
x
- a random variable valuep
- a probabilitypublic static double szstud(double x, double p, int n)
x
- a random variable valuep
- a probabilityn
- degrees of freedompublic static double[] auxzbr(double x0, double x1, String function, Class[] argTypes, double par, int npar1, int npar2) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
x0
- first x-value in whose neighborhoood the zero is supposedx1
- second x-value in whose neighborhoood the zero is supposedfunction
- name of function to be considered (must be declared public!)argTypes
- types of the argumentspar
- parameter of the functionnpar1
- parameter of the functionnpar2
- parameter of the functionClassNotFoundException
- if the arguments are not correctNoSuchMethodException
- if the arguments are not correctIllegalAccessException
- if the arguments are not correctInvocationTargetException
- if the arguments are not correctpublic static double auxzfn(double x0, double x1, String function, Class[] argTypes, double par, int npar1, int npar2, double epsiln) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
x0
- first x-value in whose neighborhoood the zero is supposedx1
- second x-value in whose neighborhoood the zero is supposedfunction
- name of function to be considered; it has to be either
implemented in the actual class, or referred to with its full path nameargTypes
- types of the argumentspar
- parameter of the functionnpar1
- parameter of the functionnpar2
- parameter of the functionepsiln
- accuracy of approximationClassNotFoundException
- if the arguments are not correctNoSuchMethodException
- if the arguments are not correctIllegalAccessException
- if the arguments are not correctInvocationTargetException
- if the arguments are not correctpublic static byte signProd(double x, double y)
x
- a real numbery
- a real number