Processing math: 100%

 

 

 

Writing the Cost Function

We define the MSE without the 1/n factor and have then, using that

Xβ=[2β0β10], C(β)=(42β0)2+(2β1)2+λ(β20+β21),

and taking the derivative with respect to β0 we get

β0=84+λ,

and for β1 we obtain

β1=21+λ,

Using the constraint for β20+β21=1 we can constrain λ by solving

(84+λ)2+(21+λ)2=1,

which gives λ=4.571 and β0=0.933 and β1=0.359.