Example #1
0
        public static RnRFunction ZcFunction(double duration, double fwdZc, double[] meanReversions, double[,] covariances)
        {
            var    zcRateCoeffs = meanReversions.Map(l => ZcRateCoeff(duration, l));
            double cvx          = covariances.BilinearProd(zcRateCoeffs, zcRateCoeffs);

            return(RnRFunctions.ExpAffine(fwdZc * Math.Exp(-0.5 * cvx), zcRateCoeffs));
        }