我有一个向量中的数据点,我想计算数据集的偏度和峰度。
我该如何使用apache commons进行计算?
Vector<Double> mydata = new Vector<Double>
//data points are added by my routing
我從文件中找到的代碼如下:
```html
我找到的代碼如下:
``` FourthMoment m4 = new FourthMoment();
Mean m = new Mean(m4);
Variance v = new Variance(m4);
Skewness s= new Skewness(m4);
Kurtosis k = new Kurtosis(m4);
assertEquals(var,v.getResult(),tolerance);
assertEquals(skew ,s.getResult(),tolerance);
我的编译器不能识别Fourthmoment。我该怎么把mydata放进去?
感谢任何帮助,我似乎找不到清晰的例子。
我使用3.1.1版本,它能识别所有我的导入,除了第一个:
import org.apache.commons.math3.stat.descriptive.moment.FourthMoment;
import org.apache.commons.math3.stat.descriptive.moment.Kurtosis;
import org.apache.commons.math3.stat.descriptive.moment.Mean;
import org.apache.commons.math3.stat.descriptive.moment.Skewness;
import org.apache.commons.math3.stat.descriptive.moment.Variance;