[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple non-linear regression analysis

"Kenlo Nishida" <kenlo@ntsg.umt.edu> writes:
> How can I make multiple non-linear regression analysis with IDL?
> I know "LMFIT" command can make a non-linear regression analysis
> for a single independent variable. However, I want to know
> an appropriate command or function of IDL which provide me with
> a fitting of an arbitrary non-linear function with two or more 
> independent variables. I mean, I want to determine the following 
> three parameters (a, b, c):
> y=f(x1, x2, x3; a, b, c)
> Here x1, x2, and x3 are arrays of independent variables each
> containing n data. y is an array of dependent variable with
> n data. a, b, and c are scalars (parameters) which determine 
> the non-linear function f(x1, x2, x3).

Similar questions and answers:


By the way, you should not use LMFIT for two reasons.  The first
reason is that LMFIT cannot handle more than one independent variable.
The second is that LMFIT is very inefficient since it calls your
function once for each data point, instead of as a vector.

Use CURVEFIT (IDL built-in) or MPFITFUN+MPFIT from my web page.  The
MPFIT2DFUN function is a specialization for fitting images.

The technique I refer to in these two articles is easy to implement.
Since neither CURVEFIT nor MPFIT require any special structure for
your independent variable, "X", you can in principle make it have any
structure you'd like.  In this case it would be a N_obs x 3 array, one
row for each independent variable.  Then in your fitting function you
would break the array into its components again.  

Good luck,

Web page: http://cow.physics.wisc.edu/~craigm/idl/idl.html

Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response