Package org.jquantlib.math.distributions

Examples of org.jquantlib.math.distributions.NonCentralChiSquaredDistribution.op()


        final NonCentralChiSquaredDistribution chis = new NonCentralChiSquaredDistribution(df, ncps);
        final NonCentralChiSquaredDistribution chit = new NonCentralChiSquaredDistribution(df, ncpt);

        final double z = Math.log(super.A(t, s) / strike) / b;
        final double call = discountS * chis.op(2.0 * z * (rho + psi + b)) - strike * discountT
        * chit.op(2.0 * z * (rho + psi));
        if (type.equals(Option.Type.Call))
            return call;
        else
            return call - discountS + strike * discountT;

 
View Full Code Here


        final NonCentralChiSquaredDistribution chis = new NonCentralChiSquaredDistribution(df, ncps);
        final NonCentralChiSquaredDistribution chit = new NonCentralChiSquaredDistribution(df, ncpt);

        final double /* @Real */z = Math.log(A(t, s) / strike) / b;
        final double /*@Real*/ call = discountS*chis.op(2.0*z*(rho+psi+b)) -
        strike*discountT*chit.op(2.0*z*(rho+psi));

        if (type == Option.Type.Call) {
            return 0.0;
        } else {
            return 1.0;
View Full Code Here

        final NonCentralChiSquaredDistribution chis = new NonCentralChiSquaredDistribution(df, ncps);
        final NonCentralChiSquaredDistribution chit = new NonCentralChiSquaredDistribution(df, ncpt);

        final double z = Math.log(super.A(t, s) / strike) / b;
        final double call = discountS * chis.op(2.0 * z * (rho + psi + b)) - strike * discountT
        * chit.op(2.0 * z * (rho + psi));
        if (type.equals(Option.Type.Call))
            return call;
        else
            return call - discountS + strike * discountT;

 
View Full Code Here

        final NonCentralChiSquaredDistribution chis = new NonCentralChiSquaredDistribution(df, ncps);
        final NonCentralChiSquaredDistribution chit = new NonCentralChiSquaredDistribution(df, ncpt);

        final double /* @Real */z = Math.log(A(t, s) / strike) / b;
        final double /*@Real*/ call = discountS*chis.op(2.0*z*(rho+psi+b)) -
        strike*discountT*chit.op(2.0*z*(rho+psi));

        if (type == Option.Type.Call) {
            return 0.0;
        } else {
            return 1.0;
View Full Code Here

      final double df = value[0];
      final double ncp = value[1];
      final double x = value[2];
      final double expected = value[3];
      final NonCentralChiSquaredDistribution nccsd = new NonCentralChiSquaredDistribution(df, ncp);
      final double realised = nccsd.op(x);
      if (Math.abs(expected-realised)>1.0e-6)
        fail("Noncentral chi squared failed: df " + df
          + " ncp " + ncp
          + " x " + x
          + " expected " + expected
View Full Code Here



public static double evaluateNonCentralChiSquaredDistribution(double df, double x, double ncp) {
     NonCentralChiSquaredDistribution ncd = new NonCentralChiSquaredDistribution(df,ncp);
     return ncd.op(x);

}
    public static double evaluateInverseCumulativePoisson(double lambda, double x) {
        InverseCumulativePoisson icp = new InverseCumulativePoisson(lambda);
        return icp.op(x);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.