|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ucla.stat.SOCR.distributions.Functions
public final class Functions
Field Summary | |
---|---|
static int |
WITH_REPLACEMENT
|
static int |
WITHOUT_REPLACEMENT
|
Constructor Summary | |
---|---|
Functions()
|
Method Summary | |
---|---|
static double |
beta(double a,
double b)
This method returns an approximation to the beta function. |
static double |
betaCDF(double x,
double a,
double b)
The method computes the beta cumulative distribution function. |
static double |
comb(double n,
int k)
This method computes the number of combinations of a specified number of objects chosen from a population of a specified size. |
static double |
factorial(int k)
This method computes the factorial function, the number of permutations of a specified number of objects. |
static double |
gamma(double x)
This method computes the gamma function. |
static double |
gammaCDF(double x,
double a)
This method computes the cumulative distribution function of the gamma distribution with a specified shape parameter and scale parameter 1. |
static int |
getIndex(int i,
int n)
This method returns an index between 0 and n - 1, for use in error correcting in arrays. |
static double[] |
getProbabilities(double[] a)
This method takes an array of numbers and returns a probability array (nonnegatie numbers that sum to 1). |
static double |
getProbability(double p)
This method takes a real number and converts it to a probability (a number between 0 and 1). |
static int[] |
getSample(int[] p,
int n,
int t)
This method computes a sample of a specified size from a specified population and of a specified type (with or without replacement). |
static int[] |
getSample(int m,
int n,
int t)
This method computes a sample of a specified size from a population of the form 1, 2, ..., m |
static boolean |
isReal(double x)
This class method tests to see if a specified number is real. |
static double |
logGamma(double x)
This method computes the log of the gamma function. |
static double |
perm(double n,
int k)
This method computes the number of permuatations of a specified number of objects chosen from a population of a specified number of objects. |
static double[] |
sort(double[] a)
This method sorts an array of doubles. |
static int[] |
sort(int[] a)
This method sorts an array of integers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int WITHOUT_REPLACEMENT
public static final int WITH_REPLACEMENT
Constructor Detail |
---|
public Functions()
Method Detail |
---|
public static double[] getProbabilities(double[] a)
a
- the array of numbers
public static double getProbability(double p)
p
- the given number
public static int getIndex(int i, int n)
i
- the given indexn
- the specified size of the array
public static double perm(double n, int k)
n
- the population sizek
- the sample size
public static double factorial(int k)
k
- the number of objects
public static double comb(double n, int k)
n
- the population sizek
- the sample size
public static double logGamma(double x)
x
- a positive number
public static double gamma(double x)
x
- a positive number
public static double gammaCDF(double x, double a)
x
- a positive numbera
- the shape parameter
public static double betaCDF(double x, double a, double b)
x
- a number between 0 and 1a
- the left paramterb
- the right parameter
public static double beta(double a, double b)
a
- the left valueb
- the right value
public static int[] getSample(int[] p, int n, int t)
p
- the populationn
- the sample sizet
- the type (0 without replacement, 1 with replacemen);public static int[] getSample(int m, int n, int t)
m
- the population sizen
- the sample sizet
- the type (0 without replacement, 1 with replacement)public static double[] sort(double[] a)
a
- the array of doubles
public static int[] sort(int[] a)
a
- the array of integers
public static boolean isReal(double x)
x
- the number
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |