Examples of DPlusMinus


Examples of org.jquantlib.methods.finitedifferences.DPlusMinus

            yd.set(i, normal.derivative(x.get(i)));
        }

        // define the differential operators
        final DZero D = new DZero(N,h);
        final DPlusMinus D2 = new DPlusMinus(N,h);

        // check that the derivative of cum is Gaussian
        temp = D.applyTo(yi);
        for (i=0; i < y.size(); i++) {
            diff.set(i, y.get(i) - temp.get(i));
        }

        double e = Utilities.norm(diff, h);


        if (e > 1.0e-6) {
            fail("norm of 1st derivative of cum minus Gaussian: " + e + "\ntolerance exceeded");
        }

        // check that the second derivative of cum is normal.derivative
        temp = D2.applyTo(yi);
        for (i=0; i < yd.size(); i++) {
            diff.set(i, yd.get(i) - temp.get(i));
        }
        e = Utilities.norm(diff, h);
        if (e > 1.0e-4) {
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.