Examples of op()


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

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

        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

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

        final CumulativeNormalDistribution gIntegral = new CumulativeNormalDistribution(m, std);
        final NormalDistribution g = new NormalDistribution(m, std);
        final double firstTerm = variance + m * m - 2.0 * target * m + target * target;
        final double alfa = gIntegral.op(target);
        final double secondTerm = m - target;
        final double beta = variance * g.op(target);
        final double result = alfa * firstTerm - beta * secondTerm;
        return result / alfa;
    }

    /*
 
View Full Code Here

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

        final double m = statistics.mean();
        final double std = statistics.standardDeviation();
        final InverseCumulativeNormal gInverse = new InverseCumulativeNormal(m, std);
        final double var = gInverse.op(1.0 - percentile);
        final NormalDistribution g = new NormalDistribution(m, std);
        final double result = m - std * std * g.op(var) / (1.0 - percentile);
        // expectedShortfall must be a loss
        // this means that it has to be MIN(result, 0.0)
        // expectedShortfall must also be a positive quantity, so -MIN(*)
        return -Math.min(result, 0.0);
    }
View Full Code Here

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

    public double gaussianAverageShortfall(final double target) {
        final double m = statistics.mean();
        final double std = statistics.standardDeviation();
        final CumulativeNormalDistribution gIntegral = new CumulativeNormalDistribution(m, std);
        final NormalDistribution g = new NormalDistribution(m, std);
        return ((target - m) + std * std * g.op(target) / gIntegral.op(target));
    }

    /*
     * TODO: where do we need this one???????????????????????????????? //! Helper class for precomputed distributions class
     * StatsHolder { public: typedef Real value_type; StatsHolder(Real mean, Real standardDeviation) : mean_(mean),
View Full Code Here

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

            volTS.linkTo(new BlackConstantVol(rateRefDate, volcal, v, voldc));

            baseArguments.validate();
            baseEngine.calculate();

            weight = p.op(i);
            R.value += weight * baseResults.value;
            greeks.delta += weight * baseResults.greeks().delta;
            greeks.gamma += weight * baseResults.greeks().gamma;
            greeks.vega += weight * (Math.sqrt(variance / t) / v) * baseResults.greeks().vega;
            // theta modified
View Full Code Here

Examples of org.jquantlib.math.integrals.GaussKronrodAdaptive.op()

          double tmp=0.0;
          final Var_Helper helper = new Var_Helper(this, i, j);

          final GaussKronrodAdaptive integrator = new GaussKronrodAdaptive(1e-10, 10000);
          for (int k=0; k<64; ++k) {
            tmp+=integrator.op(helper, k*t/64., (k+1)*t/64.);
        }
          return tmp;
      }

}
View Full Code Here

Examples of org.jquantlib.math.integrals.GaussKronrodAdaptive.op()

        for (int i = 0; i < size_; ++i) {
            for (int j = 0; j <= i; ++j) {
                final Var_Helper helper = new Var_Helper(this, i, j);
                final GaussKronrodAdaptive integrator = new GaussKronrodAdaptive(1e-10, 10000);
                for(int k = 0; k<64; ++k) {
                    tmp.set(i, j, tmp.get(i, j)+integrator.op(helper, k*t/64.0,(k+1)*t/64.0));
                }
                tmp.set(j,i, tmp.get(i, j));
            }
        }

View Full Code Here

Examples of org.jquantlib.math.integrals.GaussKronrodPatterson.op()

  }

  private void checkSingleTabulated(final Ops.DoubleOp f, final String tag, final double expected, final double tolerance) {

    final Integrator quad = new GaussKronrodPatterson();
      final double realised = quad.op(f,-1,1);

        if (Math.abs(realised-expected) > tolerance)
          fail(" integrating " + tag + "\n"
                    + "    realised: " + realised + "\n"
                    + "    expected: " + expected);
View Full Code Here

Examples of org.jquantlib.math.integrals.Integrator.op()

  }

  private void checkSingleTabulated(final Ops.DoubleOp f, final String tag, final double expected, final double tolerance) {

    final Integrator quad = new GaussKronrodPatterson();
      final double realised = quad.op(f,-1,1);

        if (Math.abs(realised-expected) > tolerance)
          fail(" integrating " + tag + "\n"
                    + "    realised: " + realised + "\n"
                    + "    expected: " + expected);
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.