public class Maths extends java.lang.Object implements RevisionHandler
Modifier and Type | Field and Description |
---|---|
static int |
chisqDistribution
Distribution type: chi-squared
|
static double |
logPSI
The constant - log( sqrt(2 pi) )
|
static int |
normalDistribution
Distribution type: noraml
|
static double |
PSI
The constant 1 / sqrt(2 pi)
|
static int |
undefinedDistribution
Distribution type: undefined
|
Constructor and Description |
---|
Maths() |
Modifier and Type | Method and Description |
---|---|
static double |
dchisq(double x)
Returns the density of the Chi-squared distribution.
|
static double |
dchisq(double x,
double ncp)
Returns the density of the noncentral Chi-squared distribution.
|
static DoubleVector |
dchisq(double x,
DoubleVector ncp)
Returns the density of the noncentral Chi-squared distribution.
|
static double |
dchisqLog(double x)
Returns the log-density of the noncentral Chi-square distribution.
|
static double |
dchisqLog(double x,
double ncp)
Returns the log-density value of a noncentral Chi-square distribution.
|
static DoubleVector |
dchisqLog(double x,
DoubleVector ncp)
Returns the log-density of a set of noncentral Chi-squared
distributions.
|
static double |
dnorm(double x)
Returns the density of the standard normal.
|
static double |
dnorm(double x,
double mean,
double sd)
Returns the density value of a standard normal.
|
static DoubleVector |
dnorm(double x,
DoubleVector mean,
double sd)
Returns the density values of a set of normal distributions with
different means.
|
static double |
dnormLog(double x)
Returns the log-density of the standard normal.
|
static double |
dnormLog(double x,
double mean,
double sd)
Returns the log-density value of a standard normal.
|
static DoubleVector |
dnormLog(double x,
DoubleVector mean,
double sd)
Returns the log-density values of a set of normal distributions with
different means.
|
java.lang.String |
getRevision()
Returns the revision string.
|
static double |
hypot(double a,
double b)
sqrt(a^2 + b^2) without under/overflow.
|
static double |
pchisq(double x)
Returns the cumulative probability of the Chi-squared distribution
|
static double |
pchisq(double x,
double ncp)
Returns the cumulative probability of the noncentral Chi-squared
distribution.
|
static DoubleVector |
pchisq(double x,
DoubleVector ncp)
Returns the cumulative probability of a set of noncentral Chi-squared
distributions.
|
static double |
pnorm(double x)
Returns the cumulative probability of the standard normal.
|
static double |
pnorm(double x,
double mean,
double sd)
Returns the cumulative probability of a normal distribution.
|
static DoubleVector |
pnorm(double x,
DoubleVector mean,
double sd)
Returns the cumulative probability of a set of normal distributions
with different means.
|
static DoubleVector |
rchisq(int n,
double ncp,
java.util.Random random)
Generates a sample of a Chi-square distribution.
|
static DoubleVector |
rnorm(int n,
double mean,
double sd,
java.util.Random random)
Generates a sample of a normal distribution.
|
static double |
square(double x)
Returns the square of a value
|
public static final double PSI
public static final double logPSI
public static final int undefinedDistribution
public static final int normalDistribution
public static final int chisqDistribution
public static double hypot(double a, double b)
public static double square(double x)
x
- public static double pnorm(double x)
x
- the quantilepublic static double pnorm(double x, double mean, double sd)
x
- the quantilemean
- the mean of the normal distributionsd
- the standard deviation of the normal distribution.public static DoubleVector pnorm(double x, DoubleVector mean, double sd)
x
- the vector of quantilesmean
- the means of the normal distributionssd
- the standard deviation of the normal distribution.public static double dnorm(double x)
x
- the quantilepublic static double dnorm(double x, double mean, double sd)
x
- the quantilemean
- the mean of the normal distributionsd
- the standard deviation of the normal distribution.public static DoubleVector dnorm(double x, DoubleVector mean, double sd)
x
- the quantilemean
- the means of the normal distributionssd
- the standard deviation of the normal distribution.public static double dnormLog(double x)
x
- the quantilepublic static double dnormLog(double x, double mean, double sd)
x
- the quantilemean
- the mean of the normal distributionsd
- the standard deviation of the normal distribution.public static DoubleVector dnormLog(double x, DoubleVector mean, double sd)
x
- the quantilemean
- the means of the normal distributionssd
- the standard deviation of the normal distribution.public static DoubleVector rnorm(int n, double mean, double sd, java.util.Random random)
n
- the size of the samplemean
- the mean of the normal distributionsd
- the standard deviation of the normal distribution.random
- the random streampublic static double pchisq(double x)
x
- the quantilepublic static double pchisq(double x, double ncp)
x
- the quantilencp
- the noncentral parameterpublic static DoubleVector pchisq(double x, DoubleVector ncp)
x
- the quantilencp
- the noncentral parameterspublic static double dchisq(double x)
x
- the quantilepublic static double dchisq(double x, double ncp)
x
- the quantilencp
- the noncentral parameterpublic static DoubleVector dchisq(double x, DoubleVector ncp)
x
- the quantilencp
- the noncentral parameterspublic static double dchisqLog(double x)
x
- the quantilepublic static double dchisqLog(double x, double ncp)
x
- the quantilencp
- the noncentral parameterpublic static DoubleVector dchisqLog(double x, DoubleVector ncp)
x
- the quantilencp
- the noncentral parameterspublic static DoubleVector rchisq(int n, double ncp, java.util.Random random)
n
- the size of the samplencp
- the noncentral parameterrandom
- the random streampublic java.lang.String getRevision()
getRevision
in interface RevisionHandler