edu.ucla.stat.SOCR.util
Class AnalysisUtility
java.lang.Object
edu.ucla.stat.SOCR.util.AnalysisUtility
public class AnalysisUtility
- extends java.lang.Object
Method Summary |
static boolean |
dataColinear(double[] x,
double[] y)
|
static double[] |
diff(double[] data)
|
static Matrix |
eliminationGaussJordan(Matrix matrixInput)
|
static java.lang.String |
enhanceSmallNumber(double original)
|
static int |
factorial(int input)
|
static java.math.BigInteger |
factorialBigInt(int input)
|
static double |
functionRootBrentDekker(double a,
double b,
MathFunction f,
double tol)
Computes a root of the function using the Brent-Dekker method. |
static byte[][] |
getDummyMatrix(java.lang.String[] groups)
|
static double[] |
getGenericNormalQuantile(double mean,
double sd,
int m)
|
static double |
getNormalCriticalPoint(double alpha)
|
static double[] |
getNormalQuantile(int m)
|
static double[] |
getQuantileArray(double[] input)
|
static java.util.HashMap<java.lang.String,java.lang.Object> |
getResidualNormalQuantiles(double[] residual,
int degreesFreedom)
|
static DataCase[] |
getSortedRedidual(double[] residual)
|
static double[] |
getStandardizedResidual(DataCase[] residual,
int df)
|
static double[] |
getStandardizedResidual(double[] residual,
int degreesFreedom)
|
static double[] |
getStandardNormalQuantile(int m)
|
static double |
getStudentTCriticalPoint(double alpha,
int df)
|
static Matrix |
inverse(Matrix matrix)
|
static java.util.LinkedHashSet<java.lang.String> |
levelFactor(java.lang.String[] x)
|
static java.util.TreeSet<java.lang.String> |
levelFactorTree(java.lang.String[] x)
|
static void |
main(java.lang.String[] args)
|
static double |
mean(double[] data)
|
static double |
meanSquaredError(double[] data,
int degreesFreedom)
|
static java.math.BigInteger |
product(java.math.BigInteger[] data)
|
static double |
product(double[] data)
|
static double |
sampleCorrelation(double[] dataX,
double[] dataY)
|
static double |
sampleCovariance(double[] dataX,
double[] dataY)
|
static double |
sampleVariance(double[] data)
|
static double |
sum(double[] data)
|
static double |
sumOfSquares(double[] data)
|
static double |
sumPossitiveIntegerSequenceFromOne(int end)
|
static double |
sumPossitiveIntegerSequencePartial(int start,
int end)
|
static java.lang.String[][] |
truncateDigits(double[][] input,
int numberDigits)
|
static java.lang.String[] |
truncateDigits(double[] input,
int numberDigits)
|
static java.lang.String |
truncateDigits(double input,
int numberDigits)
CODE EXAMPLE |
static double |
variance(double[] data)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PRECISION_TOLERANCE
public static final double PRECISION_TOLERANCE
- See Also:
- Constant Field Values
closeToZero
public static final java.lang.String closeToZero
- See Also:
- Constant Field Values
HIGH_CORRELATION
public static final double HIGH_CORRELATION
- See Also:
- Constant Field Values
NUMBER_OF_DUMMY_DIGITS
public static final int NUMBER_OF_DUMMY_DIGITS
- See Also:
- Constant Field Values
AnalysisUtility
public AnalysisUtility()
sum
public static double sum(double[] data)
throws DataIsEmptyException
- Throws:
DataIsEmptyException
product
public static java.math.BigInteger product(java.math.BigInteger[] data)
throws DataIsEmptyException
- Throws:
DataIsEmptyException
product
public static double product(double[] data)
throws DataIsEmptyException
- Throws:
DataIsEmptyException
mean
public static double mean(double[] data)
throws DataIsEmptyException
- Throws:
DataIsEmptyException
diff
public static double[] diff(double[] data)
throws DataIsEmptyException
- Throws:
DataIsEmptyException
sumOfSquares
public static double sumOfSquares(double[] data)
throws DataIsEmptyException
- Throws:
DataIsEmptyException
sampleVariance
public static double sampleVariance(double[] data)
throws DataIsEmptyException
- Throws:
DataIsEmptyException
variance
public static double variance(double[] data)
throws DataIsEmptyException
- Throws:
DataIsEmptyException
meanSquaredError
public static double meanSquaredError(double[] data,
int degreesFreedom)
throws DataIsEmptyException
- Throws:
DataIsEmptyException
sampleCovariance
public static double sampleCovariance(double[] dataX,
double[] dataY)
throws DataIsEmptyException
- Throws:
DataIsEmptyException
sampleCorrelation
public static double sampleCorrelation(double[] dataX,
double[] dataY)
throws DataIsEmptyException
- Throws:
DataIsEmptyException
getNormalQuantile
public static double[] getNormalQuantile(int m)
getStandardNormalQuantile
public static double[] getStandardNormalQuantile(int m)
getGenericNormalQuantile
public static double[] getGenericNormalQuantile(double mean,
double sd,
int m)
getQuantileArray
public static double[] getQuantileArray(double[] input)
getResidualNormalQuantiles
public static java.util.HashMap<java.lang.String,java.lang.Object> getResidualNormalQuantiles(double[] residual,
int degreesFreedom)
getSortedRedidual
public static DataCase[] getSortedRedidual(double[] residual)
getStandardizedResidual
public static double[] getStandardizedResidual(DataCase[] residual,
int df)
throws DataIsEmptyException
- Throws:
DataIsEmptyException
getStandardizedResidual
public static double[] getStandardizedResidual(double[] residual,
int degreesFreedom)
throws DataIsEmptyException
- Throws:
DataIsEmptyException
levelFactorTree
public static java.util.TreeSet<java.lang.String> levelFactorTree(java.lang.String[] x)
levelFactor
public static java.util.LinkedHashSet<java.lang.String> levelFactor(java.lang.String[] x)
getDummyMatrix
public static byte[][] getDummyMatrix(java.lang.String[] groups)
inverse
public static Matrix inverse(Matrix matrix)
eliminationGaussJordan
public static Matrix eliminationGaussJordan(Matrix matrixInput)
factorialBigInt
public static java.math.BigInteger factorialBigInt(int input)
factorial
public static int factorial(int input)
sumPossitiveIntegerSequencePartial
public static double sumPossitiveIntegerSequencePartial(int start,
int end)
sumPossitiveIntegerSequenceFromOne
public static double sumPossitiveIntegerSequenceFromOne(int end)
enhanceSmallNumber
public static java.lang.String enhanceSmallNumber(double original)
dataColinear
public static boolean dataColinear(double[] x,
double[] y)
truncateDigits
public static java.lang.String truncateDigits(double input,
int numberDigits)
- CODE EXAMPLE
truncateDigits
public static java.lang.String[] truncateDigits(double[] input,
int numberDigits)
truncateDigits
public static java.lang.String[][] truncateDigits(double[][] input,
int numberDigits)
getNormalCriticalPoint
public static double getNormalCriticalPoint(double alpha)
getStudentTCriticalPoint
public static double getStudentTCriticalPoint(double alpha,
int df)
functionRootBrentDekker
public static double functionRootBrentDekker(double a,
double b,
MathFunction f,
double tol)
- Computes a root of the function using the Brent-Dekker method.
- Parameters:
a
- left endpoint of initial intervalb
- right endpoint of initial intervalf
- the function which is evaluatedtol
- accuracy goal
- Returns:
- double x, the root, where f(x)=0
main
public static void main(java.lang.String[] args)