org.strbio.math
Class Sampler

java.lang.Object
  extended by org.strbio.math.IVector
      extended by org.strbio.math.Bin
          extended by org.strbio.math.Sampler

public class Sampler
extends Bin

This is a special case of Bin that samples data and can later return statistics like average, standard deviation. It doesn't keep track of the data, though. It does keep a few more stats than Bin, though.

Version:
1.0, 9/29/98
Author:
JMC

Field Summary
 
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
Sampler()
           
 
Method Summary
 double maxSampled()
          what's the maximum value we sampled?
 double minSampled()
          what's the minimum value we sampled?
 int sample(double r)
          Sample a value.
 
Methods inherited from class org.strbio.math.Bin
average, print, print, 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
 

Constructor Detail

Sampler

public Sampler()
Method Detail

minSampled

public double minSampled()
what's the minimum value we sampled?


maxSampled

public double maxSampled()
what's the maximum value we sampled?


sample

public int sample(double r)
Description copied from class: Bin
Sample a value. If the value is lower than the minimum value you specified in setting up the bin, the sample goes into the lowest bin. Same thing goes for the high end. This 'rounding off' does not affect statistics like the average.

Overrides:
sample in class Bin