Package org.jquantlib.math.functions

Examples of org.jquantlib.math.functions.Cube


        final int n = getSampleSize();
        if (n <= 2)
            throw new IllegalArgumentException(unsufficient_sample_size_2);

        final List<Ops.DoubleOp> functions = new ArrayList<Ops.DoubleOp>();
        functions.add(new Cube());
        functions.add(new Bind2nd(new Minus(), mean()));
        final Expression comp = new Expression(functions);

        final double x = expectationValue(comp, new TruePredicate()).getFirst();
        final double sigma = standardDeviation();
View Full Code Here


        /*@Size*/ final int N = samples();
        QL.require(N > 2, "sample number <=2, unsufficient");

        /*@Real*/ final double x = expectationValue(
            new ComposedFunction(
                new Cube(), new Bind2nd(
                    new Minus(), mean())),
                                  new Everywhere()).first();
        /*@Real*/ final double sigma = standardDeviation();

        return (x/(sigma*sigma*sigma))*(N/(N-1.0))*(N/(N-2.0));
 
View Full Code Here

  @Test
  public void testPolynomials() {
    checkSingleTabulated(new Constant(1.0), "f(x)=1", 2.0, 1.0e-13);
    checkSingleTabulated(new Identity(), "f(x)=x", 0.0, 1.0e-13);
    checkSingleTabulated(new Square(), "f(x)=x^2", 2.0/3.0, 1.0e-13);
    checkSingleTabulated(new Cube(), "f(x)=x^3", 0.0, 1.0e-13);
    checkSingleTabulated(new Fourth(), "f(x)=x^4", 2.0/5.0, 1.0e-13);
  }
View Full Code Here

  @Test
  public void testPolynomials() {
    checkSingleTabulated(new Constant(1.0), "f(x)=1",   2.0,     1.0e-13);
    checkSingleTabulated(new Identity(),    "f(x)=x",   0.0,     1.0e-13);
    checkSingleTabulated(new Square(),         "f(x)=x^2", 2.0/3.0, 1.0e-13);
    checkSingleTabulated(new Cube(),        "f(x)=x^3", 0.0,     1.0e-13);
    checkSingleTabulated(new Fourth(),      "f(x)=x^4", 2.0/5.0, 1.0e-13);
  }
View Full Code Here

TOP

Related Classes of org.jquantlib.math.functions.Cube

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.