LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

power law fitting with an offset

Hello all,
 
I'm trying to include a power law fitter in one of my VIs. The built-in LabVIEW "Power Fit" VI fits to the equation
 
f = a*(x^b),
 
and it seems to work very well when the data follows this form.
 
However, the real-life data we're taking nearly always has some sort of offset which needs to be fitted as well. So I need a power law fitter that can fit to the equation
 
f = a*(x^b) + c.
 
I tried using the built-in LabVIEW non-linear curve fitter, with this second equation specified, but it seems the algorithm is extremely slow for large numbers of points (much slower than the "Power Fit" VI), and doesn't give as good results as the "Power Fit" VI when they are run side by side on the same set of simulated no-offset data.
 
Can anyone point me to a good power law fitter that includes an offset parameter (if this exists)? Any other suggestions would be appreciated as well.
 
Thanks,
 
Patrick
0 Kudos
Message 1 of 3
(4,007 Views)

Hello PMCR

I have looked around and there does not seem to be any other LabVIEW VIs that can do a power fit as fast as the  one you are currently using.  There are point by point analysis functions available if you would rather use those. 

What is the sign of the exponent?  I have found that a very significant offset will not affect the algorithm much if the exponent is positive.  I have noticed that the error becomes even less with more points being analyzed.

Steven T.

0 Kudos
Message 2 of 3
(3,994 Views)

Hi Steven,

Yes, the exponent is usually positive. Unfortunately, much of our data is taken over a small range, far from the origin, and the fitted power can be quite affected by a large offset.

However, I've come up with a way around the problem: take the numerical derivative of the data, thereby getting rid of the offset, and fit the power law to that. It requires some smoothing, but the results seem to be fairly accurate.

Thanks for your help,

Patrick

0 Kudos
Message 3 of 3
(3,986 Views)