X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 31 Mar 2006 05:09 PM by  anon
Comfit function, LOGISTIC FIT
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
31 Mar 2006 05:09 PM
    I am trying to fit data with a logistic curve using the COMFIT function. I know from help that it is possible, but they do not specify how to do it, or what relevant arguments must be used within the function. Does anyone know how to use it? Result = COMFIT( X, Y, A {, /EXPONENTIAL | , /GEOMETRIC | , /GOMPERTZ | , /HYPERBOLIC | , /LOGISTIC | , /LOGSQUARE} [, SIGMA=variable] [, WEIGHTS=vector] [, YFIT=variable] ) My data set is two 1D arrays, of 8 values each holding X values and their corresponding Y values.

    Deleted User



    New Member


    Posts:
    New Member


    --
    31 Mar 2006 05:09 PM
    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
    You are not authorized to post a reply.