CURVFIT with XY error [message #88447] |
Sun, 27 April 2014 14:31  |
amin farhang
Messages: 39 Registered: November 2010
|
Member |
|
|
Hi,
Is there any replacing routine for CURVFIT which was able to do a non-linear least squares fit to a user-supplied function by considering both X and Y error?
data sample:
X = [0.8, 2.2, 3.3, 4.8, 5.8]
Y = [2.02, 2.78, 3.58, 5.05, 6.35]
Xerr = 0.03*X
Yerr = 0.05*Y
Best regards,
|
|
|
|
|
|
|
|
Re: CURVFIT with XY error [message #90197 is a reply to message #90196] |
Tue, 10 February 2015 09:16   |
dg86
Messages: 118 Registered: September 2012
|
Senior Member |
|
|
On Tuesday, February 10, 2015 at 11:42:14 AM UTC-5, brubak...@gmail.com wrote:
> On Monday, February 9, 2015 at 10:10:48 AM UTC-8, Craig Markwardt wrote:
>
>> I think you've got the wrong CURVFIT, fellow.
>
> If so, I have CurvFit name as my trademark and no one else can use it.
>
>
> Phil
A search of the USPTO Trademark Electronic Search System (TESS) turns up
just one trademark for CurvFit, that being for the Curvfit Razor Company.
The registration was filed in 1925, and has since expired.
Anyhow, the IDL routine is called CURVEFIT, with an E.
|
|
|
Re: CURVFIT with XY error [message #90199 is a reply to message #88447] |
Tue, 10 February 2015 10:33   |
Russell[1]
Messages: 101 Registered: August 2011
|
Senior Member |
|
|
I am only aware of this working for fitting a linear function:
y= m*x + b
But for that, you can use Brandon Kelly's fitexy.pro in astrolib:
http://idlastro.gsfc.nasa.gov/contents.html
http://idlastro.gsfc.nasa.gov/ftp/pro/math/fitexy.pro
Are you sure your function is nonlinear? I mean, is there any transformation you can apply to force it to be linear?
-Russell
On Sunday, April 27, 2014 at 5:31:55 PM UTC-4, Amin Farhang wrote:
> Hi,
>
> Is there any replacing routine for CURVFIT which was able to do a non-linear least squares fit to a user-supplied function by considering both X and Y error?
>
> data sample:
>
> X = [0.8, 2.2, 3.3, 4.8, 5.8]
> Y = [2.02, 2.78, 3.58, 5.05, 6.35]
> Xerr = 0.03*X
> Yerr = 0.05*Y
>
>
> Best regards,
|
|
|
Re: CURVFIT with XY error [message #90200 is a reply to message #90199] |
Tue, 10 February 2015 11:11   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Tuesday, February 10, 2015 at 1:33:18 PM UTC-5, rrya...@gmail.com wrote:
> Are you sure your function is nonlinear? I mean, is there any transformation you can apply to force it to be linear?
Things can get a little tricky when the function is non-monotonic. Linear, exponential and power law models are all monotonic, and will work fine with errors in X and Y, but you can also transform those into linear space and use MPFITEXY / FITEXY. This works because the function is single-valued whether it is expressed as y = f(x) or x = g(y).
Once your function has any bumps or wiggles, it's no longer a single-valued function in both x and y. Error bars in the x direction make it ambiguous whether a data point is attached to the left side of a wiggle, or the right side of it. This depends on how sharp the wiggles are, and how small the error bars are.
All this doesn't mean that fitting won't work, but it might mean that the fit converges to a local minimum which is not the global best fit. I.e., extra care is needed.
Craig
P.S. To Phil Brubaker, as already pointed out, the IDL subroutine is called CURVEFIT, and it has existed within IDL since 1982. Good luck with your trademark action.
|
|
|
Re: CURVFIT with XY error [message #90248 is a reply to message #90200] |
Fri, 13 February 2015 11:30  |
brubaker.phil
Messages: 5 Registered: February 2015
|
Junior Member |
|
|
On Tuesday, February 10, 2015 at 11:11:08 AM UTC-8, Craig Markwardt wrote:
> P.S. To Phil Brubaker, as already pointed out, the IDL subroutine is called CURVEFIT, and it has existed within IDL since 1982. Good luck with your trademark action.
My CurvFit (TM) has been in use since the early 1990s. It handles non-linear curves if that is of interest to you; http://fortranCalculus.info/apps/curvfit.html
Phil
|
|
|