From the Online Help for COMFIT you see the following explanation of the 'A' coefficients in the /LOGISTIC model for COMFIT fitting:
y = 1 / ( a[0] * (a[1] ^ x) + a[2] )
This shows that A should have three elements, and that points to the following general syntax:
a = [1.,1.,1.] ; three rough guesses, if you do not have a better estimate
logistic_coefs = comfit(x, y, a, /LOGISTIC)
If 'logistic_coefs' subsequently eq [-0.108403, 1.03924, 0.150802], as mine did in an experiment with a random 8-element array I did here, then you would know that COMFIT is predicting that the formula:
y = 1 / ( -0.1 * (1.0 ^ x) + 0.15 )
should be a good predicter of the values in your 8-element Y array.
If you further called:
logistic_coefs = comfit(x, y, a, /LOGISTIC, SIGMA=sigma, YFIT=yfit)
then, at the end of the call you will have two new variables in your IDL session, 'sigma' and 'yfit', which show some statistics about the quality of the LOGISTIC fit predicted by the 'logistic_coefs' result.
James Jones
|