|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbijnum.BIJstats
public class BIJstats
BIJ statistical methods inherited from MatLab. Syntax is as close as possible to matlab. Copyright (c) 1999-2003, Michael Abramoff. All rights reserved.
| Field Summary | |
|---|---|
static float |
CI95
Conversion from standard error to confidence intervals at different significance levels. |
static float |
CI99
|
static float |
CI99_9
|
| Constructor Summary | |
|---|---|
BIJstats()
|
|
| Method Summary | |
|---|---|
static double |
accuracy(float[] table2x2)
Compute accuracy or observed proportion of overall agreement of a test for which the result is in exp and the ground truth in truth accuracy = true pos + true neg / (true neg + false pos + true pos + false neg) accuracy = (a+d) / (a+b+c+d) |
static double |
accuracyMultipleClasses(float[] exp,
float[] truth,
int n)
Compute the multiclass accuracy of a test of which the result is in exp and the ground truth in truth, where test results in multiple classifications. |
static double |
accuracyMultipleClasses(int[][] tablenxn)
Compute the accuracy of a test of which the confusion matrix is in tablenxn. |
static double |
aroc(int[][] frequencies,
int bins)
Determine area under the roc curve for an experiment that gave the frequencies given in the table. |
static double[] |
autocorr(double[] data,
int maxk)
Computes autocorrelation up to maxk for the time series data. |
static double[] |
autocov(double[] data,
int maxk)
Computes autocovariance up to maxk for the time series data. |
static double |
avg(double[] v)
Compute average of all values in vector v. |
static double |
avg(float[] v)
Compute average of all values in vector v. |
static double |
avg(float[][] m)
Compute average of all values in vector v. |
static float |
avg(float[] v,
float[] mask)
|
static float |
avgNoExtremes(float[] v,
float nrstddev)
|
static int |
binIndex(int[] histogram,
float fraction)
Compute the lowest bin into which the highest p percent of occurrences falls. |
static float |
correl(float[] a,
float[] b)
Compute the correlation of a vector with another vector b. |
static float[][] |
covariance(float[][] m,
boolean doShowProgress)
Compute the covariance matrix for a matrix of size NxM. |
static double |
erf(double x)
Compute the erf of x. |
static double |
getSignificanceLevel(double significance)
|
static java.lang.String |
getSignificanceString(double sign)
|
static int[] |
histogram(float[] v,
float min,
float d,
int n)
Compute a histogram with n bins for the vector v, each bin separated by d. |
static double |
kappa(float[] table2x2)
Compute kappa for a 2x2 table. |
static float[] |
meanColumn(float[][] m)
|
static float[] |
meanColumnT(float[][] m)
|
static double |
means(float[][] m)
|
static float |
mse(float[] a,
float[] b)
Compute Mean Square Error (or residual) of vectors a and b. |
static int |
n(float[] v)
Determine length of a vector. |
static int |
n(float[] v,
float i)
Number of occurrences of i in v. |
static int |
n(float[] v,
float[] mask)
Length of masked(v), i.e. |
static int[][] |
probfrequencies(float[] truth,
float[] exp,
int bins)
For a 2 class experiment make a table[2] for class class0 and class1 with for each class the frequencies of each probability. |
static float[] |
randomFraction(float[] v,
double fraction)
Randomly sample a fraction of the elements of vector v. |
static float[] |
residuals(float[] a,
float[] b)
Compute residuals of b versus a. |
static float |
rmse(float[] a,
float[] b)
Compute Root Mean Square Error of vectors a and b. |
static double |
sem(double estimateAB,
double estimateA,
double semA,
double estimateB,
double semB)
Compute the combined standard error of the mean of the two standard errors stderr0 and stderr1 and corresponding averages avg0 and avg1. |
static double |
sem(float[] v)
sem(1) computes the standard error of the mean of the elements of v. |
static double |
sem(float[] v,
float[] mask)
sem(2) computes the standard error of the mean of the elements of v only where the mask value is not 0. |
static float[] |
sensitivities(float[] tablenxn)
Compute sensitivities of multiclass test from a confusion matrix matrixnxn. |
static float[] |
sensitivities(float[] truth,
float[] exp,
int n)
Compute the sensitivities of a test of which the result is in exp and the ground truth in truth, for all classes n that occur in truth. |
static double |
sensitivity(float[] table2x2)
Compute sensitivity of a test of which the result is in exp and the ground truth in truth, for class c. |
static float[] |
specificities(float[] exp,
float[] truth,
int n)
Compute the specificities of a test of which the result is in exp and the ground truth in truth, for all classes n that occur in truth. |
static double |
specificity(float[] table2x2)
Compute specificity of a test of which the result is in exp and the ground truth in truth, for class c. |
static float[] |
spectrum(float[] v)
Compute the spectrum of v. |
static float |
stdev(float[] v)
Compute stdev (SQRT(var)) of all values in vector v. |
static float |
stdev(float[] v,
float[] mask)
stdev(2) computes the stddev of the elements of only where the mask value is not 0. |
static double |
sum(double[] v)
Compute average of all values in vector v. |
static double |
sum(float[] v)
sum(1) computes summation of all values in vector v. |
static double |
sum(float[][] m)
sum(1) computes summation of all values in matrix m. |
static double |
sum(float[] v,
float[] mask)
sum(2) computes the sum of the elements of vector v only where the mask value is not 0. |
static float[] |
table2x2(float[] obs0,
float[] obs1,
int c)
Make a 2x2 table for the observations obs0 and obs1, where an observation c is taken as correct. |
static int[][] |
tablenxn(float[] obs0,
float[] obs1,
int n)
Make a nxn confusion matrix for the observations obs0 and obs1, for n classes. |
static float |
thresholdFraction(float[] v,
double fraction)
|
static float |
thresholdFraction(float[] v,
float fraction)
Find the value in vector over which fraction of all values in vector lie. |
static double |
tptest(double[] data1,
double[] data2)
Perform paired Student's t-test on two data sets data1 and data2, with the the t values into t and the probabilities into prob. |
static double |
ttest(double[] data1,
double[] data2)
Perform Student's t-test on two data sets data1 and data2, with the the t values into t and the probabilities into prob. |
static double |
ttest(float[] data1,
float[] data2)
Perform Student's t-test on two data sets data1 and data2, with the the t values into t and the probabilities into prob. |
static float[] |
unitvar(float[] v)
Make a new vector of v that has zero mean and unit variance. |
static void |
unitvar(float[][] m)
Make m unit variance and zero mean with respect to all elements of m. |
static double |
var(double[] v)
Compute variance of all elements in vector v. |
static double |
var(float[] v)
Compute variance of all elements in vector v. |
static double[] |
zeromean(double[] v)
Zero the mean of all elements of v. |
static float[] |
zeromean(float[] v)
Zero the mean of all elements of v. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static float CI95
public static float CI99
public static float CI99_9
| Constructor Detail |
|---|
public BIJstats()
| Method Detail |
|---|
public static double getSignificanceLevel(double significance)
public static float[][] covariance(float[][] m,
boolean doShowProgress)
m - a matrix of float[N][M]
public static int n(float[] v)
v - float[]
public static int n(float[] v,
float i)
v - float[]i - int
public static int n(float[] v,
float[] mask)
v - float[]mask - float[]
public static float avg(float[] v,
float[] mask)
public static java.lang.String getSignificanceString(double sign)
public static float stdev(float[] v,
float[] mask)
v - a float[] vector.mask - a float[] with a value of ! 0 for all elements of v that are valid.
public static double sem(float[] v)
v - a float[] vector.
public static double sem(float[] v,
float[] mask)
v - a float[] vector.mask - a float[] with a value of ! 0 for all elements of v that are valid.
public static double sem(double estimateAB,
double estimateA,
double semA,
double estimateB,
double semB)
estimateAB - the estimate of the combination A and B (determined by either multiplication or division, don't care here).estimateA, - semA the estimate and standard deviation of estimate.estimateB, - semBV the estimate and standard deviation of estimate.
public static float avgNoExtremes(float[] v,
float nrstddev)
public static float[] meanColumnT(float[][] m)
public static float[] meanColumn(float[][] m)
public static double means(float[][] m)
public static double avg(float[] v)
v - a vector of float[]
public static double avg(float[][] m)
v - a vector of float[]
public static double avg(double[] v)
v - a vector of float[]
public static double sum(float[] v)
v - a vector of float[]
public static double sum(float[][] m)
v - a vector of float[]
public static double sum(float[] v,
float[] mask)
v - a float[] vector.mask - a float[] with a value of ! 0 for all elements of v that are valid.
public static double sum(double[] v)
v - a vector of float[]
public static double var(float[] v)
v - a vector of float[]public static void unitvar(float[][] m)
m - a vector of float[][]public static double var(double[] v)
v - a vector of float[]public static float[] unitvar(float[] v)
v - a float[] vector
public static double[] zeromean(double[] v)
v - a vector.
public static float[] zeromean(float[] v)
v - a vector.
public static float stdev(float[] v)
v - a vector of float[]
public static float thresholdFraction(float[] v,
double fraction)
public static float thresholdFraction(float[] v,
float fraction)
vector - a vector of valuesfraction - a float [0-1].
public static int[] histogram(float[] v,
float min,
float d,
int n)
v - a float[] vectormin - the lowest value for the first bin.d - the difference in value between each binn - the number of bins.
public static int binIndex(int[] histogram,
float fraction)
histogram - an int[] with the ouccrence counts for each binp - the fraction of histogram values desired.
public static float correl(float[] a,
float[] b)
a - a float[] vector.b - a float[] vector of same length.
public static float[] spectrum(float[] v)
v - a float[] vector
public static double erf(double x)
x - the argument
public static float mse(float[] a,
float[] b)
throws java.lang.IllegalArgumentException
a - a float[] vectorb - a float[] vector.
java.lang.IllegalArgumentException
public static float[] residuals(float[] a,
float[] b)
throws java.lang.IllegalArgumentException
a - a float[] vectorb - a float[] vector.
java.lang.IllegalArgumentException
public static float rmse(float[] a,
float[] b)
throws java.lang.IllegalArgumentException
a - a float[] vectorb - a float[] vector.
java.lang.IllegalArgumentException
public static double ttest(float[] data1,
float[] data2)
data1 - array of datapointsdata2 - array of datapointst - prob -
public static double[] autocov(double[] data,
int maxk)
public static double[] autocorr(double[] data,
int maxk)
public static double ttest(double[] data1,
double[] data2)
data1 - array of datapointsdata2 - array of datapoints
public static double tptest(double[] data1,
double[] data2)
data1 - array of datapointsdata2 - array of datapoints
public static float[] randomFraction(float[] v,
double fraction)
v - a vectorfraction - the fraction of elements from v to be included.
public static int[][] probfrequencies(float[] truth,
float[] exp,
int bins)
truth - float[] the reference standard classifications for each entryexp - float[] the estimate of the probability of the class being 1 for each experimentbins - the number of discrete probabilities in exp.
public static double aroc(int[][] frequencies,
int bins)
frequencies - float[][] a table of probability frequencies for each of the classes 0 and 1.
public static float[] sensitivities(float[] truth,
float[] exp,
int n)
throws java.lang.IllegalArgumentException
exp - a float[] vector of test results, where 0 <= exp[n] < n.truth - a float[] vector of ground truth, where 0 <= truth[n] < n.n - the number of classes to determine the sensitivity for.
java.lang.IllegalArgumentException
public static float[] specificities(float[] exp,
float[] truth,
int n)
throws java.lang.IllegalArgumentException
exp - a float[] vector of test results, where 0 <= exp[n] < n.truth - a float[] vector of ground truth, where 0 <= truth[n] < n.n - the number of classes to determine the sensitivity for.
java.lang.IllegalArgumentException
public static float[] table2x2(float[] obs0,
float[] obs1,
int c)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public static int[][] tablenxn(float[] obs0,
float[] obs1,
int n)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic static double kappa(float[] table2x2)
public static double accuracyMultipleClasses(float[] exp,
float[] truth,
int n)
throws java.lang.IllegalArgumentException
exp - an int[] vector of test results, where 0 <= exp[n] < n.truth - an int[] vector of ground truth, where 0 <= truth[n] < n.n - the number of classes to determine the accuracy for.
java.lang.IllegalArgumentException
public static double sensitivity(float[] table2x2)
throws java.lang.IllegalArgumentException
exp - a float[] vector of test results, where 0 <= exp[n] <= c.truth - a float[] vector of ground truth, where 0 <= truth[n] <= c.c - the class to determine sensitivity for.
java.lang.IllegalArgumentException
public static double specificity(float[] table2x2)
throws java.lang.IllegalArgumentException
exp - an int[] vector of test results, where 0 <= exp[n] <= c.truth - an int[] vector of ground truth, where 0 <= truth[n] <= c.c - the class to determine specificity for.
java.lang.IllegalArgumentException
public static double accuracy(float[] table2x2)
throws java.lang.IllegalArgumentException
table2x2 - a 2x2 table.
java.lang.IllegalArgumentException
public static double accuracyMultipleClasses(int[][] tablenxn)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public static float[] sensitivities(float[] tablenxn)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||