# using lagrange multipliers to fit a curve through a point

So this is part math/ part statistics. I have a set of data I'm fitting a 2nd order curve through using least squares method (matrix form). However, I've been given the requirement to pass the curve through a particular point. it's the y-intercept and starting point of the regression line in this case. I read you can use lagrange multipliers to do this. All the examples I read about these multipliers are related to min/max problems. I understand lagrange interpolation but it seems like this is another beast. Are these multipliers independant of the least squares or can they be used independently? And/or does anybody know how to do this or know of an article explaining this? note there are 30+ points (not three). Also, if there are any other suggestions on how to do this I'm all ears. this is just what i had found so far. Thank you in advance!

• What you need to do is minimize the quadratic error subject to your constraints. (That's what least squares do without constraints) – rlartiga Jul 11 '14 at 13:58
• I can't say I follow. what do you mean by constraints and how would you minimize said quadratic error? – m25 Jul 11 '14 at 15:44

For sure, there is another way if you look for a solution which does not use Lagrange multipliers (I should consider it simpler). You want to minimize $$\Phi= \sum_i (f(x_i)-y_i)^2$$ using $$f(x_i)=\beta_0+\beta_1 x_i +\beta_2 x_i^2$$ and you want to constraint the model such that $f(x_1)=y_1$. The constraint allows you to eliminate $\beta_0$ and let you with two parameters for a classical least-square fit.

The problem of least squares is:

$$\min_\beta \sum_i (f(x_i)-y_i)^2$$

Where $f(x_i)$ is your favorite form, in your case $f(x)=\beta_0+\beta_1 x +\beta_2 x^2$

Then what do you want is the next:

$$\min_\beta \sum_i (f(x_i)-y_i)^2$$ $$\text{s.t.} f(x_1)=y_1$$

What is equivalent to minimize the lagrangian:

$$L(\beta,\lambda)= \sum_i (f(x_i)-y_i)^2+\lambda(y_1-f(x_1))$$

• It is the saddlepoint of the Lagrangian, not the min. There is no min anyways, since if you fix $\beta$, you can choose $\lambda$ to make the second term as negative as you want. – Nick Alger Jul 12 '14 at 5:55