0

please give me an advice.

I have points ("data", x and y coordinates). For these points, I created a residual function

function = LinearModelFit [dat, x, x]

Now I have to determine the point that has the smallest and largest distance from this line. And also a point that lies on a straight line. Unfortunately, I don't know how to do it. I only know how to calculate the smallest / largest distance (Min [function ["FitResiduals"]]) or Max [function ["FitResiduals"]]. But I would now need to see the given point with the corresponding coordinates (eg [0.2, 5])

Thank you for your answer

AsukaMinato
  • 9,758
  • 1
  • 14
  • 40
Thera
  • 41
  • 2
  • 2
    You can use Ordering[function["FitResiduals"], 1] to find the position of the smallest residual and then use that position to find the corresponding point in dat. You can use Ordering[..., -1] to find the position of the largest residual in the same manner. – Sjoerd Smit Apr 30 '21 at 08:40

0 Answers0