Package org.jquantlib.math.integrals

Examples of org.jquantlib.math.integrals.SegmentIntegral



    @Test
    public void testSegment() {
        QL.info("Testing segment integration...");
        testSeveral(new SegmentIntegral(10000));
    }
View Full Code Here


        final double /* @DiscountFactor */dividendDiscount = process.dividendYield().currentLink().discount(a.exercise.lastDate());
        final double /* @DiscountFactor */riskFreeDiscount = process.riskFreeRate().currentLink().discount(a.exercise.lastDate());
        final double /* @Rate */drift = Math.log(dividendDiscount / riskFreeDiscount) - 0.5 * variance;

        final Integrand f = new Integrand(a.payoff, process.stateVariable().currentLink().value(), drift, variance);
        final SegmentIntegral integrator = new SegmentIntegral(5000);

        final double infinity = 10.0*Math.sqrt(variance);
        r.value =
            process.riskFreeRate().currentLink().discount(a.exercise.lastDate()) /
            Math.sqrt(2.0*Math.PI*variance) * integrator.op(f, drift-infinity, drift+infinity);
    }
View Full Code Here

        final double /* @DiscountFactor */dividendDiscount = process.dividendYield().currentLink().discount(a.exercise.lastDate());
        final double /* @DiscountFactor */riskFreeDiscount = process.riskFreeRate().currentLink().discount(a.exercise.lastDate());
        final double /* @Rate */drift = Math.log(dividendDiscount / riskFreeDiscount) - 0.5 * variance;

        final Integrand f = new Integrand(a.payoff, process.stateVariable().currentLink().value(), drift, variance);
        final SegmentIntegral integrator = new SegmentIntegral(5000);

        final double infinity = 10.0*Math.sqrt(variance);
        r.value =
            process.riskFreeRate().currentLink().discount(a.exercise.lastDate()) /
            Math.sqrt(2.0*Math.PI*variance) * integrator.op(f, drift-infinity, drift+infinity);
    }
View Full Code Here


    @Test
    public void testSegment() {
        QL.info("Testing segment integration...");
        testSeveral(new SegmentIntegral(10000));
    }
View Full Code Here

TOP

Related Classes of org.jquantlib.math.integrals.SegmentIntegral

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.