本文整理汇总了Java中org.apache.commons.math3.stat.descriptive.moment.Skewness类的典型用法代码示例。如果您正苦于以下问题:Java Skewness类的具体用法?Java Skewness怎么用?Java Skewness使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Skewness类属于org.apache.commons.math3.stat.descriptive.moment包,在下文中一共展示了Skewness类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: skewness
import org.apache.commons.math3.stat.descriptive.moment.Skewness; //导入依赖的package包/类
@operator (
value = "skewness",
can_be_const = false,
type = IType.LIST,
category = { IOperatorCategory.STATISTICAL },
concept = { IConcept.STATISTIC, IConcept.CLUSTERING })
@doc (
value = "returns skewness value computed from the operand list of values",
special_cases = "if the length of the list is lower than 3, returns NaN",
examples = { @example (value = "skewness ([1,2,3,4,5])", equals = "0.0") })
public static Double skewness(final IScope scope, final GamaList data) throws GamaRuntimeException {
final Skewness sk = new Skewness();
final double[] values = new double[data.length(scope)];
for (int i = 0; i < values.length; i++) {
values[i] = Cast.asFloat(scope, data.get(i));
}
return sk.evaluate(values);
}
示例2: getStatisticalSpectrumDescriptor
import org.apache.commons.math3.stat.descriptive.moment.Skewness; //导入依赖的package包/类
private double[] getStatisticalSpectrumDescriptor(double[] dataRow) {
int N = dataRow.length;
double ssd[] = new double[N_STATISTICAL_DESCRIPTORS];
ssd[0] = new Mean().evaluate(dataRow);
ssd[1] = new Variance().evaluate(dataRow);
ssd[2] = new Skewness().evaluate(dataRow);
ssd[3] = new Kurtosis().evaluate(dataRow);
// NOTE: be careful, sort changes data!
// (as sonogram.getRow() above copies the data anyway, in this case there is no problem)
// (otherwise, use dataRow.clone(); )
Arrays.sort(dataRow);
// median
if (N % 2 == 0) {
ssd[4] = (dataRow[(N / 2) - 1] + dataRow[(N / 2)]) / 2;
} else {
ssd[4] = dataRow[(N - 1) / 2];
}
ssd[5] = dataRow[0]; // min value
ssd[6] = dataRow[N - 1]; // max value
return ssd;
}
示例3: agg
import org.apache.commons.math3.stat.descriptive.moment.Skewness; //导入依赖的package包/类
@Override
public double agg(double[] data) {
return new Skewness().evaluate(data, 0, data.length);
}