LabVIEW Student Community

Solved! Go to solution

Determination of initial parameters (curve fitting)


I would like to know, is it possible to find the equation of a curve (it looks very similar to the attached picture, down).


I don't know the equation, and for usage of different fitting options, I have to know the initial parameters. Since I don't know the parameters, how would it be possible that I determine them. It would be very helpful if there is some universal method, since I have to process different curves (similar shape, but different height and width).  


Thank you for your help Smiley Happy

0 Kudos
Message 1 of 6

Re: Determination of initial parameters (curve fitting)

When you say "I don't know the equation" do you mean that you don't know the parameters but have the form of the equation? For example, you might have a line y=m*x+b, where m,b are parameters to be found through fitting the equation to data. Or do you mean that you do not know what form your equation will take?


0 Kudos
Message 2 of 6

Re: Determination of initial parameters (curve fitting)

I don't know which model to use, since the shape of the curve changes, it depends on the data.

It is the most similar to gamma function, but the curves are not completely the same.


I am looking for some option to get the equation from the recorded data, without setting some model previously (and, since I am new with LabVIEW, I don't know does the program has that options).


I would really appreciate any kind of help.


Kind regards


0 Kudos
Message 3 of 6
Accepted by topic author Kikiriki

Re: Determination of initial parameters (curve fitting)

There are two way that I can think of to accomplish what you have described.

1. Curve fit a large number of models and pick the best fit. This option means you will have to implement all the models of interest and generate initial parameters for each model. 

2. Choose a model that can fit a large number of shapes. Polynomials are a good option here. The problem with polynomial models is that they may not reflect the underlying physical process very well.


Depending on what you want to do with the model after fitting you may find option 2 good enough. If you want option 1 then you will have to implement all the models of possible interest and fit each separately, then choose the model that best fits your data.




Message 4 of 6

Re: Determination of initial parameters (curve fitting)

I was also considering the same options, I have just one more question, how to generate initial parameters in LabVIEW?


Kind regards,



0 Kudos
Message 5 of 6

Re: Determination of initial parameters (curve fitting)

The answer is really dependent on your specific model. Your image shows a shape with a peak and an offset above the x-axis. You could find the peak value and peak location using the Peak These values will probably correspond to some model parameters. The offset could be estimated by taking the first or last y-value of your data.


If you have a particular model equation you can always google the model. Wikipedia can be a great resource.


You could also graph your data and your model together. Allow the model parameters to be front-panel controls and adjust them at run-time. When the fit looks good enough you could use these as your initial parameters for fitting. 


As a last resort you could try picking a set of initial parameters at random. This could be done once or many times, picking the best random parameters as your starting point for curve fitting. You should have a good idea of the scale of your parameters before trying this. 



0 Kudos
Message 6 of 6
This is an open group. Sign in and click the "Join Group" button to become a group member and start posting.