How to fit a model into an optimization function

27 Views Asked by At

I have the following linear model:

$F(x,w)=w_0 + \sum_{i=1}^D w_ix_i + e_i $

Have the following square loss minimization function:

$L_D(w)={1/2} \sum_{n=1}^N( f(x,w)-y)^2 $

I need to fit the linear model into the optimization function and solve it.

So I am assuming I need to solve something like this where I replaces the $ f(x,w) $ with $w_0+\sum_{i=1}^D w_ix_i + e_i$:

$L_D(w)={1/2} \sum_{n=1}^N( w_0 + \sum_{i=1}^D (w_ix_i + e_i )-y)^2 $

I have no idea how to approach this equation. Can someone suggest how to simplify it.