Class QuantileDataAnalyzer
java.lang.Object
dataAnalysis.DynamicDataAnalyzerImpl
dataAnalysis.QuantileDataAnalyzer
- All Implemented Interfaces:
DynamicDataAnalyzer
Analyzes the data in order to calculate the requested quantiles.
- Author:
- Federico Granata Date: 24-lug-2003 Time: 12.04.49
-
Field Summary
Fields inherited from class DynamicDataAnalyzerImpl
alfa, batchLen, batchMean, C1, C2, confInt, deleted, delta, discarded, end, eurDisc, extMean, extVar, heuristic, initData, initial, initialized, initWeight, K, maxData, nSamples, numBatch, parameters, polyOrder, precision, success, sumLastBatch, weightBatchMean -
Constructor Summary
ConstructorsConstructorDescriptionQuantileDataAnalyzer(double alfa, double precision, int maxData, double[] quantile) Creates a QuantileDataAnalyzer.QuantileDataAnalyzer(double alfa, double precision, int maxData, double[] quantile, SortAlgorithm sorter) Creates a QuantileDataAnalyzer. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddSample(double newSample, double weight) Adds the new sample to the statistic.protected voidcalcVar()updates the variancedoublegetProbability(double quantile) returns the probability that a number extracted from the empirical distribution analyzed is greater than the quantile.doublegetQuantile(double prob) returns the quantile with the requested probability.double[]gets all requested quantiles.protected booleanHWtest()Applies the spectral test to generate the Confidence Intervals.protected doublesearch(double element) protected voidsort()Methods inherited from class DynamicDataAnalyzerImpl
calcConfInterval, calcConstants, calcEstimatorVar, calcVar, deleteTransient, estimatedMean, getAlfa, getConfInt, getData, getDiscarded, getLastIntervalAvg, getMaxData, getMean, getNullMeasure_upperLimit, getPrecision, getSamples, getSuccess, getVar, heuristicR5, isZero, nullTest, schrubenTest, setParameters, stopMeasure, toString
-
Constructor Details
-
QuantileDataAnalyzer
public QuantileDataAnalyzer(double alfa, double precision, int maxData, double[] quantile, SortAlgorithm sorter) Creates a QuantileDataAnalyzer.- Parameters:
alfa- the quantile required for the confidence intervalprecision- maximum amplitude of confidence interval (precision = maxamplitude / mean)maxData- maximum number of data to be analyzedquantile- Requested quantiles //TODO: correct??sorter- Sorting algorithm used to manage data
-
QuantileDataAnalyzer
public QuantileDataAnalyzer(double alfa, double precision, int maxData, double[] quantile) Creates a QuantileDataAnalyzer. A default sorting algorithm is used to manage data.- Parameters:
alfa- the quantile required for the confidence intervalprecision- maximum amplitude of confidence interval (precision = maxamplitude / mean)maxData- maximum number of data to be analyzedquantile- Requested quantiles
-
-
Method Details
-
addSample
public boolean addSample(double newSample, double weight) Adds the new sample to the statistic.- Specified by:
addSamplein interfaceDynamicDataAnalyzer- Overrides:
addSamplein classDynamicDataAnalyzerImpl- Parameters:
newSample- the new sampleweight- the weight of the newSample, if it is not needed put 1.- Returns:
- true if the confidence interval is smaller than required by the user, or the data analyzed are too many
-
getQuantile
public double getQuantile(double prob) returns the quantile with the requested probability.- Parameters:
prob- probability of the quantile- Returns:
- the estimated quantile
-
getQuantiles
public double[] getQuantiles()gets all requested quantiles.- Returns:
- vector of quantiles.
-
getProbability
public double getProbability(double quantile) returns the probability that a number extracted from the empirical distribution analyzed is greater than the quantile.- Parameters:
quantile- the requested quantile- Returns:
- estimated probability
-
search
protected double search(double element) -
sort
protected void sort() -
HWtest
protected boolean HWtest()Applies the spectral test to generate the Confidence Intervals. see: P. Heidelberger, Peter D. Welch "A spectral method for confidence interval generation and run length control in simulations"- Overrides:
HWtestin classDynamicDataAnalyzerImpl- Returns:
- true if the precision requirement met. false if not.
-
calcVar
-