Package org.jquantlib.math.optimization

Examples of org.jquantlib.math.optimization.Problem


        optimizationMethods_.add(makeOptimizationMethods(optimizationMethodTypes, simplexLambda, levenbergMarquardtEpsfcn, levenbergMarquardtXtol, levenbergMarquardtGtol));
        // Set expected results for optimizer

        for (int i=0; i<costFunctions_.size(); ++i) {
            final Problem problem = new Problem(costFunctions_.get(i), constraints_.get(i), initialValues_.get(i));
            for (int j=0; j<(optimizationMethods_.get(i)).size(); ++j) {
                final EndCriteria.Type endCriteriaResult = optimizationMethods_.get(i).get(j).minimize(problem, endCriterias_.get(i));
            final Array xMinCalculated = problem.currentValue();
            final Array yMinCalculated = problem.values(xMinCalculated);
            // Check optimizatin results vs known solution
            for (int k=0; k < xMinCalculated.size(); ++k) {
                //if(Math.abs(yMinExpected_.get(k)- yMinCalculated.get(k))> functionEpsilons_.get(i)){
                //if (std::fabs(yMinExpected_[k]- yMinCalculated[k]) > functionEpsilons_[i]) {
                if (true) {
View Full Code Here


                    startArray[localisation-dataAdjust] = data[0];
                }

                final PenaltyFunction currentCost = new PenaltyFunction(initialDataPoint, (i - localisation + 1), (i + 1));

                final Problem toSolve = new Problem(currentCost, solverConstraint, new Array(startArray));
                final EndCriteria.Type endType = solver.minimize (toSolve, endCriteria);

                QL.require (endType == EndCriteria.Type.StationaryFunctionAccuracy ||
                            endType == EndCriteria.Type.StationaryFunctionValue,
                            "Unable to strip yieldcurve to required accuracy");
View Full Code Here

        final ProjectedCostFunction constrainedSABRError = new ProjectedCostFunction(costFunction, inversedTransformatedGuess, parameterAreFixed);

        final Array projectedGuess = new Array(constrainedSABRError.project(inversedTransformatedGuess));

        final NoConstraint constraint = new NoConstraint();
        final Problem problem = new Problem(constrainedSABRError, constraint, projectedGuess);
        itsCoeffs.SABREndCriteria_ = optMethod_.minimize(problem, endCriteria_);
        final Array projectedResult = new Array(problem.currentValue());
        final Array transfResult = new Array(constrainedSABRError.include(projectedResult));

        final Array result = transformation_.direct(transfResult);
        itsCoeffs.alpha_ = result.get(0);
        itsCoeffs.beta_ = result.get(1);
View Full Code Here

            System.arraycopy(weights, 0, w, 0, w.length);
        }

        final CalibrationFunction f = new CalibrationFunction(this, instruments, w);

        final Problem prob = new Problem(f, c, params());
        shortRateEndCriteria_ = method.minimize(prob, endCriteria);
        final Array result = new Array(prob.currentValue());
        setParams(result);
        final Array shortRateProblemValues_ = prob.values(result);

        notifyObservers();
    }
View Full Code Here

        optimizationMethods_.add(makeOptimizationMethods(optimizationMethodTypes, simplexLambda, levenbergMarquardtEpsfcn, levenbergMarquardtXtol, levenbergMarquardtGtol));
        // Set expected results for optimizer

        for (int i=0; i<costFunctions_.size(); ++i) {
            final Problem problem = new Problem(costFunctions_.get(i), constraints_.get(i), initialValues_.get(i));
            for (int j=0; j<(optimizationMethods_.get(i)).size(); ++j) {
                final EndCriteria.Type endCriteriaResult = optimizationMethods_.get(i).get(j).minimize(problem, endCriterias_.get(i));
            final Array xMinCalculated = problem.currentValue();
            final Array yMinCalculated = problem.values(xMinCalculated);
            // Check optimizatin results vs known solution
            for (int k=0; k < xMinCalculated.size(); ++k) {
                //if(Math.abs(yMinExpected_.get(k)- yMinCalculated.get(k))> functionEpsilons_.get(i)){
                //if (std::fabs(yMinExpected_[k]- yMinCalculated[k]) > functionEpsilons_[i]) {
                if (true) {
View Full Code Here

        final ProjectedCostFunction constrainedSABRError = new ProjectedCostFunction(costFunction, inversedTransformatedGuess, parameterAreFixed);

        final Array projectedGuess = new Array(constrainedSABRError.project(inversedTransformatedGuess));

        final NoConstraint constraint = new NoConstraint();
        final Problem problem = new Problem(constrainedSABRError, constraint, projectedGuess);
        itsCoeffs.SABREndCriteria_ = optMethod_.minimize(problem, endCriteria_);
        final Array projectedResult = new Array(problem.currentValue());
        final Array transfResult = new Array(constrainedSABRError.include(projectedResult));

        final Array result = transformation_.direct(transfResult);
        itsCoeffs.alpha_ = result.get(0);
        itsCoeffs.beta_ = result.get(1);
View Full Code Here

TOP

Related Classes of org.jquantlib.math.optimization.Problem

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.