/** * {@inheritDoc} * * <p>Returns the kernel density normalized so that its integral over each bin * equals the bin mass.</p> * * <p>Algorithm description: <ol> * <li>Find the bin B that x belongs to.</li> * <li>Compute K(B) = the mass of B with respect to the within-bin kernel (i.e., the * integral of the kernel density over B).</li> * <li>Return k(x) * P(B) / K(B), where k is the within-bin kernel density * and P(B) is the mass of B.</li></ol></p> * @since 3.1 */ public double density(double x) { if (x < min || x > max) { return 0d; } final int binIndex = findBin(x); final RealDistribution kernel = getKernel(binStats.get(binIndex)); return kernel.density(x) * pB(binIndex) / kB(binIndex); }
final double pB = pB(binIndex); final RealDistribution kernel = k(x); if (kernel instanceof ConstantRealDistribution) {
final double lower = i == 0 ? min : binBounds[i - 1]; final double kBminus = kernel.cumulativeProbability(lower); final double pB = pB(i); final double pBminus = pBminus(i); final double pCrit = p - pBminus;
/** * {@inheritDoc} * * <p>Returns the kernel density normalized so that its integral over each bin * equals the bin mass.</p> * * <p>Algorithm description: <ol> * <li>Find the bin B that x belongs to.</li> * <li>Compute K(B) = the mass of B with respect to the within-bin kernel (i.e., the * integral of the kernel density over B).</li> * <li>Return k(x) * P(B) / K(B), where k is the within-bin kernel density * and P(B) is the mass of B.</li></ol></p> * @since 3.1 */ public double density(double x) { if (x < min || x > max) { return 0d; } final int binIndex = findBin(x); final RealDistribution kernel = getKernel(binStats.get(binIndex)); return kernel.density(x) * pB(binIndex) / kB(binIndex); }
final double pB = pB(binIndex); final RealDistribution kernel = k(x); if (kernel instanceof ConstantRealDistribution) {
/** * {@inheritDoc} * * <p>Returns the kernel density normalized so that its integral over each bin * equals the bin mass.</p> * * <p>Algorithm description: <ol> * <li>Find the bin B that x belongs to.</li> * <li>Compute K(B) = the mass of B with respect to the within-bin kernel (i.e., the * integral of the kernel density over B).</li> * <li>Return k(x) * P(B) / K(B), where k is the within-bin kernel density * and P(B) is the mass of B.</li></ol></p> * @since 3.1 */ public double density(double x) { if (x < min || x > max) { return 0d; } final int binIndex = findBin(x); final RealDistribution kernel = getKernel(binStats.get(binIndex)); return kernel.density(x) * pB(binIndex) / kB(binIndex); }
final double pB = pB(binIndex); final RealDistribution kernel = k(x); if (kernel instanceof ConstantRealDistribution) {
final double lower = i == 0 ? min : binBounds[i - 1]; final double kBminus = kernel.cumulativeProbability(lower); final double pB = pB(i); final double pBminus = pBminus(i); final double pCrit = p - pBminus;
final double lower = i == 0 ? min : binBounds[i - 1]; final double kBminus = kernel.cumulativeProbability(lower); final double pB = pB(i); final double pBminus = pBminus(i); final double pCrit = p - pBminus;