0
$\begingroup$

I have an interpolating function

pfun[t]

and a data set in the form of

{{t,f}}

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.

$\endgroup$
3
$\begingroup$

something like so, sum of squares of error:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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