# Assume we fit the following quadratic function: $f(x) = w_0+w_1x+w_2(x^2)$

The full question is: Assume we fit the following quadratic function: $f(x) = w_0+w_1x+w_2(x^2)$ to the dataset shown (blue circles). The fitted function is shown by the green curve in the picture below. Out of the 3 parameters of the fitted function ($w_0$, $w_1$, $w_2$), which ones are estimated to be 0? (Note: you must select all parameters estimated as 0 to get the question correct.)

Here is the image:

How can we compute this, please I need explanation. This is a question to an assignment in machine learning foundation course. Options: $w_0$ $w_1$ $w_2$, none of the above.

• Um. We need to see the picture. Commented Jan 19, 2017 at 4:37
• Well I have added a link to the picture Commented Jan 19, 2017 at 4:40
• You should flag this question as [self-study], tell us what you have attempted, and what exactly you are struggling with. We do not simply answer problems on this forum when they are homework or homework-like problems. Commented Jan 19, 2017 at 4:45
• Well, it doesn't pass through the origin. Do you think the intercept ($w_0$) is zero? Commented Jan 19, 2017 at 4:51
• When $x=0$ the fitted function equals $w_0$.... Commented Jan 19, 2017 at 4:52

Technically, the answer is probably none of the three would be estimated as zero. Yes, it looks linear, but in real data that has variability around its conditional mean (like this appears to have), there is zero probability that the point estimate of any regression coefficient equals zero.

But the real answer is probably that $w_0, w_1$ are non-zero and $w_2$ is zero. This is because a) the line does not pass through the origin (so $w_0 \neq 0$); and b) the linear looks exactly linear with non-zero slope. So, the second derivative must be zero (i.e. $w_2 = 0$) and the slope must be not zero (i.e. $w_1 \neq 0$).

To solve such problems, we need to be aware of how some of the most commonly used function like linear , polynomial, sine, tan etc look like and their common representation, like say linear function is $y = mx + c$.

Post that, let's say we do this by putting each of the coefficients to zero one by one.

1. What happens when $w_0$ is zero? putting $x = 0 => y = 0$. Now, does the plot satisfy that?
2. Putting $w_1$ to zero, make your expression $y = w_0 + w_1(x^2)$. Now, quadratic functions are concave upward, is your plot too?
3. Putting $w_2$ to zero, makes our function linear. What does that imply on $w1$?

This is a very basis question... Why don't you try it in R?

x <- c(1:100)
plot(x, 10+10*x+0*x*x)
plot(x, 10+10*x+10*x*x)