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 = statistics.expectationValue(comp, less);
        final double x = result.getFirst();

        // TODO: code review :: please verify against QL/C++ code
View Full Code Here


            //not sure whether to throw an exception
            //throw new IllegalArgumentException(empty_sample_set);
        }
        final double target = -valueAtRisk(centile);

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

        final double x = result.getFirst();
        final Integer N = result.getSecond();
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

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

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

        final double x = result.getFirst();
        //mmhh somewhere we have to change N to int
        final Integer N = result.getSecond();
View Full Code Here


    @Override
    public int lowerBound(final double val) {
        final int offset = addr.isFortran() ? 1 : 0;
        return lowerBound(offset, size()+offset, val, new LessThanPredicate());
    }
View Full Code Here

        return lowerBound(offset, size()+offset, val, new LessThanPredicate());
    }

    @Override
    public int lowerBound(final int from, final int to, final double val) {
        return lowerBound(from, to, val, new LessThanPredicate());
    }
View Full Code Here

        return upperBound(offset, size()+offset, val);
    }

    @Override
    public int upperBound(final int from, final int to, final double val) {
        return upperBound(from, to, val, new LessThanPredicate());
    }
View Full Code Here


    @Override
    public int lowerBound(final double val) {
        final int offset = addr.isFortran() ? 1 : 0;
        return lowerBound(offset, size()+offset, val, new LessThanPredicate());
    }
View Full Code Here

        return lowerBound(offset, size()+offset, val, new LessThanPredicate());
    }

    @Override
    public int lowerBound(final int from, final int to, final double val) {
        return lowerBound(from, to, val, new LessThanPredicate());
    }
View Full Code Here

        return upperBound(offset, size()+offset, val);
    }

    @Override
    public int upperBound(final int from, final int to, final double val) {
        return upperBound(from, to, val, new LessThanPredicate());
    }
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.