public static double LinearRateModel_OisRateComplex(string modelName, string oisSwapName) { LinearRateModel model = ObjectMap.LinearRateModels[modelName]; OisSwap swap = (OisSwap)ObjectMap.LinearRateInstruments[oisSwapName]; return(model.DiscCurve.OisRate(swap, InterpMethod.Hermite)); }
public static void RiskJacobian_Make(string baseHandle, string linearRateModelHandle, DateTime asOf, string[] calibSetsHandles, string[] curveTenors, bool useAd = false) { LinearRateModel model = ObjectMap.LinearRateModels[linearRateModelHandle]; RiskJacobian jacobian = new RiskJacobian(model, asOf); if (calibSetsHandles.Length != curveTenors.Length) { throw new InvalidOperationException("CurveTenor and Calibration set handles must have same dimension."); } for (int i = 0; i < calibSetsHandles.Length; i++) { jacobian.AddInstruments(ObjectMap.CalibrationInstrumentSets[calibSetsHandles[i]], StrToEnum.CurveTenorConvert(curveTenors[i])); } // Using this procedure, the instruments are actually sorted. jacobian.Initialize(); if (useAd) { // Construct using AD jacobian.ConstructUsingAD(); } else { jacobian.ConstructUsingBumpAndRun(); } ObjectMap.RiskJacobians[baseHandle] = jacobian; }
public static double LinearRateModel_BasisSwapValue(string baseName, string swapName) { LinearRateModel model = ObjectMap.LinearRateModels[baseName]; TenorBasisSwap swap = (TenorBasisSwap)ObjectMap.LinearRateInstruments[swapName]; return(model.BasisSwapNpv(swap)); }
public static double LinearRateModel_BasisParSpread(string modelName, string basisSwapName) { LinearRateModel model = ObjectMap.LinearRateModels[modelName]; TenorBasisSwap swap = (TenorBasisSwap)ObjectMap.LinearRateInstruments[basisSwapName]; return(model.ParBasisSpread(swap)); }
public static double LinearRateModel_FloatLegValue(string baseName, string floatLegName) { LinearRateModel model = ObjectMap.LinearRateModels[baseName]; FloatLeg fixedLeg = ObjectMap.FloatLegs[floatLegName]; return(model.ValueFloatLeg(fixedLeg)); }
public static double LinearRateModel_SwapParRate(string baseName, string swapName) { LinearRateModel model = ObjectMap.LinearRateModels[baseName]; IrSwap swap = (IrSwap)ObjectMap.LinearRateInstruments[swapName]; return(model.IrParSwapRate(swap)); }
public static double LinearRateModel_Value(string linearRateModelHandle, string productHandle) { LinearRateInstrument product = ObjectMap.LinearRateInstruments[productHandle]; LinearRateModel model = ObjectMap.LinearRateModels[linearRateModelHandle]; return(model.ValueLinearRateProduct(product)); }
public static object[,] ZcbRiskAD(string linearRateModelHandle, string productHandle) { LinearRateModel model = ObjectMap.LinearRateModels[linearRateModelHandle]; LinearRateInstrument product = ObjectMap.LinearRateInstruments[productHandle]; return(model.CreateTestOutputAD(product)); }
public static void InstrumentFactory_UpdateAllInstrumentsToPar(string baseName, string modelHandle) { LinearRateModel model = ObjectMap.LinearRateModels[modelHandle]; InstrumentFactory factory = ObjectMap.InstrumentFactories[baseName]; factory.UpdateAllInstrumentsToParGivenModel(model); }
public static void LinearRateModel_Make(string baseName, string fwdCurveCollectionName, string discCurveName, InterpMethod interpolation) { FwdCurveContainer fwdCurves = ObjectMap.FwdCurveCollections[fwdCurveCollectionName]; Curve discCurve = ObjectMap.DiscCurves[discCurveName]; LinearRateModel model = new LinearRateModel(discCurve, fwdCurves, interpolation); ObjectMap.LinearRateModels[baseName] = model; }
public static void RiskEngineNew_Make(string baseHandle, string portfolioHandle, string riskJacobianHandle, bool useAd) { RiskJacobian jacobian = ObjectMap.RiskJacobians[riskJacobianHandle]; double determinant = jacobian.Jacobian.Determinant(); LinearRateModel model = jacobian.Model; Portfolio portfolio = ObjectMap.Portfolios[portfolioHandle]; ObjectMap.RiskEngines[baseHandle] = new RiskEngine(model, portfolio, jacobian, useAd); }