本文整理汇总了Java中org.apache.commons.math3.stat.descriptive.moment.StandardDeviation.getResult方法的典型用法代码示例。如果您正苦于以下问题:Java StandardDeviation.getResult方法的具体用法?Java StandardDeviation.getResult怎么用?Java StandardDeviation.getResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.math3.stat.descriptive.moment.StandardDeviation
的用法示例。
在下文中一共展示了StandardDeviation.getResult方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluate
import org.apache.commons.math3.stat.descriptive.moment.StandardDeviation; //导入方法依赖的package包/类
static
private Double evaluate(Collection<?> values, boolean biasCorrected){
StandardDeviation statistic = new StandardDeviation();
statistic.setBiasCorrected(biasCorrected);
for(Object value : values){
Double doubleValue = (Double)TypeUtil.parseOrCast(DataType.DOUBLE, value);
statistic.increment(doubleValue);
}
return statistic.getResult();
}
示例2: initializeGridPoints
import org.apache.commons.math3.stat.descriptive.moment.StandardDeviation; //导入方法依赖的package包/类
private void initializeGridPoints()throws SQLException{
Statement stmt = null;
ResultSet rs = null;
//connect to db
try{
Table sqlTable = new Table(tableName.getNameForDatabase());
SelectQuery select = new SelectQuery();
select.addColumn(sqlTable, regressorVariable.getName().nameForDatabase());
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
rs=stmt.executeQuery(select.toString());
Min min = new Min();
Max max = new Max();
Mean mean = new Mean();
StandardDeviation sd = new StandardDeviation();
double value = 0.0;
while(rs.next()){
value = rs.getDouble(regressorVariable.getName().nameForDatabase());
if(!rs.wasNull()){
min.increment(value);
max.increment(value);
mean.increment(value);
sd.increment(value);
}
updateProgress();
}
rs.close();
stmt.close();
//evaluation points
double sdv = sd.getResult();
double mn = mean.getResult();
double lower = mn-2.5*sdv;
double upper = mn+2.5*sdv;
bwAdjustment *= sdv;
bandwidth = new NonparametricIccBandwidth(sampleSize, bwAdjustment);
gridPoints = command.getFreeOption("gridpoints").getInteger();
// uniformDistributionApproximation = new UniformDistributionApproximation(
// min.getResult(), max.getResult(), gridPoints);
uniformDistributionApproximation = new UniformDistributionApproximation(
lower, upper, gridPoints);
}catch(SQLException ex){
throw ex;
}finally{
if(rs!=null) rs.close();
if(stmt!=null) stmt.close();
}
}
示例3: getInitialMaximum
import org.apache.commons.math3.stat.descriptive.moment.StandardDeviation; //导入方法依赖的package包/类
@Override
protected double getInitialMaximum(
final StandardDeviation stats,
final double total ) {
return (total / stats.getN()) + stats.getResult();
}