public ProcessPathFlowGenerator(BrownianBridge brownianBridge, IProcessPathGenerator processPathGen, IPathFlowCalculator <TFlow, TLabel> flowPathCalculator) { this.brownianBridge = brownianBridge; this.processPathGen = processPathGen; this.flowPathCalculator = flowPathCalculator; dWs = ArrayUtils.CreateJaggedArray <double>(brownianBridge.Dates.Length, 1); }
public McModel(IFactorModelRepresentation factorRepresentation, DateTime[] simulatedDates, IRandomGenerator randomGenerator, BrownianBridge brownianBridge, IProcessPathGenerator processPathGen, PaymentInfo probaMeasure, double numeraire0) { Numeraire0 = numeraire0; ProbaMeasure = probaMeasure; ProcessPathGen = processPathGen; RandomGenerator = randomGenerator; BrownianBridge = brownianBridge; SimulatedDates = simulatedDates; FactorRepresentation = factorRepresentation; }
public McModel Build(IModel model, Market market, DateTime[] simulatedDates) { PaymentInfo probaMeasure = ProbaMeasure(simulatedDates, model); var factorRepresentationFactory = FactorRepresentationFactories.For(model); IFactorModelRepresentation factorRepresentation = factorRepresentationFactory.Build(model, market, probaMeasure); var modelPathGenFactory = ModelPathGeneratorFactories.For(model, mcConfig); IProcessPathGenerator processPathGenerator = modelPathGenFactory.Build(model, market, probaMeasure, simulatedDates); BrownianBridge brownianBridge = BrownianBridge.Create(processPathGenerator.AllSimulatedDates); int randomDim = brownianBridge.GaussianSize(processPathGenerator.ProcessDim); IRandomGenerator randomGenerator = mcConfig.RandomGenerator.Build(randomDim); double numeraire0 = market.DiscountCurve(probaMeasure.Financing).Zc(probaMeasure.Date); return(new McModel(factorRepresentation, simulatedDates, randomGenerator, brownianBridge, processPathGenerator, probaMeasure, numeraire0)); }