1

How can I evaluate the result of Fit applied to the data used in the example code below

data = {{0, 1}, {1, 0}, {3, 2}, {5, 4}};

line = Fit[data, {1, x}, x]

How do I now evaluate the function line at a particular point where x = 2.5 let's say.

thorimur
  • 9,010
  • 18
  • 32
  • The answer to this question is here: https://mathematica.stackexchange.com/questions/182053/functionalize-fit – NewMathematica Mar 10 '21 at 19:50
  • 1
    The best way is not to use Fit in the first place. Use LinearModelFit or NonlinearModelFit and you'll also have access to estimates of standard errors, confidence bands, goodness-of-fit statistics, etc. – JimB Mar 10 '21 at 21:10
  • line /. x -> 2.5 gives 1.92373 – Daniel Huber Mar 11 '21 at 10:50

0 Answers0