本文整理汇总了Java中org.apache.commons.math.stat.descriptive.rank.Min类的典型用法代码示例。如果您正苦于以下问题:Java Min类的具体用法?Java Min怎么用?Java Min使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Min类属于org.apache.commons.math.stat.descriptive.rank包,在下文中一共展示了Min类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: netBasisAllBonds
import org.apache.commons.math.stat.descriptive.rank.Min; //导入依赖的package包/类
@Test
/**
* Tests the net basis of all bonds computed from the curves.
*/
public void netBasisAllBonds() {
//final double priceFuture = 1.0320;
final double priceFuture = METHOD_FUT_SEC_DSC.price(BOND_FUTURE, ISSUER_MULTICURVES);
final double[] netBasisComputed = METHOD_FUT_SEC_DSC.netBasisAllBonds(BOND_FUTURE, ISSUER_MULTICURVES, priceFuture);
final double[] netBasisExpected = new double[NB_BOND];
for (int loopbasket = 0; loopbasket < NB_BOND; loopbasket++) {
final double bondDirtyPriceForward = METHOD_BOND_SEC.dirtyPriceFromCurves(BOND_FUTURE.getDeliveryBasketAtDeliveryDate()[loopbasket], ISSUER_MULTICURVES);
netBasisExpected[loopbasket] = bondDirtyPriceForward - (priceFuture * CONVERSION_FACTOR[loopbasket] + BOND_FUTURE.getDeliveryBasketAtDeliveryDate()[loopbasket].getAccruedInterest());
assertEquals("Bond future security Discounting Method: netBasis", netBasisExpected[loopbasket], netBasisComputed[loopbasket], 1.0E-10);
}
final Min minFunction = new Min();
final double netBasisMin = minFunction.evaluate(netBasisComputed);
final double priceFutureFromNetBasis = METHOD_FUT_SEC_DSC.priceFromNetBasis(BOND_FUTURE, ISSUER_MULTICURVES, netBasisMin);
assertEquals("Bond future security Discounting Method: netBasis", priceFuture, priceFutureFromNetBasis, 1.0E-10);
}
示例2: netBasisAllBonds
import org.apache.commons.math.stat.descriptive.rank.Min; //导入依赖的package包/类
/**
* Tests the net basis of all bonds computed from the curves.
*/
@Test
public void netBasisAllBonds() {
//final double priceFuture = 1.0320;
final double priceFuture = METHOD_FUT_DSC.price(BOND_FUTURE, ISSUER_MULTICURVES);
final double[] netBasisComputed = METHOD_FUT_DSC.netBasisAllBonds(BOND_FUTURE, ISSUER_MULTICURVES, priceFuture);
final double[] netBasisExpected = new double[NB_BOND];
for (int loopbasket = 0; loopbasket < NB_BOND; loopbasket++) {
final double bondPriceForward = METHOD_BOND.dirtyPriceFromCurves(BOND_FUTURE.getDeliveryBasket()[loopbasket], ISSUER_MULTICURVES);
netBasisExpected[loopbasket] = bondPriceForward - (priceFuture * CONVERSION_FACTOR[loopbasket] + BOND_FUTURE.getDeliveryBasket()[loopbasket].getAccruedInterest());
assertEquals("Bond future security Discounting Method: netBasis", netBasisExpected[loopbasket], netBasisComputed[loopbasket], 1.0E-10);
}
final Min minFunction = new Min();
final double netBasisMin = minFunction.evaluate(netBasisComputed);
final double priceFutureFromNetBasis = METHOD_FUT_DSC.priceFromNetBasis(BOND_FUTURE, ISSUER_MULTICURVES, netBasisMin);
assertEquals("Bond future security Discounting Method: netBasis", priceFuture, priceFutureFromNetBasis, 1.0E-10);
}
示例3: MultivariateSummaryStatistics
import org.apache.commons.math.stat.descriptive.rank.Min; //导入依赖的package包/类
/**
* Construct a MultivariateSummaryStatistics instance
* @param k dimension of the data
* @param isCovarianceBiasCorrected if true, the unbiased sample
* covariance is computed, otherwise the biased population covariance
* is computed
*/
public MultivariateSummaryStatistics(int k, boolean isCovarianceBiasCorrected) {
this.k = k;
sumImpl = new StorelessUnivariateStatistic[k];
sumSqImpl = new StorelessUnivariateStatistic[k];
minImpl = new StorelessUnivariateStatistic[k];
maxImpl = new StorelessUnivariateStatistic[k];
sumLogImpl = new StorelessUnivariateStatistic[k];
geoMeanImpl = new StorelessUnivariateStatistic[k];
meanImpl = new StorelessUnivariateStatistic[k];
for (int i = 0; i < k; ++i) {
sumImpl[i] = new Sum();
sumSqImpl[i] = new SumOfSquares();
minImpl[i] = new Min();
maxImpl[i] = new Max();
sumLogImpl[i] = new SumOfLogs();
geoMeanImpl[i] = new GeometricMean();
meanImpl[i] = new Mean();
}
covarianceImpl =
new VectorialCovariance(k, isCovarianceBiasCorrected);
}
示例4: Histogram
import org.apache.commons.math.stat.descriptive.rank.Min; //导入依赖的package包/类
public Histogram(FrequencyDistribution frequencyDistribution) {
this.frequencyDistribution = frequencyDistribution;
frequencies = frequencyDistribution.frequencies();
minFrequency = new Min().evaluate(frequencies);
maxFrequency = new Max().evaluate(frequencies);
medianBin = frequencyDistribution.medianBin();
quartileBins = frequencyDistribution.quartileBins();
quintileBins = frequencyDistribution.quintileBins();
decileBins = frequencyDistribution.decileBins();
overlay = new Polygon();
build();
}
示例5: SummaryStatisticsImpl
import org.apache.commons.math.stat.descriptive.rank.Min; //导入依赖的package包/类
/**
* Construct a SummaryStatistics
*/
public SummaryStatisticsImpl() {
sum = new Sum();
sumsq = new SumOfSquares();
min = new Min();
max = new Max();
sumLog = new SumOfLogs();
geoMean = new GeometricMean();
secondMoment = new SecondMoment();
}
示例6: performCalculation
import org.apache.commons.math.stat.descriptive.rank.Min; //导入依赖的package包/类
private void performCalculation(double[] values, int type) {
Mean meanCalculator = new Mean();
double mean = meanCalculator.evaluate(values);
Max maxCalculator = new Max();
double max = maxCalculator.evaluate(values);
Min minCalculator = new Min();
double min = minCalculator.evaluate(values);
StandardDeviation standardDeviationCalculator = new StandardDeviation();
double stdDeviation = standardDeviationCalculator.evaluate(values);
if (type == MotifStats.WORKFLOW) {
MotifStats.setMinWorkflowAppearance(min);
MotifStats.setMaxWorkflowAppearance(max);
MotifStats.setMeanWorkflowAppearance(mean);
MotifStats.setStdDeviationWorkflowUsage(stdDeviation);
} else if (type == MotifStats.USAGE) {
MotifStats.setMinUsage(min);
MotifStats.setMaxUsage(max);
MotifStats.setMeanUsage(mean);
MotifStats.setStdDeviationUsage(stdDeviation);
} else if (type == MotifStats.MSP) {
MotifStats.setMinMSP(min);
MotifStats.setMaxMSP(max);
MotifStats.setMeanMSP(mean);
MotifStats.setStdDeviationMSP(stdDeviation);
}
}
示例7: copy
import org.apache.commons.math.stat.descriptive.rank.Min; //导入依赖的package包/类
/**
* Copies source to dest.
* <p>Neither source nor dest can be null.</p>
*
* @param source SummaryStatistics to copy
* @param dest SummaryStatistics to copy to
* @throws NullPointerException if either source or dest is null
*/
public static void copy(SummaryStatistics source, SummaryStatistics dest) {
dest.maxImpl = source.maxImpl.copy();
dest.meanImpl = source.meanImpl.copy();
dest.minImpl = source.minImpl.copy();
dest.sumImpl = source.sumImpl.copy();
dest.varianceImpl = source.varianceImpl.copy();
dest.sumLogImpl = source.sumLogImpl.copy();
dest.sumsqImpl = source.sumsqImpl.copy();
if (source.getGeoMeanImpl() instanceof GeometricMean) {
// Keep geoMeanImpl, sumLogImpl in synch
dest.geoMeanImpl = new GeometricMean((SumOfLogs) dest.sumLogImpl);
} else {
dest.geoMeanImpl = source.geoMeanImpl.copy();
}
SecondMoment.copy(source.secondMoment, dest.secondMoment);
dest.n = source.n;
// Make sure that if stat == statImpl in source, same
// holds in dest; otherwise copy stat
if (source.geoMean == source.geoMeanImpl) {
dest.geoMean = (GeometricMean) dest.geoMeanImpl;
} else {
GeometricMean.copy(source.geoMean, dest.geoMean);
}
if (source.max == source.maxImpl) {
dest.max = (Max) dest.maxImpl;
} else {
Max.copy(source.max, dest.max);
}
if (source.mean == source.meanImpl) {
dest.mean = (Mean) dest.meanImpl;
} else {
Mean.copy(source.mean, dest.mean);
}
if (source.min == source.minImpl) {
dest.min = (Min) dest.minImpl;
} else {
Min.copy(source.min, dest.min);
}
if (source.sum == source.sumImpl) {
dest.sum = (Sum) dest.sumImpl;
} else {
Sum.copy(source.sum, dest.sum);
}
if (source.variance == source.varianceImpl) {
dest.variance = (Variance) dest.varianceImpl;
} else {
Variance.copy(source.variance, dest.variance);
}
if (source.sumLog == source.sumLogImpl) {
dest.sumLog = (SumOfLogs) dest.sumLogImpl;
} else {
SumOfLogs.copy(source.sumLog, dest.sumLog);
}
if (source.sumsq == source.sumsqImpl) {
dest.sumsq = (SumOfSquares) dest.sumsqImpl;
} else {
SumOfSquares.copy(source.sumsq, dest.sumsq);
}
}
示例8: copy
import org.apache.commons.math.stat.descriptive.rank.Min; //导入依赖的package包/类
/**
* Copies source to dest.
* <p>Neither source nor dest can be null.</p>
*
* @param source SummaryStatistics to copy
* @param dest SummaryStatistics to copy to
* @throws NullArgumentException if either source or dest is null
*/
public static void copy(SummaryStatistics source, SummaryStatistics dest)
throws NullArgumentException {
MathUtils.checkNotNull(source);
MathUtils.checkNotNull(dest);
dest.maxImpl = source.maxImpl.copy();
dest.meanImpl = source.meanImpl.copy();
dest.minImpl = source.minImpl.copy();
dest.sumImpl = source.sumImpl.copy();
dest.varianceImpl = source.varianceImpl.copy();
dest.sumLogImpl = source.sumLogImpl.copy();
dest.sumsqImpl = source.sumsqImpl.copy();
if (source.getGeoMeanImpl() instanceof GeometricMean) {
// Keep geoMeanImpl, sumLogImpl in synch
dest.geoMeanImpl = new GeometricMean((SumOfLogs) dest.sumLogImpl);
} else {
dest.geoMeanImpl = source.geoMeanImpl.copy();
}
SecondMoment.copy(source.secondMoment, dest.secondMoment);
dest.n = source.n;
// Make sure that if stat == statImpl in source, same
// holds in dest; otherwise copy stat
if (source.geoMean == source.geoMeanImpl) {
dest.geoMean = (GeometricMean) dest.geoMeanImpl;
} else {
GeometricMean.copy(source.geoMean, dest.geoMean);
}
if (source.max == source.maxImpl) {
dest.max = (Max) dest.maxImpl;
} else {
Max.copy(source.max, dest.max);
}
if (source.mean == source.meanImpl) {
dest.mean = (Mean) dest.meanImpl;
} else {
Mean.copy(source.mean, dest.mean);
}
if (source.min == source.minImpl) {
dest.min = (Min) dest.minImpl;
} else {
Min.copy(source.min, dest.min);
}
if (source.sum == source.sumImpl) {
dest.sum = (Sum) dest.sumImpl;
} else {
Sum.copy(source.sum, dest.sum);
}
if (source.variance == source.varianceImpl) {
dest.variance = (Variance) dest.varianceImpl;
} else {
Variance.copy(source.variance, dest.variance);
}
if (source.sumLog == source.sumLogImpl) {
dest.sumLog = (SumOfLogs) dest.sumLogImpl;
} else {
SumOfLogs.copy(source.sumLog, dest.sumLog);
}
if (source.sumsq == source.sumsqImpl) {
dest.sumsq = (SumOfSquares) dest.sumsqImpl;
} else {
SumOfSquares.copy(source.sumsq, dest.sumsq);
}
}
示例9: copy
import org.apache.commons.math.stat.descriptive.rank.Min; //导入依赖的package包/类
/**
* Copies source to dest.
* <p>Neither source nor dest can be null.</p>
*
* @param source SummaryStatistics to copy
* @param dest SummaryStatistics to copy to
* @throws NullPointerException if either source or dest is null
*/
public static void copy(SummaryStatistics source, SummaryStatistics dest) {
dest.maxImpl = source.maxImpl.copy();
dest.meanImpl = source.meanImpl.copy();
dest.minImpl = source.minImpl.copy();
dest.sumImpl = source.sumImpl.copy();
dest.varianceImpl = source.varianceImpl.copy();
dest.sumLogImpl = source.sumLogImpl.copy();
dest.sumsqImpl = source.sumsqImpl.copy();
if (source.getGeoMeanImpl() instanceof GeometricMean) {
// Keep geoMeanImpl, sumLogImpl in synch
dest.geoMeanImpl = new GeometricMean((SumOfLogs) dest.sumLogImpl);
} else {
dest.geoMeanImpl = source.geoMeanImpl.copy();
}
SecondMoment.copy(source.secondMoment, dest.secondMoment);
dest.n = source.n;
// Make sure that if stat == statImpl in source, same
// holds in dest; otherwise copy stat
if (source.geoMean == source.geoMeanImpl) {
dest.geoMean = (GeometricMean) dest.geoMeanImpl;
} else {
GeometricMean.copy(source.geoMean, dest.geoMean);
}
if (source.max == source.maxImpl) {
dest.max = (Max) dest.maxImpl;
} else {
Max.copy(source.max, dest.max);
}
if (source.mean == source.meanImpl) {
dest.mean = (Mean) dest.meanImpl;
} else {
Mean.copy(source.mean, dest.mean);
}
if (source.min == source.minImpl) {
dest.min = (Min) dest.minImpl;
} else {
Min.copy(source.min, dest.min);
}
if (source.sum == source.sumImpl) {
dest.sum = (Sum) dest.sumImpl;
} else {
Sum.copy(source.sum, dest.sum);
}
if (source.variance == source.varianceImpl) {
dest.variance = (Variance) dest.varianceImpl;
} else {
Variance.copy(source.variance, dest.variance);
}
if (source.sumLog == source.sumLogImpl) {
dest.sumLog = (SumOfLogs) dest.sumLogImpl;
} else {
SumOfLogs.copy(source.sumLog, dest.sumLog);
}
if (source.sumsq == source.sumsqImpl) {
dest.sumsq = (SumOfSquares) dest.sumsqImpl;
} else {
SumOfSquares.copy(source.sumsq, dest.sumsq);
}
}
示例10: getMin
import org.apache.commons.math.stat.descriptive.rank.Min; //导入依赖的package包/类
/**
* Returns the minimum of the available values
* @return The min or Double.NaN if no values have been added.
*/
public double getMin() {
return apply(new Min());
}