A least-squares line is recomputed from the shown rows. This lesson adds one displayed row and shows the exact sums and coefficients move.

highlighted = computed this step

Base rows give y equals x

The base rows are (0, 0), (1, 1), and (2, 2). Their least-squares line has intercept 0 and slope 1, so it is y=x.

a=0,b=1a=0,\quad b=1
One row can move the fitBase rows, the added row, and the shifted fit are recomputed exactly.One row can move the fitbase rows: (0,0), (1,1), (2,2) -> before line y=xadded row: (3,0)nsum xsum ysum x^2sum xy463145new fita=3/5b=1/10slope = (4*5 - 6*3)/(4*14 - 6^2) = 2/20 = 1/10intercept = (3 - 1/10*6)/4 = 3/5before: y=x after: y=3/5+1/10xshown rows only; NOT future prediction; NOT robust method; NOT model quality

Add one row and recompute sums

Add the row (3, 0). The new sums are n=4, sum x=6, sum y=3, sum x times x=14, and sum x times y=5.

b=456341462=1/10b=\frac{4\cdot5 - 6\cdot3}{4\cdot14 - 6^2}=1/10
One row can move the fitBase rows, the added row, and the shifted fit are recomputed exactly.One row can move the fitbase rows: (0,0), (1,1), (2,2) -> before line y=xadded row: (3,0)nsum xsum ysum x^2sum xy463145new fita=3/5b=1/10slope = (4*5 - 6*3)/(4*14 - 6^2) = 2/20 = 1/10intercept = (3 - 1/10*6)/4 = 3/5before: y=x after: y=3/5+1/10xshown rows only; NOT future prediction; NOT robust method; NOT model quality

Compare before and after

The shifted fit has intercept 3/5 and slope 1/10. Before the added row, the line was y=x; after the added row, the line is y=3/5 plus 1/10x. This is a fit to the shown rows, not a future-prediction claim and not a robust-method recommendation.

a=31/1064=3/5a=\frac{3 - 1/10\cdot6}{4}=3/5
One row can move the fitBase rows, the added row, and the shifted fit are recomputed exactly.One row can move the fitbase rows: (0,0), (1,1), (2,2) -> before line y=xadded row: (3,0)nsum xsum ysum x^2sum xy463145new fita=3/5b=1/10slope = (4*5 - 6*3)/(4*14 - 6^2) = 2/20 = 1/10intercept = (3 - 1/10*6)/4 = 3/5before: y=x after: y=3/5+1/10xshown rows only; NOT future prediction; NOT robust method; NOT model quality