[Math] How to read a contour plot

graphing-functions

I am taking machine learning, and I have seen a few contour plots in the course.

It seems that I can't understand how to read this plot, I have tried looking it up in Wikipedia, but I don't even understand the first example (the figure on the right).

Another example is from the course:

enter image description here

The remark in the brackets say that it is easier to see that the function plotted is convex from the counter plot. but I don't see it at all.

What are those circles ? what is the meaning that the red x is in the inner circle (or even near its middle) ?

I would appreciate it if someone could please explain what information I should be able to read from the right drawing (the contour plot) and how ?

Best Answer

The circles you see are level sets: the function $J$ is equal where the colors are the same, i.e. around each circle. The red X is, presumably, the point where $J$ attains its minimum.

If you've ever seen a topographic map, it is also a form of contour plot, where the function being plotted is the height of the ground.

From the plot you should be able to see that the function $J$ is "bowl-shaped" and therefore convex. Moreover, from the spacing you can see that the function increases quickly starting from the X and moving up-right or down-left, and slowly moving up-left or down-right.

Related Question