Package com.opengamma.analytics.math.statistics.distribution

Examples of com.opengamma.analytics.math.statistics.distribution.NonCentralChiSquaredDistribution


        final double b = 1.0 / (1 - beta);
        final double x = b * b / sigma / sigma / t;
        final double a = Math.pow(k, 2 * (1 - beta)) * x;
        final double c = Math.pow(forward, 2 * (1 - beta)) * x;
        if (beta < 1) {
          final NonCentralChiSquaredDistribution chiSq1 = new NonCentralChiSquaredDistribution(b + 2, c);
          final NonCentralChiSquaredDistribution chiSq2 = new NonCentralChiSquaredDistribution(b, a);
          if (isCall) {
            return numeraire * (forward * (1 - chiSq1.getCDF(a)) - k * chiSq2.getCDF(c));
          }
          return numeraire * (k * (1 - chiSq2.getCDF(c)) - forward * chiSq1.getCDF(a));
        }
        final NonCentralChiSquaredDistribution chiSq1 = new NonCentralChiSquaredDistribution(-b, a);
        final NonCentralChiSquaredDistribution chiSq2 = new NonCentralChiSquaredDistribution(2 - b, c);
        if (isCall) {
          return numeraire * (forward * (1 - chiSq1.getCDF(c)) - k * chiSq2.getCDF(a));
        }
        return numeraire * (k * (1 - chiSq2.getCDF(a)) - forward * chiSq1.getCDF(c));
      }
    };
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.math.statistics.distribution.NonCentralChiSquaredDistribution

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.