Post Reply 
Interpolation Equation
07-08-2024, 08:19 PM
Post: #11
RE: Interpolation Equation
(07-08-2024 01:23 AM)MNH Wrote:  Is it the same as linear regression?

(02-10-2024 06:26 PM)Thomas Klemm Wrote:  For just two points \(P_1 = (x_1, y_1)\) and \(P_2 = (x_2, y_2)\) we want to solve the following linear system of equations:

\(
\begin{bmatrix}
x_1 & 1 \\
x_2 & 1 \\
\end{bmatrix}
\cdot
\begin{bmatrix}
a \\
b \\
\end{bmatrix}
=
\begin{bmatrix}
y_1 \\
y_2 \\
\end{bmatrix}
\)

This leads to:

\(
\begin{align}
a &= \frac{y_1 - y_2}{x_1 - x_2} \\
\\
b &= \frac{x_1 y_2 - x_2 y_1}{x_1 - x_2} \\
\end{align}
\)

However we solve instead the following system of equations:

\(
\begin{bmatrix}
\sum x^2 & \sum x \\
\sum x & n \\
\end{bmatrix}
\cdot
\begin{bmatrix}
a \\
b \\
\end{bmatrix}
=
\begin{bmatrix}
\sum xy \\
\sum y \\
\end{bmatrix}
\)

In case of \(n = 2\) the solutions are:

\(
\begin{align}
a
&= \frac{2(x_1 y_1 + x_2 y_2) - (x_1 + x_2)(y_1 + y_2)}{2 (x_1^2 + x_2^2) - (x_1 + x_2)^2} \\
&= \frac{(x_1 - x_2)(y_1 - y_2)}{(x_1 - x_2)^2} \\
&= \frac{y_1 - y_2}{x_1 - x_2} \\
\\
b
&= \frac{(x_1^2 + x_2^2)(y_1 + y_2) - (x_1 + x_2)(x_1 y_1 + x_2 y_2)}{2 (x_1^2 + x_2^2) - (x_1 + x_2)^2} \\
&= \frac{(x_1 - x_2)(x_1 y_2 - x_2 y_1)}{(x_1 - x_2)^2} \\
&= \frac{x_1 y_2 - x_2 y_1}{x_1 - x_2} \\
\end{align}
\)

Thus, we end up with the same result.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Interpolation Equation - MNH - 07-08-2024, 01:23 AM
RE: Interpolation Equation - Namir - 07-08-2024, 01:29 AM
RE: Interpolation Equation - SlideRule - 07-08-2024, 01:33 AM
RE: Interpolation Equation - Thomas Klemm - 07-08-2024, 02:09 PM
RE: Interpolation Equation - Namir - 07-08-2024, 03:00 PM
RE: Interpolation Equation - KeithB - 07-08-2024, 02:43 PM
RE: Interpolation Equation - Gil - 07-08-2024, 06:12 PM
RE: Interpolation Equation - Thomas Klemm - 07-08-2024, 07:32 PM
RE: Interpolation Equation - Gil - 07-08-2024, 07:46 PM
RE: Interpolation Equation - Thomas Klemm - 07-08-2024, 08:13 PM
RE: Interpolation Equation - Thomas Klemm - 07-08-2024 08:19 PM
RE: Interpolation Equation - PedroLeiva - 07-09-2024, 10:37 AM
RE: Interpolation Equation - Albert Chan - 07-09-2024, 11:09 AM
RE: Interpolation Equation - Thomas Klemm - 07-09-2024, 12:13 PM
RE: Interpolation Equation - PedroLeiva - 07-09-2024, 12:22 PM
RE: Interpolation Equation - Thomas Klemm - 07-09-2024, 12:51 PM
RE: Interpolation Equation - PedroLeiva - 07-09-2024, 01:00 PM
RE: Interpolation Equation - Johnh - 07-09-2024, 11:27 PM



User(s) browsing this thread: 11 Guest(s)