Exemplo n.º 1
0
        private static string SabrAtmCalibrationWithTenor()
        {
            const string expiry        = "3m";
            const string tenor         = "0.25y";
            const string swaption      = "VOLGRID " + expiry + tenor;
            const double atmVolatility = 20;
            const double assetPrice    = 3.44;
            const double nu            = 0.7561;
            const double rho           = -0.3702;
            string       handle        = Handle(expiry, tenor);

            SabrCalibrationSettings(swaption);
            return(SABRHelper.CalibrateSabrAtmModelWithTenor(handle, swaption, nu, rho, atmVolatility,
                                                             assetPrice, expiry, tenor));
        }
Exemplo n.º 2
0
        public void SabrInterpolateVolatilityTest2()
        {
            const string expiry    = "6m";
            const double strike    = 0.03;
            const double assetCode = 5.0587;
            const double nu        = 0.9211;
            const double rho       = -0.2823;
            const double atmVol    = 23.18;
            const string tenor     = "1y";
            const string handle    = "6m1y ATM VOLGRID Calibration";
            string       swaption  = SABRHelper.AddSabrCalibrationSettings("VOLGRID 6m1y", "Swaption", "AUD", 1);
            string       handle2   =
                SABRHelper.CalibrateSabrAtmModelWithTenor(handle, swaption, nu, rho, atmVol,
                                                          assetCode, expiry, tenor);
            decimal      actual   = SABRHelper.SabrImpliedVolatility(handle2, expiry, tenor, strike);
            const double expected = 1.3829;

            Assert.AreEqual(expected, (double)actual, 0.0001);
        }