/** * Computes the value of f(x) given the mixture. * * @param x the value * @return the value of f(x) */ public double f(double x) { DoubleVector points = mixingDistribution.getPointValues(); DoubleVector values = mixingDistribution.getFunctionValues(); return Maths.dchisq(x, points).timesEquals(values).sum(); }