Pelsser.SquaredGaussianModel.Int C# (CSharp) Method

Int() public method

Calculates the integral inside alpha(T).
public Int ( double t1, double t2 ) : double
t1 double The starting point of the integration.
t2 double The ending point of the integration.
return double
        public double Int(double t1, double t2)
        {
            if (t1 == t2) return 0;
            double deltat = t2 - t1;
            double i = (Math.Exp(this.alpha1Temp * t1) * SIG(t1) * F(t1, deltat) + Math.Exp(this.alpha1Temp * t2) * SIG(t2) * F(t2, deltat)) / 2.0;
            return i * deltat;
        }

Usage Example

Example #1
0
        /// <summary>
        /// Format the y parameter so it can be made compatible with <see cref="Pelsser.Bond"/>.
        /// </summary>
        /// <param name="y">The y parameter wanted inside Bond.</param>
        /// <param name="process">The Pelsser process which will be used.</param>
        /// <returns>The Matrix to pass to Bond.</returns>
        private Matrix DynamicParam(double y, SquaredGaussianModel process)
        {
            double alphaT = process.F(process.CacheDates[0], process.CacheDates[1] - process.CacheDates[0]) +
                            2 * Math.Exp(-process.a1.V() * process.CacheDates[0]) * process.Int(0, process.CacheDates[0]);

            return(new Matrix(new double[] { Math.Pow(y + alphaT, 2) }));
        }
All Usage Examples Of Pelsser.SquaredGaussianModel::Int