HestonEstimator.HestonCallOptimizationProblem.FellerPenalty C# (CSharp) Method

FellerPenalty() protected method

Penalty function in order to satisfy Feller condition: 2k theta >= sigma^2
protected FellerPenalty ( Vector x ) : double
x Vector /// Vector of parameters: x=[k, theta, sigma,...] ///
return double
        protected double FellerPenalty(Vector x)
        {
            double result;
            result = Math.Max(0, x[2] * x[2] - 2 * x[0] * x[1]);
            return this.s0*this.k2 * result * result;
        }