I have an interpolating function


and a data set in the form of


what can I do to get a numeric estimate on how closely the function fits the data ?

I read up on how LinearModelFit/NonlinearModelFit has options to display r-squared value, but this doesn't suit my case as I already have a function and don't need to fit anything.


1 Answer 1


something like so, sum of squares of error:

 (pfun[#[[1]]]-#[[2]])^2&/@data //Total
  • $\begingroup$ decided to calculate as sum of abs values of error divided by number of elements, thank you $\endgroup$ Dec 13, 2017 at 3:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.