public override RnRFunction Zc(DateTime date, DateTime maturity, double fwdZc)
        {
            Contract.Requires(date <= maturity);
            double d     = time[date];
            var    drift = driftTerm.Eval(d);

            return(HwModelUtils.ZcFunction(time[maturity] - d, fwdZc, new[] { meanReversion }, new[, ] {
                { drift }
            }));
        }
Exemplo n.º 2
0
        private static RrFunction Drift(Hw1Model model, PaymentInfo probaMeasure)
        {
            if (!model.PivotCurrency.Equals(probaMeasure.Currency))
            {
                throw new Exception("Hw1Model only domestic currency numeraire allowed !");
            }

            var drift = model.DriftTerm();

            double probaMat = model.Time[probaMeasure.Date];

            if (probaMat > 0.0)
            {
                var probaDrift = (model.Sigma * model.Sigma) * HwModelUtils.ZcRateCoeffFunction(probaMat, model.MeanReversion);
                drift += probaDrift;
            }

            return(drift);
        }