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$
0

1 Answer 1

3
$\begingroup$

something like so, sum of squares of error:

 (pfun[#[[1]]]-#[[2]])^2&/@data //Total
$\endgroup$
1
  • $\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 that you have read and understand our privacy policy and code of conduct.

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