/** * The within-bin kernel of the bin that x belongs to. * * @param x the value to locate within a bin * @return the within-bin kernel of the bin containing x */ private RealDistribution k(double x) { final int binIndex = findBin(x); return getKernel(binStats.get(binIndex)); }
/** * {@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); }
return 1d; final int binIndex = findBin(x); final double pBminus = pBminus(binIndex); final double pB = pB(binIndex);
/** * The within-bin kernel of the bin that x belongs to. * * @param x the value to locate within a bin * @return the within-bin kernel of the bin containing x */ private RealDistribution k(double x) { final int binIndex = findBin(x); return getKernel(binStats.get(binIndex)); }
/** * The within-bin kernel of the bin that x belongs to. * * @param x the value to locate within a bin * @return the within-bin kernel of the bin containing x */ private RealDistribution k(double x) { final int binIndex = findBin(x); return getKernel(binStats.get(binIndex)); }
/** * {@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); }
/** * {@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); }
return 1d; final int binIndex = findBin(x); final double pBminus = pBminus(binIndex); final double pB = pB(binIndex);
return 1d; final int binIndex = findBin(x); final double pBminus = pBminus(binIndex); final double pB = pB(binIndex);