12.07.2015 Views

What Is Optimization Toolbox?

What Is Optimization Toolbox?

What Is Optimization Toolbox?

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Large-Scale Examplestradeoff is beneficial, as the time for quadprog to solve the problem decreasesby a factor of 10.Quadratic Minimization with a Dense but StructuredHessianThe quadprog large-scale method can also solve large problems where theHessian is dense but structured. For these problems, quadprog does notcompute H*Y with the Hessian H directly, as it does for medium-scaleproblems and for large-scale problems with sparse H, becauseformingHwould be memory-intensive. Instead, you must provide quadprog with afunction that, given a matrix Y and information about H, computesW = H*Y.In this example, the Hessian matrix H has the structure H = B + A*A' whereB is a sparse 512-by-512 symmetric matrix, and A is a 512-by-10 sparsematrix composed of a number of dense columns. To avoid excessive memoryusage that could happen by working with H directly because H is dense, theexample provides a Hessian multiply function, qpbox4mult. This function,when passed a matrix Y, uses sparse matrices A and B to compute the Hessianmatrix product W = H*Y = (B + A*A')*Y.In this example, the matrices A and B need to be provided to the Hessianmultiply function qpbox4mult. You can pass one matrix as the first argumentto quadprog, which is passed to the Hessian multiply function. You can use anested function to provide the value of the second matrix.Step 1: Decide what part of H to pass to quadprog as thefirst argument.Either A or B can be passed as the first argument to quadprog. Theexamplechooses to pass B as the first argument because this results in a betterpreconditioner (see “Preconditioning” on page 2-70).quadprog(B,f,[],[],[],[],l,u,xstart,options)Step 2: Write a function to compute Hessian-matrix productsfor H.Now, define a function rungpbox4t that2-67

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!