Register to reply 
Fit data with a curve in MATLAB 
Share this thread: 
#1
Nov2112, 10:37 AM

P: 49

Hi friends.
I wanna fit my x datas and y datas with a function in the most exact way.my data is:
can you give me the most suitable formula for the curve of these data? thank you so much 


#2
Nov2112, 11:43 AM

P: 70

It is possible to EXACTLY fit any finite number of [x,y] data pairs using the method of divided differences. N data points can be fitted exactly by a polynomial of degree N1.
If you want something else out of the data, such as the ability to interpolate or parameters that have an actual meaning according to some model, then you will have to construct a mathematical model from a priori principles. Your best bet then would be to use a nonlinear leastsquare regression (weighted, if you can weigh the data) that will find the best fit of the data to the mathematical model. I recommend the Simplex method as being very robust and not too dependent on the initial estimates of the parameters (coefficients, constants, etc) in the model. In the long run, the method you choose should be driven by what you already know about the source of the data, and by what you expect to get out of the data. One caveat I feel must be made: don't expect extrapolations to mean much. Extrapolations are toys by which engineers, economists, and other nonscientists delude themselves. 


#3
Nov2112, 01:56 PM

P: 49

you are right but I just wanna predict a few next points for taking them as my initial numbers for my program
so is there anybody who knows a way in matlab for finding the formula of plot of my points? 


#4
Nov2212, 01:06 PM

P: 1,212

Fit data with a curve in MATLAB
The problem is you haven't given any constraints for your function. There are an infinite number of functions which fit your data exactly. You need to constrain the model by saying, for example, it should be a polynomial of order 18 (as tadchem suggested). This continuous model would at least make any extrapolation attempt somewhat dependant on the data.
MATLAB can solve the problem (in many different ways) once you do this. Until you do this, the problem is hugely illposed. 


#5
Nov2212, 02:30 PM

P: 49

So what formula do you suggest for fitthing these datas? thank you so much 


#6
Nov2312, 06:05 AM

P: 70

Just for starters, try plotting your [x,y] pairs on logarithmic coordinates. That may at least give you a hint of what the function may look like.



Register to reply 
Related Discussions  
Fitting a Gauss curve to lab data  Precalculus Mathematics Homework  8  
Curve Fitting Data  Introductory Physics Homework  1  
How to export Matlab curvefitted data to excel?  Math & Science Software  2  
Parabolic curve fit to x,y data  Calculus & Beyond Homework  6  
Fitting a curve to data  General Math  9 