Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

mpcurvefit vs. a matlab fitting technique

0 views
Skip to first unread message

sheila

unread,
Jul 22, 2008, 8:18:26 AM7/22/08
to
Hi there,

I am trying to run an IDL program using mpcurvefit. The same program
was written in Matlab and used lsqcurvefit for the fitting. I am
having some serious issues with mpcurvefit (although it is better than
the IDL curvefit!) and was hoping you can help me resolve these
issues.

I put 4 coefficients into the fitting routine then mpcurvefit "spits"
out the fitted values for these coefficients. However, the program is
not stable at all. For example

If I put [9.4,0.24,0.77,-1.5]
into the routine
I get [ 9.538911, 0.15903937, 0.72624838, -1.3497545] out.

But if I change the input even slightly eg [9.44,0.24,0.77,-1.5]
I get totally different values out, eg [7.7098139, 0.19333284,
0.60223838, -0.85758867]

Surely this should not be the case?

Also the outputs differ for the same inputs depending on whether I run
IDL on Windows or on Linux.

When I run the same fitting algorithm using Matlab and lsqcurvefit the
program is much more stable. If I put slightly different values into
the routine I still get similar values out, as the iterations conviene
on particular values.

What am I doing wrong with mpcurvefit?! Is there any way to make it
stable. I have gone through the code over and over again and I can't
see what I am doing wrong.

Thank you for your time.

0 new messages