public override IModel Build(BlackScholesModelDescription bs, Market market) { var time = ModelFactoryUtils.DefaultTime(market.RefDate); var assetMkt = market.AssetMarketFromName(bs.Asset); var localDividends = bs.WithDivs ? assetMkt.Dividends.Map(div => div.DivModel()) : new DiscreteLocalDividend[0]; return(new BlackScholesModel(time, assetMkt.Asset, bs.Sigma.ToStepFunction(time), localDividends)); }
public override IModel Build(Bergomi2FModelDescription b2F, Market market) { ITimeMeasure time = ModelFactoryUtils.DefaultTime(market.RefDate); var assetMkt = market.AssetMarketFromName(b2F.Asset); var localDividends = b2F.WithDivs ? assetMkt.Dividends.Map(div => div.DivModel()) : new DiscreteLocalDividend[0]; return(new Bergomi2FModel(assetMkt.Asset, localDividends, time, BuildXi(b2F.Sigma, time), b2F.K1, b2F.K2, b2F.Theta, b2F.Nu, b2F.RhoXY, b2F.RhoSX, b2F.RhoSY)); }
public override IModel Build(Hw1ModelDescription model, Market market) { var time = ModelFactoryUtils.DefaultTime(market.RefDate); return(new Hw1Model(time, model.Currency, model.MeanReversion, model.Sigma.ToStepFunction(time))); }