public static double[,] FwdVolInstantCovariance(Bergomi2FModel b2F, double[] fwdVolStart, double[] fwdVolEnd) { Debug.Assert(fwdVolStart.Length == fwdVolEnd.Length); var correl = Correl(b2F); var varSwapDeformations = VarSwapDeformation(b2F, fwdVolStart, fwdVolEnd); return(ArrayUtils.CartesianProd(varSwapDeformations, varSwapDeformations, (varSwapDef1, varSwapDef2) => correl.BilinearProd(varSwapDef1, varSwapDef2))); }
public static object LocalVolSurface(object mktObj, object[] dates, double[] strikes, string assetName) { return(FunctionRunnerUtils.Run("LocalVolSurface", () => { Market market = MarketManager.Instance.GetMarket(mktObj); AssetMarket assetMarket = market.AssetMarketFromName(assetName); VolatilitySurface volSurface = assetMarket.VolSurface(); var maturities = ObjectConverters.ConvertDateArray(dates, assetMarket.RefDate); return ArrayUtils.CartesianProd(maturities, strikes, volSurface.LocalVol); })); }