Newton unconstrained
where is convex and twice differentiable.
Code example
Consider the following quadratic problem:
where , and
RealMatrix PMatrix = new Array2DRowRealMatrix(new double[][] {
{ 1.68, 0.34, 0.38 },
{ 0.34, 3.09, -1.59 },
{ 0.38, -1.59, 1.54 } });
RealVector qVector = new ArrayRealVector(new double[] { 0.018, 0.025, 0.01 });
// Objective function.
double theta = 0.01522;
RealMatrix P = PMatrix.scalarMultiply(theta);
RealVector q = qVector.mapMultiply(-1);
PDQuadraticMultivariateRealFunction objectiveFunction = new PDQuadraticMultivariateRealFunction(P.getData(), q.toArray(), 0);
OptimizationRequest or = new OptimizationRequest();
or.setF0(objectiveFunction);
or.setInitialPoint(new double[] {0.04, 0.50, 0.46});
or.setTolerance(1.e-8);
//optimization
NewtonUnconstrained opt = new NewtonUnconstrained();
opt.setOptimizationRequest(or);
opt.optimize();

