• edited by
460 views
2 2 votes

Which of the following is the best second-order polynomial that fits the dataset by the least sum of squares method?

$$
\min _{\theta_0, \theta_1, \theta_2} \sum_{i=1}^3\left(y_i-\left(\theta_0+\theta_1 x_i+\theta_2 x_i^2\right)\right)^2
$$

\[
\begin{array}{|c|c|c|c|}
\hline
x & 1 & 0 & -1 \\
\hline
y & -1 & 1 & 1 \\
\hline
\end{array}
\]

  1. $1- x+x^2$
     
  2. $1- x-x^2$
     
  3. $1+ x+x^2$
     
  4. $1- x+2x^2$

1 Answer

1 1 vote
Fit $y=\theta_0+\theta_1 x+\theta_2 x^2$ to $(1,-1),(0,1),(-1,1)$.

From $x=0 \Rightarrow y=1: \theta_0=1$.

From $x=1:-1=1+\theta_1+\theta_2 \Rightarrow \theta_1+\theta_2=-2$.

From $x=-1: 1=1-\theta_1+\theta_2 \Rightarrow-\theta_1+\theta_2=0 \Rightarrow \theta_2=\theta_1$.

Thus $2 \theta_1=-2 \Rightarrow \theta_1=-1$ and $\theta_2=-1$.

$$
y=1-x-x^2
$$
Answer:
Position:
Show:

Related questions

1 1 vote
2 2 answers
299
299 views
GO Classes asked Sep 22, 2025
299 views
Why is data preprocessing necessary before using it for model building?The data may contain outliers or missing values due to errors in data Features may have different s...
0 0 votes
1 1 answer
283
283 views
GO Classes asked Sep 22, 2025
283 views
What is the primary risk of not performing a train-test split in a machine learning workflow?The training time will increase. The model might overfit the training data an...
1 1 vote
2 2 answers
309
309 views
GO Classes asked Sep 22, 2025
309 views
A bank wants to predict whether a customer will default on a loan using a classification model. The bank collects data from past customers, which includes the following f...
0 0 votes
1 1 answer
289
289 views
GO Classes asked Sep 22, 2025
289 views
A bank wants to predict whether a customer will default on a loan using a classification model. The bank collects data from past customers, which includes the following f...