# Thread: Linear Least-Squares Regression Problem: Is a_0 = 0 or a_0 ≈ 1.92 (y = a_1 x + a_0)?

1. ## Linear Least-Squares Regression Problem: Is a_0 = 0 or a_0 ≈ 1.92 (y = a_1 x + a_0)?

Hello to everyone that's reading this.

For this linear least-squares regression problem (typed below and also), I correctly find the value of g (which is what the problem statement wants to have found), but I was curious about the value of a 0 a0 (and that's what this entire thread is about).

Problem statement (Alternatively, one can view this PDF: http://docdro.id/GmeGXNr):
"To measure g (the acceleration due to gravity) the following experiment is carried out. A ball is dropped from the top of a 30-m-tall building. As the object is falling down, its speed v is measured at various heights by sensors that are attached to the building. The data measured in the experiment is given in the table.
____________
x (m) | v (m/s) |
----------------------
0 | 0 |
----------------------
5 | 9.85 |
----------------------
10 | 14.32 |
----------------------
15 | 17.63 |
----------------------
20 | 19.34 |
----------------------
25 | 22.41 |
----------------------

In terms of the coordinates shown in the figure (positive down), the speed of the ball v as a function of the distance x is given by v^2 = 2gx. Using linear regression, determine the experimental value of g."

The solution in the PDF (Alternatively, one can view this PDF: http://docdro.id/GmeGXNr):
"The equation v^2 = 2gx can be transformed into linear form by setting Y = v^2. The resulting equation Y = 2gx, is linear in Y and x with m = 2g and b = 0. Therefore, once m is determined, g can be calculated using g = m/s. The calculations are done by executing the following MATLAB program (script file):
Code:
clear all; clc;
x=[0 5 10 15 20 25];
y=[0 9.85 14.32 17.63 19.34 22.41];
Y=y.^2; X=x;
% Equation 5-13
SX=sum(X); SY=sum(Y);
SXY=sum(X.*Y);
SXX=sum(X.*X);
% Equation 5-14
n=length(X);
a1=(n*SXY-SX*SY)/(n*SXX-SX^2)
a0=(SXX*SY-SXY*SX)/(n*SXX-SX^2)
m=a1
b=a0
g=m/2
When the program is executed, the following values are displayed in the Command Window:
a1 = 19.7019
a0 = 1.9170
m = 19.7019
b = 1.9170
g = 9.8510

Thus, the measured value of g is 9.8510 m/s^2."

Basically, what's I'd like to know is:
Should the value of a_0 be 0 or 1.9170380952380952381? What "wins"? The a_0 = (Sxx Sy − Sxy Sx) / (n Sxx − (Sx )^2) formula or the zero term in v^2 = 2gx + 0? Also, if the value of a_0 should be 0, doesn't the formula for a_1 assume that the formula for a_0 will be used, such that if it is not, a_1 would be inaccurate or less accurate?

Any input would be GREATLY appreciated!

2. ## Re: Linear Least-Squares Regression Problem: Is a_0 = 0 or a_0 ≈ 1.92 (y = a_1 x + a_

Hi!

Recall how to interpret the intercept in a simple linear regression model: The intercept is the expected mean value of Y when X=0. In your model, the intercept is $\displaystyle a_0=1.92$. This means your model predicts that the ball's squared velocity is 1.92 m/s when it hits the ground. Equivalently, the model predicts that the ball's velocity is 1.38 m/s when it hits the ground. Said another way, the expected velocity of the ball when it hits the ground is 1.38 m/s according to the model.

Now I am pretty rusty with my physics, but I understand that the ball should have 0 velocity the instant (not the instant before) it makes contact with the ground. First, note that 1.38 m/s is still quite slow compared to the model's predicted velocity when the ball is in the middle of its free fall. Second, and more importantly, understand that the interpretation of the intercept won't always make sense in the real world! Though a ball travelling 1.38 m/s when it hits the ground is an unreasonable data point, we are still correctly interpreting the intercept in the model.

Moral: Models aren't perfect, and neither is the measurement and collection of data. If your intercept value was extremely high, then there may be some reason for concern.

Be well.
-Andy