To solve this problem, we need to consider both an unconstrained and a constrained optimization problem for a linear model with parameters ( w_0 ) and ( w_1 ).
2.1 Set the MMSE Objective Function
The data points you provided are:
- ( d_1 = (x_1 = 1, x_2 = 0), y = 1 )
- ( d_2 = (x_1 = 0, x_2 = 1), y = 1 )
The model we are using is ( y = w_0 x_1 + w_1 x_2 ).
The mean squared error (MSE) for the given data points is:
[
J(\vec{w}) = \frac{1}{2} \sum_{i=1}^{2} (y_i - (w_0 x_{i1} + w_1 x_{i2}))^2
]
For these specific data points, this becomes:
[
J(\vec{w}) = \frac{1}{2} \left[(1 - (w_0 \cdot 1 + w_1 \cdot 0))^2 + (1 - (w_0 \cdot 0 + w_1 \cdot 1))^2\right]
]
Simplifying:
[
J(\vec{w}) = \frac{1}{2} \left[(1 - w_0)^2 + (1 - w_1)^2 \right]
]
To minimize ( J(\vec{w}) ), we take derivatives with respect to ( w_0 ) and ( w_1 ) and set them to zero:
[
\frac{\partial J}{\partial w_0} = -(1-w_0) = 0 \quad \Rightarrow \quad w_0 = 1
]
[
\frac{\partial J}{\partial w_1} = -(1-w_1) = 0 \quad \Rightarrow \quad w_1 = 1
]
Thus, the optimal solution for the unconstrained problem is ( (w_0, w_1) = (1, 1) ).
2.2 Define the Lagrangian Function
The constrained optimization problem is:
[
\vec{w}^* = \arg\min_{\vec{w}} J(\vec{w})
]
[
\text{subject to } ||\vec{w}||^2 \leq C
]
The Lagrangian function ( \mathcal{L} ) for this problem, including the constraint with a Lagrange multiplier (\lambda), is:
[
\mathcal{L}(\vec{w}, \lambda) = \frac{1}{2} \left[(1-w_0)^2 + (1-w_1)^2 \right] + \lambda (w_0^2 + w_1^2 - C)
]
2.3 Solve Using KKT Conditions
The KKT conditions for this problem are derived from:
- Stationarity: (\nabla_{\vec{w}} \mathcal{L} = 0)
- Primal feasibility: (||\vec{w}||^2 \leq C)
- Dual feasibility: (\lambda \geq 0)
- Complementary slackness: (\lambda(||\vec{w}||^2 - C) = 0)
Let's solve for ( C = {0.5, 1, 2, 3} ):
-
Stationarity:
[
\frac{\partial \mathcal{L}}{\partial w_0} = -(1-w_0) + 2\lambda w_0 = 0 \quad \Rightarrow \quad w_0 = \frac{1}{1 + 2\lambda}
]
[
\frac{\partial \mathcal{L}}{\partial w_1} = -(1-w_1) + 2\lambda w_1 = 0 \quad \Rightarrow \quad w_1 = \frac{1}{1 + 2\lambda}
]
Solution suggests ( w_0 = w_1 = \frac{1}{1 + 2\lambda} ).
-
Constraint:
[
w_0^2 + w_1^2 = 2 \left(\frac{1}{1 + 2\lambda}\right)^2 \leq C
]
-
Complementary Slackness:
[
\lambda (2 \left(\frac{1}{1 + 2\lambda}\right)^2 - C) = 0
]
Solve for each ( C ):
These steps provide the optimal solutions and Lagrangian parameter choices for each constraint value ( C ).