I need a similar (or the same) 2D surface to the one in the picture to produce some plots of my own experiments. Any ideas how can I find $f(x, y)$ of this surface?
PS: The picture is taken from Andrew NG's Coursera Machine Learning class, week 5.
I need a similar (or the same) 2D surface to the one in the picture to produce some plots of my own experiments. Any ideas how can I find $f(x, y)$ of this surface?
PS: The picture is taken from Andrew NG's Coursera Machine Learning class, week 5.
Copyright © 2021 JogjaFile Inc.

Okay. I gave some time to this, and here is what I found.
Matlab/octave has a function called
peaks. This function plots the following function on 2d surface:$$ \begin{align} f(x,y) &= 3*(1-x)^2*exp(-x^2 - (y+1)^2) \dots \\ & - 10*(x/5 - x^3 - y^5)*exp(-x^2-y^2) \dots \\ & - 1/3*exp(-(x+1)^2 - y^2) \end{align} $$
This is a pretty interesting surface. Here is the visualization:
Before finding
peaksfunction, I was trying to mix couple 2d gaussian distributions. Here is the octave code that I wrote:Here is the plot of the octave code:
The advantage of using the sum of gaussians over
peaksfunction is that one can easily change the surface by playing with the mean and sigma values whichever the way he/she wants the surface to be.