Example usage for org.apache.commons.math3.optimization.direct BOBYQAOptimizer BOBYQAOptimizer

List of usage examples for org.apache.commons.math3.optimization.direct BOBYQAOptimizer BOBYQAOptimizer

Introduction

In this page you can find the example usage for org.apache.commons.math3.optimization.direct BOBYQAOptimizer BOBYQAOptimizer.

Prototype

public BOBYQAOptimizer(int numberOfInterpolationPoints) 

Source Link

Usage

From source file:gamlss.smoothing.PB.java

/**
 * Constructor of PB class.// w  ww .j  a v a 2 s.co m
 * @param distr - object of the fitted distribution belonging
 *  to the gamlss family
 * @param rConnect - object of ConnectionToR class
 * @param smoothMatrices - initially suplied smoother matrices for each 
 * of the distribution parameters
 */
public PB(final GAMLSSFamilyDistribution distr, final ConnectionToR rConnect,
        final HashMap<Integer, BlockRealMatrix> smoothMatrices) {

    nonLinObj = new NonLinObjFunction();
    uniRootObj = new UniRootObjFunction();
    optimizer = new BOBYQAOptimizer(Controls.BOBYQA_INTERPOL_POINTS);
    this.rConnection = rConnect;
    this.smootherMatrices = smoothMatrices;

    for (int i = 1; i < distr.getNumberOfDistribtionParameters() + 1; i++) {
        if (smoothMatrices.get(i) != null) {
            //            if (smoothMatrices.containsKey(i)) {
            // Create smoother matrices of zeros
            lambdas.put(i, Controls.INITIAL_LAMBDA);
            for (int j = 0; j < smoothMatrices.get(i).getColumnDimension(); j++) {
                buildMatrices((ArrayRealVector) smoothMatrices.get(i).getColumnVector(j),
                        Controls.DF_USER_DEFINED[i - 1], j);
            }
            baseMatricesSet.put(i, baseMatrices.clone());
            penaltyMatricesSet.put(i, penaltyMatrices.clone());
            dfValuesSet.put(i, dfValues.clone());
            baseMatrices.clear();
            penaltyMatrices.clear();
            dfValues.clear();

            //            }
        }
    }
}