Package org.jquantlib.math.interpolations

Examples of org.jquantlib.math.interpolations.SABRInterpolation$SABRInterpolationImpl


            for (int k_a=0; k_a<isAlphaFixed.length; ++k_a) {
              for (int k_b=0; k_b<isBetaFixed.length; ++k_b) {
                for (int k_n=0; k_n<isNuFixed.length; ++k_n) {
                  for (int k_r=0; k_r<isRhoFixed.length; ++k_r) {
//FIXME: uncomment
                    final SABRInterpolation sabrInterpolation = new SABRInterpolation(
                            new Array(strikes), new Array(volatilities),
                            expiry, forward,
                            alphaGuess, betaGuess, nuGuess, rhoGuess,
                            isAlphaFixed[k_a], isBetaFixed[k_b],
                            isNuFixed[k_n], isRhoFixed[k_r],
                            vegaWeighted[i],
                            endCriteria, methods[j]);
                    sabrInterpolation.update();

                    // Recover SABR calibration parameters
                    final boolean failed = false;
                    final double calibratedAlpha = sabrInterpolation.alpha();
                    final double calibratedBeta  = sabrInterpolation.beta();
                    final double calibratedNu    = sabrInterpolation.nu();
                    final double calibratedRho   = sabrInterpolation.rho();

                    // TODO: remove these declarations. Added just to make it compile.
//                    final double calibratedAlpha = Double.NaN;
//                    final double calibratedBeta  = Double.NaN;
//                    final double calibratedNu    = Double.NaN;
View Full Code Here


            for (int k_a=0; k_a<isAlphaFixed.length; ++k_a) {
              for (int k_b=0; k_b<isBetaFixed.length; ++k_b) {
                for (int k_n=0; k_n<isNuFixed.length; ++k_n) {
                  for (int k_r=0; k_r<isRhoFixed.length; ++k_r) {
//FIXME: uncomment
                    final SABRInterpolation sabrInterpolation = new SABRInterpolation(
                            new Array(strikes), new Array(volatilities),
                            expiry, forward,
                            alphaGuess, betaGuess, nuGuess, rhoGuess,
                            isAlphaFixed[k_a], isBetaFixed[k_b],
                            isNuFixed[k_n], isRhoFixed[k_r],
                            vegaWeighted[i],
                            endCriteria, methods[j]);
                    sabrInterpolation.update();

                    // Recover SABR calibration parameters
                    final boolean failed = false;
                    final double calibratedAlpha = sabrInterpolation.alpha();
                    final double calibratedBeta  = sabrInterpolation.beta();
                    final double calibratedNu    = sabrInterpolation.nu();
                    final double calibratedRho   = sabrInterpolation.rho();

                    // TODO: remove these declarations. Added just to make it compile.
//                    final double calibratedAlpha = Double.NaN;
//                    final double calibratedBeta  = Double.NaN;
//                    final double calibratedNu    = Double.NaN;
View Full Code Here

          for (int i=0; i<vegaWeighted.length; ++i) {
            for (int k_a=0; k_a<isAlphaFixed.length; ++k_a) {
              for (int k_b=0; k_b<isBetaFixed.length; ++k_b) {
                for (int k_n=0; k_n<isNuFixed.length; ++k_n) {
                  for (int k_r=0; k_r<isRhoFixed.length; ++k_r) {
                    final SABRInterpolation sabrInterpolation =
                      new SABRInterpolation(strikeArray, volatilityArray, expiry, forward,
                                         alphaGuess, betaGuess, nuGuess, rhoGuess,
                                         isAlphaFixed[k_a], isBetaFixed[k_b],
                                         isNuFixed[k_n], isRhoFixed[k_r],
                                         vegaWeighted[i],
                                         endCriteria, methods_.get(j));
                    sabrInterpolation.update();

                    // Recover SABR calibration parameters
                    final double calibratedAlpha = sabrInterpolation.alpha();
                    final double calibratedBeta = sabrInterpolation.beta();
                    final double calibratedNu = sabrInterpolation.nu();
                    final double calibratedRho = sabrInterpolation.rho();
                    double error;

                    // compare results: alpha
                    error = abs(initialAlpha-calibratedAlpha);
                    assertFalse("\nfailed to calibrate alpha Sabr parameter:" +
View Full Code Here

TOP

Related Classes of org.jquantlib.math.interpolations.SABRInterpolation$SABRInterpolationImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.