|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.strbio.math.IVector org.strbio.math.Bin org.strbio.math.Bin2D
public class Bin2D
This saves samples pairs of data, and remembers some stats about the y values for each bin.
Version 1.2, 10/5/00 - added more stats Version 1.1, 4/1/99 - changed main() to not require min, max values... if not given, goes through the data twice Version 1.0, 9/29/98 - original version
Field Summary | |
---|---|
Sampler[] |
bin_stats
|
protected double |
sum_xy
|
Sampler |
ySampler
|
Fields inherited from class org.strbio.math.Bin |
---|
binsize, min_v, nsamples, sum_x, sum_x2 |
Fields inherited from class org.strbio.math.IVector |
---|
data |
Constructor Summary | |
---|---|
Bin2D()
|
|
Bin2D(int nbins,
double minv,
double maxv)
to set up the histogram-bin, you need to know the number of bins you want, the minimum possible value, and the maximum possible value of the data. |
Method Summary | |
---|---|
double |
average(int whichBin)
Average value sampled in a particular bin. |
double |
covar()
Returns the covariance of values sampled. |
double[] |
linearFit()
This will return the best linear fit of the sampled points. |
double |
maxSampled(int whichBin)
Max value sampled in a particular bin. |
double |
minSampled(int whichBin)
Min value sampled in a particular bin. |
double |
pearson()
Returns the Pearson correlation coefficient R of values sampled. |
void |
print(Printf outfile)
print out bins to an open Printf. |
int |
sample(double x,
double y)
|
double |
stdev(int whichBin)
St dev of values sampled in a particular bin. |
Methods inherited from class org.strbio.math.Bin |
---|
average, print, sample, samples, stdev, stdevp, zScore |
Methods inherited from class org.strbio.math.IVector |
---|
add, add, cross, cross, dimension, dot, dot, eliminate, equals, length, load, load, max, min, multiply, multiply, multiply, reverse, reverse, save, save, setValue, setValueAt, sort, subtract, subtract, valueAt |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Sampler[] bin_stats
public Sampler ySampler
protected double sum_xy
Constructor Detail |
---|
public Bin2D(int nbins, double minv, double maxv)
nbins
- the number of bins to sort data into. You don't
need any bins at all if you just want stats like average, stdev;
use Sampler in this case.minv
- the minimum data you might samplemaxv
- the maximum data you might samplepublic Bin2D()
Method Detail |
---|
public int sample(double x, double y)
public final double covar()
public final double pearson()
public final double[] linearFit()
public double average(int whichBin)
public double stdev(int whichBin)
public double maxSampled(int whichBin)
public double minSampled(int whichBin)
public void print(Printf outfile) throws java.io.IOException
print
in class Bin
java.io.IOException
IVector.save(org.strbio.io.Printf)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |