Find P = (x,y) to minimize k by setting dk/dx and dk/dy to 0.
All sums are over i=1,5
(x_i,y_i) = (1,1), (2,4), (3,9), (4,16), (5,25)
k(x,y) = sum[ (x-x_i)^2 + (y-y_i)^2]
= 5 x^2 +5 y^2 + sum(x_i^2) + sum(y_i^2) - 2 x sum(x_i) - 2 y sum(y_i)
0 = dk/dx = 10x - 2 sum(x_i) --> x = sum(x_i)/5 = 3
0 = dk/dy = 10y - 2 sum(y_i) --> y = sum(y_i)/5 = 11
P=(3,11)
k = 384
(moral of the story: As formulated, x and y are completely decoupled and can be optimized independently. Also - the best x and y are the average x and y values of the points - as we have just proven.)
Edited on November 24, 2018, 8:57 pm