Visualization of Rosenbrock Contours and x'Hx





Figure 1. Plot of Rosenbrock function contours, with two icons superimposed. Each icon represents a quadratic representation of x'Hx at the "cross" points. (See details below.)

Objective: Visualize contours associate with the Rosenbrock function and plot x'Hx at two points, where H represents Hessian of the Rosenbrock function.

Procedure:

  1. Given a Hessian matrix H = [a, 0; 0, b], where a and b are positive, what does the associated isoelevation contour, defined by the equation [x,y] * H * [x;y] = 1, look like? What's the aspect ratio of this contour? What if a>0 and b<0, what does the isoelevation contour look like then?
  2. For a general (meaning, not necessarily diagonal) Hessian matrix (symmetric by definition), answer the previous questions in terms of the eigenvalues and eigenvectors of this Hessian.
  3. Download HessianProbe.zip, from which extract all files.
  4. The last line in probe_n_plot_Hessian.m is an example of the driver code. After this code is executed, left-click at any position in the 2D contour plot that is shown, an icon representing the local Hessian will be plotted in superposition. Keep on going, until the program is terminated by a right-click.
  5. Examine the programs and devise some code that visualizes the gradients associated with different (X,Y) points inserted into the Rosenbrock function f(X,Y). To this end, plot a dot at the selected point, and then draw a short line segment along the gradient direction (that is, towards the ascending direction of the Rosenbrock function), with the line length in proportion to log10(norm(g)), where g is the gradient. Use appropriate color, red for example, to make the gradient-plot prominent from the background contour-plot. Plot results. Comment on how gradient changes and affects converges.
  6. Devise a non-linear 2D functional. Repeat previous step.
  7. Start with a large positive value of lambda and gradually reduce it to zero as iterations proceed. Does this help improve convergence rate? Why?