Package org.jquantlib.math.functions

Examples of org.jquantlib.math.functions.TruePredicate


    \f[ \langle x \rangle = \frac{\sum w_i x_i}{\sum w_i}. \f]
     */
    public final double mean() {
        final int size = getSampleSize();
        QL.require(size > 0 , empty_sample_set); // QA:[RG]::verified
        return expectationValue(new Identity(), new TruePredicate()).getFirst();
    }
View Full Code Here


        functions.add(new Square());
        functions.add(new Bind2nd(new Minus(), mean()));
        final Expression comp = new Expression(functions);

        // Evaluate the composed function in the specified range (ie. everyWhere).
        final double s2 = expectationValue(comp, new TruePredicate()).getFirst();
        return s2*n/(n-1.0);
    }
View Full Code Here

        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();
        final double _n = n;
        return (_n / ((_n - 1) * (_n - 2))) * x / (Math.pow(sigma, 3));
    }
View Full Code Here

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

        final double x = expectationValue(comp, new TruePredicate()).getFirst();

        final double _N = n;
        final double sigma2 = standardDeviation();
        final double c1 = (_N/(_N-1.0)) * (_N/(_N-2.0)) * ((n+1.0)/(_N-3.0));
        final double c2 = 3.0 * ((_N-1.0)/(_N-2.0)) * ((_N-1.0)/(_N-3.0));
 
View Full Code Here

    public double shortfall(final double target){
        if (statistics.getSampleSize()==0)
            throw new IllegalArgumentException(empty_sample_set);

        final Ops.DoublePredicate less = new Bind2ndPredicate(new LessThanPredicate(), target);
        return statistics.expectationValue(new Clipped(less, new Constant(1.0)), new TruePredicate()).getFirst();
    }
View Full Code Here

   */
  public /*@Real*/ double shortfall(final /*@Real*/ double target) /*@ReadOnly*/ {
    QL.ensure(samples() != 0, EMPTY_SAMPLE_SET);

    final Ops.DoublePredicate less = new Bind2ndPredicate(new LessThanPredicate(), target);
    return expectationValue(new Clipped(less, new Constant(1.0)), new TruePredicate()).first();
  }
View Full Code Here

TOP

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

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.