protected override IFactorModelRepresentation Build(EquityModel model, Market market, PaymentInfo probaMeasure)
        {
            var asset = model.Asset;

            if (!probaMeasure.Financing.Currency.Equals(probaMeasure.Currency) ||
                !probaMeasure.Currency.Equals(asset.Currency))
            {
                throw new NotImplementedException("TODO !");
            }

            var numeraireDiscount  = market.DiscountCurve(probaMeasure.Financing);
            var assetMkt           = market.AssetMarket(asset);
            var assetDiscountCurve = assetMkt.AssetFinancingCurve(numeraireDiscount);

            var zc     = new DeterministicZcRepresentation(model.PivotCurrency, 1);
            var bsSpot = new EquitySpotRepresentation(model.Asset, assetDiscountCurve, probaMeasure);

            return(new FactorRepresentation(market, new[] { zc }, new[] { bsSpot }));
        }
Beispiel #2
0
        protected override IProcessPathGenerator Build(LocalVolatilityModel model, Market market, PaymentInfo probaMeasure, DateTime[] simulatedDates)
        {
            var asset    = model.Asset;
            var assetMkt = market.AssetMarket(asset);

            if (!probaMeasure.Financing.Currency.Equals(probaMeasure.Currency) ||
                !probaMeasure.Currency.Equals(asset.Currency))
            {
                throw new NotImplementedException("TODO !");
            }

            var           numeraireDiscount = market.DiscountCurve(probaMeasure.Financing);
            DiscountCurve assetDiscount     = assetMkt.AssetFinancingCurve(numeraireDiscount);
            double        forward           = assetMkt.Spot / assetDiscount.Zc(probaMeasure.Date);

            LocalVolSimulatorStepDatas[] stepSimulDatas = EnumerableUtils.For(0, simulatedDates.Length,
                                                                              i => StepSimulDatas(i > 0 ? simulatedDates[i - 1] : market.RefDate, simulatedDates[i],
                                                                                                  model, assetDiscount, probaMeasure.Date));

            return(new LocalVolEquityPathGenerator(stepSimulDatas, forward));
        }