Package org.jquantlib.math.distributions

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


            // theta modified
            theta_correction = baseResults.greeks().vega * ((i * jumpSquareVol) / (2.0 * v * t * t)) + baseResults.greeks().rho * i
            * muPlusHalfSquareVol / (t * t);
            greeks.theta += weight * (baseResults.greeks().theta + theta_correction + lambda * baseResults.value);
            if (i != 0) {
                greeks.theta -= (p.op(i-1) * lambda * baseResults.value);
            }
            // end theta calculation
            greeks.rho += weight * baseResults.greeks().rho;
            greeks.dividendRho += weight * baseResults.greeks().dividendRho;

 
View Full Code Here

        final PoissonDistribution poissondist = new PoissonDistribution(mu);

        for(int i=0;i<n;i++){
            final int z = i;
            final double expected = testvalues[i];
            final double computed = poissondist.op(z);
            // double tolerance = (z<6 ) ? 1.0e-15: 1.0e-10;
            final double tolerance = 1.0e-15; // try to to get 1.0e-15 accuracy whenever possible

            //assertEquals(expected, computed, tolerance);
            if(computed - expected > tolerance){
View Full Code Here

            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

            // theta modified
            theta_correction = baseResults.greeks().vega * ((i * jumpSquareVol) / (2.0 * v * t * t)) + baseResults.greeks().rho * i
            * muPlusHalfSquareVol / (t * t);
            greeks.theta += weight * (baseResults.greeks().theta + theta_correction + lambda * baseResults.value);
            if (i != 0) {
                greeks.theta -= (p.op(i-1) * lambda * baseResults.value);
            }
            // end theta calculation
            greeks.rho += weight * baseResults.greeks().rho;
            greeks.dividendRho += weight * baseResults.greeks().dividendRho;

 
View Full Code Here

    }
    // fix this return type and argument type got mixed up
      public static double evaluatePoissonDistribution(double mu, double sigma){
          PoissonDistribution pd = new PoissonDistribution(mu);
          int k = (int) sigma;
          return pd.op(k);
      }
}
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.