CURVEFIT question [message #45308] |
Wed, 31 August 2005 01:29 |
elias
Messages: 13 Registered: April 2005
|
Junior Member |
|
|
Hi,
I am trying to fit a function to a set of data that I have generated
with a program in IDL.
I have made various checks to see that the generated data is correct.
So what I have is:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X FLOAT = Array[320]
Y FLOAT = Array[320]
weights=1.0/y (WEIGHTS FLOAT = Array[320])
init=1.0 (;initial value for the user function)
yfit=CURVEFIT(x,y,weights, init, SIGMA, /NODERIVATIVE,
FUNCTION_NAME='microfit')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
The microfit function is:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PRO microfit, x, init, f, pder
f=1.0-0.5*(ERF((1-x)/init)+ERF((1+x)/init))
pder = FltArr(N_ELEMENTS(x))
END
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I do not really understand completely how CURVEFIT works (I am also new
in IDL), but I use /NODERIVATIVE since I don't have analytical
expression for the partial derivative df/dinit.
I get this error message:
% Operands of matrix multiply have incompatible dimensions: <FLOAT
Array[1]>, PDER.
Any idea?
|
|
|