public void ComputePathFlows(ref PathFlows <double, CouponFlowLabel> pathFlows, PathFlows <double[], IFixing[]> fixingsPath, PathFlows <double[], PaymentInfo[]> flowRebasementPath) { double[][] fixings = fixingsPath.Flows; double[][] rebasements = flowRebasementPath.Flows; double[] autocallFlows = pathFlows.Flows; for (int i = 0; i < autocallFlows.Length; i++) { autocallFlows[i] = 0.0; } int callIndex = CallIndex(fixings); int lastPayCouponIndex = (callIndex < underlyingCallIndexes.Length) ? underlyingCallIndexes[callIndex] : underlyingPathFlows.Length; for (int i = 0; i < lastPayCouponIndex; i++) { autocallFlows[i] = underlyingPathFlows[i].FlowValue(fixings, rebasements); } if (callIndex < redemptionPathFlows.Length) { autocallFlows[underlyingPathFlows.Length + callIndex] = redemptionPathFlows[callIndex].FlowValue(fixings, rebasements); } }
public IPricingResult Price(IProduct product, IModel model, Market market) { var simulatedDates = product.RetrieveEventDates(); McModel mcModel = mcModelFactory.Build(model, market, simulatedDates); var mcEngine = McEngine(product, mcModel); PathFlows <double, CouponFlowLabel> result = mcEngine.Run(nbPaths); return(pricingResult.PricingResult(result, product, market)); }
public ProductPathFlowCalculator(IPathFlowCalculator <double[], IFixing[]> fixingPathCalculator, IPathFlowCalculator <double[], PaymentInfo[]> numerairePathCalc, IProductPathFlow productPathFlow) { this.fixingPathCalculator = fixingPathCalculator; this.numerairePathCalc = numerairePathCalc; this.productPathFlow = productPathFlow; //Buffers initialization fixingsPath = fixingPathCalculator.NewPathFlow(); numerairePath = numerairePathCalc.NewPathFlow(); }
public void ComputePathFlows(ref PathFlows <double, CouponFlowLabel> pathFlows, PathFlows <double[], IFixing[]> fixingsPath, PathFlows <double[], PaymentInfo[]> flowRebasementPath) { double[][] fixings = fixingsPath.Flows; double[][] rebasements = flowRebasementPath.Flows; double[] couponsFlows = pathFlows.Flows; for (int i = 0; i < couponPathFlows.Length; i++) { couponsFlows[i] = couponPathFlows[i].FlowValue(fixings, rebasements); } }
public void ComputeFlows(ref PathFlows <double, CouponFlowLabel> pathFlows, IProcessPath processPath) { fixingPathCalculator.ComputeFlows(ref fixingsPath, processPath); numerairePathCalc.ComputeFlows(ref numerairePath, processPath); productPathFlow.ComputePathFlows(ref pathFlows, fixingsPath, numerairePath); }