comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Non linear fit with more than 2 dimensions!, does mpfit work?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Non linear fit with more than 2 dimensions!, does mpfit work? [message #79935] Thu, 12 April 2012 08:40
maldayeh is currently offline  maldayeh
Messages: 13
Registered: January 2006
Junior Member
On Apr 12, 7:45 am, Craig Markwardt <craig.markwa...@gmail.com> wrote:
> On Thursday, April 12, 2012 12:57:04 AM UTC-4, Steve Daal wrote:
>> IDL-ers,
>
>> I have a complex fitting problem that I am tackling. my model function
>> has the form:
>
>> Y(n+1) = A(1 - exp(C*Yn))  *  [X(n+1)/exp(D-Xn - Yn)]
>
>> where Yn and Xn refer to some values at time= n, and Y(n+1), X(n+1)
>> refer to updated values at time =n+1. A,B,C, and D are the parameters
>> of the fit.
>
>> I am aware of mpfit and I think this is doable if I have Yn and Xn
>> only, but I am really puzzled with the existence of the n+1 terms.
>
> The answer is that MPFIT doesn't care about the dimensionality of the problem.  It just wants a list of residuals to minimize.  That goes for the dimensionality of both your *de*pendent and *in*dependent variables.
>
> It's not clear if you want to do a new fit, every time a new N+1 data set arrives.  Or, if you want to do a global fit of all data points at once.
>
> It sounds like you may need to do a FOR loop to evaluate your function.  So be it.  First focus on getting a correct answer, then worry about speed later.
>
> Craig

Great, Thanks Craig!
Re: Non linear fit with more than 2 dimensions!, does mpfit work? [message #79936 is a reply to message #79935] Thu, 12 April 2012 05:45 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Thursday, April 12, 2012 12:57:04 AM UTC-4, Steve Daal wrote:
> IDL-ers,
>
> I have a complex fitting problem that I am tackling. my model function
> has the form:
>
> Y(n+1) = A(1 - exp(C*Yn)) * [X(n+1)/exp(D-Xn - Yn)]
>
> where Yn and Xn refer to some values at time= n, and Y(n+1), X(n+1)
> refer to updated values at time =n+1. A,B,C, and D are the parameters
> of the fit.
>
> I am aware of mpfit and I think this is doable if I have Yn and Xn
> only, but I am really puzzled with the existence of the n+1 terms.

The answer is that MPFIT doesn't care about the dimensionality of the problem. It just wants a list of residuals to minimize. That goes for the dimensionality of both your *de*pendent and *in*dependent variables.

It's not clear if you want to do a new fit, every time a new N+1 data set arrives. Or, if you want to do a global fit of all data points at once.

It sounds like you may need to do a FOR loop to evaluate your function. So be it. First focus on getting a correct answer, then worry about speed later.

Craig
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Trouble with MPFITFUN
Next Topic: Reverse engineering the new graphics PLOT() margin property?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:53:33 PDT 2025

Total time taken to generate the page: 0.00364 seconds