Is the graph of function J always a perfect parabola?

image

Hi!
I have a question about the graphical representation of the J(w), I noticed that it is always a perfect parabola, but I can’t understand why is it perfect?

image

look at this example I made, I don’t understand how J(perfect w + 0.5) == J(perfect w - 0.5)? should not be a J(perfect w + 0.5) < J(perfect w - 0.5), because the line got closer to more points, and thus the parabola should not be perfect?

Thank you so much in advance.

Since J(w) is based on the squares of the errors, yes it will always have he shape of a parabola when plotted vs. the weight values.

2 Likes

But will it be a perfect parabola like this:
13

or imperfect like this:
12

and thank you so much!

1 Like

Your second plot is not a parabola, it’s a 3rd order polynomial.
The cost curve is 2nd order.

2 Likes

Hi @RealOmarKhalil,

Considering a model without the bias term, the cost curve is defined as J = \sum_i (wx_i - y_i)^2 = Aw^2 + Bw +C, where A, B, C each represents a sum of x_i, y_i which can be easily derived.

It is the form of Aw^2 + Bw + C which determines that it is a parabola, and it has nothing to do with a good cost or a bad cost, and it has nothing to do with which value A, B, C take as long as A \ne 0 .

A parabola is a perfect parabola. A parabola has one tuning point. If we have more than one turning point, it is not a parabola but a higher order polynomial.

Cheers,
Raymond

1 Like

I got it. Thank you so much @rmwkwok and @TMosh .