Topic: Logistic Regression

I would like to use the Function -> Insert Trendline feature to find a logistic regression model for a point series. Since this type of regression analysis is not included in the stock list, I tried creating a new model under the User Defined tab, to no avail.

I would like to find an equation of the form y=c/(1+ae^bx).

I tried defining a Logistic model in the following way: $a/(1+$b*exp($c*x)). This does not work.

Suggestions anyone?

2 (edited by ali_fz 2013-10-01 17:07:40)

Re: Logistic Regression

I try it for my selected data series.
When I try to evaluate with this formula: $a/($b+$c*exp ($d*x))) ; it shows that "not found any solution, try another model"

But I see when I add a minus sign "-" before $d, It can solve it. ($d is a constant and should be every real number, even <0)
ie. $a/($b+$c*exp (-$d*x)))

I hope you solve your problem by this trick, Also I request Ivan to fix this inconvenient solution

You can find it in this link

http://uppit.com/0hql6fxm8seu/Model,_M1&M2.grf

Re: Logistic Regression

Thanks for responding to my query so quickly! Unfortunately, the equation provided does not calculate a logistic trendline.

First, just to be sure we are on the same page, recall that a logistic model has the form c/(1+ae^(-bx)).

You are correct that including the negative sign allows the trendline function to give an output, but the trendline given is a horizontal line, not a logistic curve, and therefore does not follow the path of the logistic point series.

To be clear: I tried both of the following equations, and both failed:
1. $a/($b+$c*exp (-$d*x)) [as you graciously proposed]
2. $a/(1+$b*exp (-$c*x))   [modified for general logistic form]

Suggestions?

Re: Logistic Regression

@ali_fz
The algorithm used by Graph needs an initial guess for all the constants. If you do not provide a guess, Graph will assume 1 for the guess for all the constants. You can set the initial guess after adding the model to the list. So in your case a guess of -1 for $d would help. I plan to improve this in the future to let Graph provide the initial guess for a lot of common functions.

@xinafernandez
Without seeing your data points I assume your problem is also the initial guess.

Re: Logistic Regression

Thank for your guide. I didn't read help of Trend line and after your explanation, i find it out.