本文整理汇总了Java中cern.jet.stat.Descriptive.quantile方法的典型用法代码示例。如果您正苦于以下问题:Java Descriptive.quantile方法的具体用法?Java Descriptive.quantile怎么用?Java Descriptive.quantile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cern.jet.stat.Descriptive
的用法示例。
在下文中一共展示了Descriptive.quantile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: report
import cern.jet.stat.Descriptive; //导入方法依赖的package包/类
@Override
public Object report(Argument args[], Context context)
throws ExtensionException, LogoException {
LogoStatsTbl tbl = StatsExtension.getTblFromArgument(args[0]);
int varNumber = ExtnUtils.getVarNumberFromArg(tbl, args[1]);
double pcnt;
try {
pcnt = args[2].getDoubleValue();
} catch (LogoException e) {
throw new ExtensionException(e.getMessage());
}
pcnt /= 100.0;
if (pcnt < 0.0 || pcnt > 100.0) {
throw new ExtensionException("The percent must be between"
+ " 0.0 and 100.0, inclusive.");
}
double[] X = tbl.getColumn(varNumber, true);
Sorting.mergeSort(X, 0, X.length);
return Descriptive.quantile(new DoubleArrayList(X), pcnt);
}
示例2: bandwidthNRD
import cern.jet.stat.Descriptive; //导入方法依赖的package包/类
public double bandwidthNRD(double[] in) {
DoubleArrayList inList = new DoubleArrayList(in.length);
for (double d : in)
inList.add(d);
inList.sort();
final double h = (Descriptive.quantile(inList, 0.75) - Descriptive.quantile(inList, 0.25)) / 1.34;
return 4 * 1.06 *
Math.min(Math.sqrt(DiscreteStatistics.variance(in)), h) *
Math.pow(in.length, -0.2);
}
示例3: bandwidthNRD
import cern.jet.stat.Descriptive; //导入方法依赖的package包/类
public double bandwidthNRD(double[] in) {
DoubleArrayList inList = new DoubleArrayList(in.length);
for (double d : in)
inList.add(d);
inList.sort();
final double h = (Descriptive.quantile(inList, 0.75) - Descriptive
.quantile(inList, 0.25)) / 1.34;
return 4 * 1.06
* Math.min(Math.sqrt(DiscreteStatistics.variance(in)), h)
* Math.pow(in.length, -0.2);
}
示例4: opQuantile
import cern.jet.stat.Descriptive; //导入方法依赖的package包/类
/**
*
*
* @param scope
* @param data
* @param phi
* @return
*/
@operator(value = "quantile", can_be_const = true, type = IType.FLOAT, expected_content_type = { IType.INT,
IType.FLOAT }, concept = { IConcept.STATISTIC })
@doc(value = "Returns the phi-quantile; that is, an element elem for which holds that phi percent of data elements are less than elem. The quantile need not necessarily be contained in the data sequence, it can be a linear interpolation.", comment = "", examples = {})
public static Double opQuantile(final IScope scope, final IContainer data, final Double phi) {
// TODO input parameters validation
return Descriptive.quantile(from(scope, data), phi);
}
示例5: quantile
import cern.jet.stat.Descriptive; //导入方法依赖的package包/类
/**
* Returns the exact <tt>phi-</tt>quantile; that is, the smallest contained element <tt>elem</tt> for which holds that <tt>phi</tt> percent of elements are less than <tt>elem</tt>.
* @param phi must satisfy <tt>0 < phi < 1</tt>.
*/
public synchronized double quantile(double phi) {
return Descriptive.quantile(sortedElements_unsafe(),phi);
}