Help with mrqmin()


opticsresearch
06-25-2004, 10:16 AM
Dear Sir or Madam,

I recently bought your Numerical Recipes in C++, and am trying to figure out the function mrqmin. There appears to be several variable passed to this fuction that I cannot figure out what they are.
These are the variables that I know:
x[] -- an array of the x-data
y[] -- an array of the y-data
sig[] -- an array of the individual standard deviations (uncertain if these are in x or y)
ndata -- number of total data points

There are the variable that I do not know:
a[] -- ?
lista[] -- ?
chisq -- (assumed to be the chisq, but uncertain why this needs to be passed)
mfit -- ?
covar -- ?
funcs -- (function being fit?)
alamda -- ?

Any help would be much appreciated. Thanks in advance.

Nathan Johnson
Research Associate
Photon Transport Laboratories

guptas
11-11-2005, 02:16 AM
I just now joined the forum , so it is too late for your reply. Still I want to reply .
Well I do not use c++, I use c so plz convert the things according to your choice.

a[] -- these are the model parameters to fit. You have to pass them as the elements of an array.
lista[] -- Is it similar to ia in (numerical recipes in c) . If yes then this is an integer array which will tell the routine which parameters to fit . put 0 for the parameter which you want to keep fix and 1 for the parameter which you want to fit.
chisq -- It is chisquare. You don't need to suply chisq . routine will return it.
mfit -- It is model which you want to fit.
covar -- this is a matrix. which you dont need to suply.
funcs -- this is a user suplied function. It is not the fitting function. Your will suply the model and its derivatives to mrqmin by this function.
alamda -- It is also curvature matrix which you need not suply.

I dont know if this information is relevant to you now.


guptas