Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I would like to rearrange the logistic function:

$$y=\frac1{1+\exp(-a+bx)}$$

To calculate $x=f(y)$

So I did the following:

$$\frac1{y}=1+\exp(-a+bx)$$ $$\ln\left(\frac1{y}-1\right)=-a+bx$$ $$\frac{\ln\left(\frac1{y}-1\right) +a}{b}=x$$

but when I try to plot this function, it appears that I have lost a '-' somewhere, i.e., I have calculated $-x=f(y)$

Where I have missed the negative sign?

share|improve this question
2  
Are you sure your original function is written correctly? Shouldn't $x$ have a negative coefficient? –  Qiaochu Yuan Apr 19 '11 at 22:41
    
@Qiaochu Do you mean $y=\frac{-1}{1+\text{exp}(-a+bx)}$? –  Abe Apr 20 '11 at 15:29
add comment

2 Answers

I am not allowed to comment, so I will answer. First, your algebra is correct. If you plotted it, you must have specified numeric values for a, b. I tried a=2, b=1 and the plots looked totally inverse, just as they should [except the sigmoid was decreasing i.e. reflected in y-axis as compared to usual logistic], so if your plots did not look inverse to each other, what values of a,b did you use? If you tell us that, perhaps we could say more.

share|improve this answer
    
@Rita; +1 and hope that you give answers instead of comments in the future so you can eventually down vote. Also, you get +100 in reputation by adding another site. So click here while logged in as Rita the dog: meta.stackoverflow.com . –  Carl Brannen Apr 20 '11 at 0:17
    
@Carl: thanks, signed onto meta but so far no bonus. Maybe there is a delay. –  Rita the dog Apr 20 '11 at 0:57
    
@Rita; Ooops. Now that I read more, it seems that this only applies in getting starting rep in a new area when you already have rep somewhere else in excess of 200. See: meta.stackexchange.com/questions/35033/… But having looked at your other comments, I believe you will be at the 200 level in a week or two at most. –  Carl Brannen Apr 20 '11 at 2:20
    
@Rita I was using $[a,b]= [-20.6, 0.25]$, a maximum likelihood fit for a logistic regression model to data. I was trying to invert the equation to predict x from y, but apparently I made the mistake of starting with the wrong equation. –  Abe Apr 20 '11 at 15:36
add comment

Your answer is indeed correct. For $y \in (0,1)$ you'll get a function decreasing from $+\infty$ for $y=0^+$ to $-\infty$ as $y \to 1$ as it should. Remember that the graph of the inverse function is obtained by mirroring the graph around the line $x=y$.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.