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)); }
public RnRFunction Spot(DateTime date) { var forwardWithoutDivs = assetDiscountCurve.Zc(probaMeasure.Date) / assetDiscountCurve.Zc(date); return(RnRFunctions.Affine(0.0, new[] { forwardWithoutDivs })); }
public override RnRFunction Zc(DateTime date, DateTime maturity, double fwdZc) { return(RnRFunctions.Constant(fwdZc, dimension)); }