An simple formula, an example, and an explanation for what all the symbols and variables are for basic linear regression?

Kailyn Hamilton

Kailyn Hamilton

Answered question

2022-11-02

An simple formula, an example, and an explanation for what all the symbols and variables are for basic linear regression?

Answer & Explanation

Phiplyrhypelw0

Phiplyrhypelw0

Beginner2022-11-03Added 24 answers

Lets say you want to find a line
y = a x + b
that best fits the data points
( x 1 , y 1 ) , ( x 2 , y 2 ) , . . . , ( x n , y n )
Then least squares interpolation tells you that you want to minimize the sum of the squares of the deviations, D, from the observed values and the values that would be predicted by the best fit line. That is you want to minimize
D ( a , b ) = i = 1 n ( y i [ a x i + b ] ) 2
And thats where the calculus comes in, but after you apply the calculus you find that the best a and b satisfy the system of linear equations
( i = 1 n x i 2 ) a + ( i = 1 n x i ) b = i = 1 n x i y i
( i = 1 n x i ) a + n b = i = 1 n y i
Which of course, although the sums look intimidating, they are essentially just constants which can be calculated given your data points.
Also, by dividing each equation by n this can also be expressed as the system
s ¯ a + x ¯ b = p ¯
x ¯ + b = y ¯
where x ¯ and y ¯ are the averages of x i and 𝑦𝑖 respectively, s ¯ is the average of the squares of the x i s, and p ¯ is the average of the products of x i and y i .

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Inferential Statistics

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?