java - Calculating Skewness and kurtosis with apache commons -
i have datapoints in vector , calculate skewness , kurtosis of dataset.
how go apache commons?
vector<double> mydata = new vector<double> //data points added routing
the code found in documentation goes this:
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);
but fourthmoment not recognised compiler. , how mydata in there?
thanks help, can not seem clear examples.
i use version 3.1.1 , recognises imports, except first one:
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;
do need fourth moment? or can calculate based on vector?
i think can calculate directly, using kurtosis.evaluate()
.
Comments
Post a Comment