Package org.jquantlib.math.functions

Examples of org.jquantlib.math.functions.LessThanPredicate


    final List<Ops.DoubleOp> functions = new ArrayList<Ops.DoubleOp>();
    functions.add(new Square());
    functions.add(new Bind2nd(new Minus(), target));
    final Expression comp = new Expression(functions);
    final Ops.DoublePredicate less = new Bind2ndPredicate(new LessThanPredicate(), target);

    final Pair<Double, Integer> result = expectationValue(comp, less);
    final double x = result.first();

    final int n = result.second().intValue();
View Full Code Here


    QL.require(centile>=0.9 && centile<1.0, "percentile out of range [0.9, 1.0)");
    QL.ensure(samples() != 0, EMPTY_SAMPLE_SET);
   
    final double target = -valueAtRisk(centile);

    final Ops.DoublePredicate less = new Bind2ndPredicate(new LessThanPredicate(), target);
    final Pair<Double, Integer> result = expectationValue(new Identity(), less);

    final double x = result.first();
    final Integer N = result.second();
View Full Code Here

   *    \right. }
   */
  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

   * {@latex[ \mathrm{E}\left[ t-x \;|\; x<t \right] }
   */
  public /*@Real*/ double averageShortfall(final /*@Real*/ double target) /*@ReadOnly*/ {

    final Ops.DoubleOp minus = new Bind1st(target, new Minus());
    final Ops.DoublePredicate less = new Bind1stPredicate(target, new LessThanPredicate());
    final Pair<Double, Integer> result = expectationValue(minus, less);

    final double x = result.first();
    final Integer N = result.second();
    QL.ensure(N != 0, NO_DATA_BELOW_THE_TARGET);
View Full Code Here

TOP

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

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.