Accord.Statistics.Distributions.DensityKernels.EpanechnikovKernel.Profile C# (CSharp) Method

Profile() public method

Computes the kernel profile function.
public Profile ( double x ) : double
x double The point estimate x.
return double
        public double Profile(double x)
        {
#if DEBUG
            if (x < 0)
                throw new Exception();
#endif

            // Equation 7 in (Comaniciu & Meer)
            // https://courses.csail.mit.edu/6.869/handouts/PAMIMeanshift.pdf

            if (x <= 1)
                return 1 - x;
            return 0;
        }