# Get R^2 value between interpolating functions and a list of points

I am looking to compare the degree of accuracy of a theoretical model by comparing my theoretical curve to my experimental data points.

My theoretical curve is an interpolating function generated from a numerical simulation (NDSolve). And the data points I'm looking to compare it with (derived from experimentation) is just a list of lists (e.g. {{0,0.1},{0.1,0.2},{0.2,0.4}} etc.)

What is the best approach to compute the R squared value to measure how well the data points lie on the interpolating function?

• If you look at this reference.wolfram.com/language/tutorial/… with your browser and then use your browser to search for RSquared within that page then there are at least half a dozen references in that for calculating various different R squared values after you have fit a statistical model. That should get you started. – Bill Nov 2 '19 at 2:30
• @Bill Thanks for the response! However most of the approaches on that page seem to be for getting R^2 values of fitted models, i.e. you have the analytical expression for the theoretical curve. In this case I don't, since my theoretical curve is an interpolating function (obtained from numerical simulation) – chris97ong Nov 2 '19 at 2:42
• You should ask this question on CrossValidated because an $R^2$ value is not sufficient for you to decide if you've got a good enough fit. In fact, any single number is likely inadequate to judge a fit. However, if the residuals appear relatively uniform across the range of values, you would be better off using the root mean square as that is in the same units as your theoretical curve and experimental data points. (It should seem odd that a unitless measure like $R^2$ could provide all you need to know about the quality of a fit.) – JimB Nov 2 '19 at 3:36