using lagrange multipliers to fit a curve through a point

1.2k Views Asked by At

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!

2

There are 2 best solutions below

1
On

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))$$

0
On

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.