HestonEstimator.HestonCallOptimizationProblem.CalculateWeight C# (CSharp) Method

CalculateWeight() private method

Allows different specification of call/put weighting
private CalculateWeight ( double volume ) : double
volume double
return double
        double CalculateWeight(double volume)
        {
            switch (weighting)
            {
                case 0://constant
                    return 1;//no-volume information
                case 1://linear
                    return volume;
                case 2://log
                    if (volume > 0)
                        return Math.Log(volume) + 1;
                    else
                        return 0;
                default:
                    throw new Exception("Not defined");

            }
        }