public class Estimator<Y>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Estimator.QualityControl<Y>
Given a confidence interval for the calculated value, determine whether
this is good enough or we need to sample more data.
|
static interface |
Estimator.RandomSample
An interface implemented by the user to provide a source of values to
be used in the estimate
|
static class |
Estimator.Range<Y>
Stores a range of calculated values
|
static interface |
Estimator.UserFunction<Y>
An interface implemented by the user to provide a calculated value given
an estimate for the random variable X.
|
Modifier and Type | Field and Description |
---|---|
protected double |
alpha
A value from [0, 1] to determine how large is the confidence interval
needed.
|
protected Estimator.QualityControl<Y> |
qualityControl
Determines whether the current interval for the target value is good
|
protected Estimator.RandomSample |
randomSample
A source of values coming from a random sample
|
protected Estimator.UserFunction<Y> |
userFunction
The user provided function that calculates the value the user wants
|
protected double |
z
The percentile of the normal distribution corresponding to conifdence
|
Constructor and Description |
---|
Estimator(double alpha) |
Modifier and Type | Method and Description |
---|---|
double |
getAlpha() |
Estimator.Range<Y> |
getEstimate() |
static void |
main(java.lang.String[] args) |
void |
setConfidence(float confidence) |
void |
setQualityControl(Estimator.QualityControl<Y> qualityControl) |
void |
setRandomSample(Estimator.RandomSample randomSample) |
void |
setUserFunction(Estimator.UserFunction<Y> userFunction) |
protected double alpha
protected double z
protected Estimator.RandomSample randomSample
protected Estimator.UserFunction<Y> userFunction
protected Estimator.QualityControl<Y> qualityControl
public double getAlpha()
public void setConfidence(float confidence)
public void setRandomSample(Estimator.RandomSample randomSample)
public void setUserFunction(Estimator.UserFunction<Y> userFunction)
public void setQualityControl(Estimator.QualityControl<Y> qualityControl)
public Estimator.Range<Y> getEstimate()
public static void main(java.lang.String[] args)