/** * Returns the covariance matrix of the values that have been added. * * @return the covariance matrix */ public RealMatrix getCovariance() { return covarianceImpl.getResult(); }
/** * Returns the covariance matrix of the values that have been added. * * @return the covariance matrix */ public RealMatrix getCovariance() { return covarianceImpl.getResult(); }
/** * Returns the covariance matrix of the values that have been added. * * @return the covariance matrix */ public RealMatrix getCovariance() { return covarianceImpl.getResult(); }
/** * Returns an array whose i<sup>th</sup> entry is the standard deviation of the * i<sup>th</sup> entries of the arrays that have been added using * {@link #addValue(double[])} * * @return the array of component standard deviations */ public double[] getStandardDeviation() { double[] stdDev = new double[k]; if (getN() < 1) { Arrays.fill(stdDev, Double.NaN); } else if (getN() < 2) { Arrays.fill(stdDev, 0.0); } else { RealMatrix matrix = covarianceImpl.getResult(); for (int i = 0; i < k; ++i) { stdDev[i] = Math.sqrt(matrix.getEntry(i, i)); } } return stdDev; }
/** * Returns an array whose i<sup>th</sup> entry is the standard deviation of the * i<sup>th</sup> entries of the arrays that have been added using * {@link #addValue(double[])} * * @return the array of component standard deviations */ public double[] getStandardDeviation() { double[] stdDev = new double[k]; if (getN() < 1) { Arrays.fill(stdDev, Double.NaN); } else if (getN() < 2) { Arrays.fill(stdDev, 0.0); } else { RealMatrix matrix = covarianceImpl.getResult(); for (int i = 0; i < k; ++i) { stdDev[i] = Math.sqrt(matrix.getEntry(i, i)); } } return stdDev; }
/** * Returns an array whose i<sup>th</sup> entry is the standard deviation of the * i<sup>th</sup> entries of the arrays that have been added using * {@link #addValue(double[])} * * @return the array of component standard deviations */ public double[] getStandardDeviation() { double[] stdDev = new double[k]; if (getN() < 1) { Arrays.fill(stdDev, Double.NaN); } else if (getN() < 2) { Arrays.fill(stdDev, 0.0); } else { RealMatrix matrix = covarianceImpl.getResult(); for (int i = 0; i < k; ++i) { stdDev[i] = FastMath.sqrt(matrix.getEntry(i, i)); } } return stdDev; }
RealMatrix covariance = covStat.getResult();