## An Optimization Excursion

A student, Emily Wimmer, walked into my office.  She was trying to make sense of an optimization algorithm.  We worked it out and off she went to write a MATLAB program to test the algorithm on a well-behaved function. Of course, just as a mathematician instinctively looks for an counterexample to “break” a proof, I started to imagine a function that would be hard to optimize, in this case,  a prototypical hilly landscape with lots of local optima.  My idea was to use slightly perturbed Chebyshev polynomials over a restricted domain.  With a little tweaking, I had my hilly terrain.

The function is specified in this python code.

# Hilly Landscape Function

def T10X(x):
x = x +.2
y = -(512*x**10-1300*x**8+1120*x**6-400*x**4+50*x**2-1)+1*x**12+.4
return y

def T10Y(x):
x=x-.1
y = (512*x**10-1285*x**8+1120*x**6-400*x**4+50*x**2-1)-1*x**12 – .2
return y

def func2dplot(x,y):
f = -T10X(x)*T10Y(y)
return f

In the course of this investigation I found these images of awesomely weird functions and learned about python’s scipy library of optimization methods.  I tried one of them, “basinhopping,” on my function.  Hence the garish ball locating the “optimum” on the graph above.  It is evidently not the global maximum.  Thus I “broke” that particular optimization method.

All this was an excursion in the middle of excursions.  I was working on a machine learning application.  Then Emily came in with an interesting problem.  Before I could think through that problem, a biology professor had a question about curve-fitting survival curves.  I got that one lined out, then returned to the optimization.  Now I can get back to my machine learning application but who knows what other interesting problem will walk through the door.

By the way, the Jupyter system of interspersing python code and HTML has been highly useful for all these types of explorations. Recommended.