HullAndWhiteOneFactor.SwaptionHW1.A C# (CSharp) Method

A() public static method

Calculates the function A() to be used in the Bond() method.
public static A ( double t, double T, double alpha, double sigma, System.Function zeroRateCurve ) : double
t double /// The time at which the Bond price will be calculated. ///
T double /// The bond maturity. ///
alpha double /// Hull-White alpha parameter. ///
sigma double /// Hull-White sigma parameter. ///
zeroRateCurve System.Function /// Zero rate curve. ///
return double
        public static double A(double t, double T, double alpha, double sigma, Function zeroRateCurve)
        {
            double dT = T - t;
            double firstTerm = sigma * sigma * (alpha * dT - 2.0 * (1.0 - Math.Exp(-alpha * dT))
                + 0.5 * (1.0 - Math.Exp(-2.0 * alpha * dT))) / (2.0 * Math.Pow(alpha, 3.0));

            return firstTerm - AlphaInt(t, T, alpha, sigma, zeroRateCurve);
        }