Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Interpolant fits / goodness of fit query
Replies: 1   Last Post: Jul 18, 2013 9:21 AM

 Messages: [ Previous | Next ]
 Steven Lord Posts: 18,038 Registered: 12/7/04
Re: Interpolant fits / goodness of fit query
Posted: Jul 18, 2013 9:21 AM

"D R G" <grimesd2@gmail.com> wrote in message
> I have a model of a process that is discrete - I also have some
> experimental data, and I want to work out how well this fits the discrete
> function; of course, some of these experimental points are 'between' my
> discrete points, so I need to be able to estimate these to get a goodness
> of fit: using interpolant fitting in the GUI curve fitting tool yields a
> perfect fit,

Of course it does. That's the main difference between interpolation and
curve fitting.

https://en.wikipedia.org/wiki/Interpolant#Related_concepts

> whether linear, cubic of shape preserving is used: is thee some way I can
> generate all my interpolant points to compare them with the data points?
> I've attached an image of 30 of my discrete data points, and the
> interpolant function that easily joins them.
>
> http://i.imgur.com/kz5XgzI.png - Screencap of discrete function / interp.
> fit

Export the interpolant from the Curve Fitting GUI or generate code from the
interpolant, then evaluate the exported interpolant or execute the generated
code.

http://www.mathworks.com/help/curvefit/generating-code-and-exporting-fits-to-the-workspace.html

> My second question is can I then find a command line version? I will need
> to automate this for a few hundred runs to find the best fit, and would be
> ideal if I could code it into a .m file to basically generate a
> interpolant fit, and compare this to lab data to get a goodness of fit.

See above or use the FIT function provided by Curve Fitting Toolbox:

http://www.mathworks.com/help/curvefit/fit.html

--
Steve Lord
slord@mathworks.com