HestonEstimator.HestonCallOptimizationProblem.BoundPenalty C# (CSharp) Method

BoundPenalty() private method

Penalty function relative to bounds.
private BoundPenalty ( Vector x ) : double
x Vector /// Vector of parameters. ///
return double
        private double BoundPenalty(Vector x)
        {
            Vector t1, t2, t3;
            t1 = Bounds.Lb + this.smallValue - x;
            t2 = -Bounds.Ub + this.smallValue + x;

            t3 = t1 * t1 * (t1 > 0) + t2 * t2 * (t2 > 0);
            return this.k1 * t3.Sum();
        }