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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am stuck in trying to solve the following:

Given two points $(x_{1}; y_{1})$ and $(x_{2}; y_{2})$, to determine the parameters $a$ and $b$ in the equation:
$$y=\frac{e^{a+bx} - e^{a}}{1+e^{a+bx}}.$$
In other words, I have two unknowns and two set of points, so there's for sure a solution, but how can the following system of equation be rewritten explicitly on $a$ and $b$?

$$\left\{\begin{matrix} y_{1}&=\frac{e^{a+bx_{1}} - e^{a}}{1+e^{a+bx_{1}}}\\ y_{2}&=\frac{e^{a+bx_{2}} - e^{a}}{1+e^{a+bx_{2}}} \end{matrix}\right.$$

Should I implement an equation solver instead? In which case, do you have any suggestion on the method?

Thanks very much, I hope it's not a too stupid question :)

share|cite|improve this question
oops misread your question, never mind – Zarrax Dec 6 '10 at 19:46
can you figure out good initial estimates for $a$ and $b$, should you choose the iterative route? Then Newton-Raphson should do the job. – J. M. Dec 7 '10 at 0:07

I don't know how to solve exactly (or even if it's possible) but maybe this will help: Let $A = e^a$ and $B = e^b$. It suffices to find $A$ and $B$ and then take logarithms. Your two equations can be written as $$y_1 = {A(B^{x_1} - 1) \over 1 + AB^{x_1}}$$ $$y_2 = {A(B^{x_2} - 1) \over 1 + AB^{x_2}}$$ You can solve each of these equations for $A$ via some algebra: $$A = {y_1 \over B^{x_1}(1 - y_1) - 1}$$ $$A = {y_2 \over B^{x_2}(1 - y_2) - 1}$$ So the reciprocals of the right-hand sides are the same (the original equation ensures that $y_1$ and $y_2$ are nonzero): $${B^{x_1}(1 - y_1) - 1 \over y_1} = { B^{x_2}(1 - y_2) - 1 \over y_2}$$ In other words, $${1 - y_1 \over y_1}B^{x_1} - {1 - y_2 \over y_2}B^{x_2} = {1 \over y_1} - {1 \over y_2}$$ This doesn't have a general solution you can write out (for example if $x_1$ and $x_2$ are large positive integers it's a polynomial equation of large degree). But it shouldn't be too hard to deal with numerically. Once you know what $B$ is (or have a good enough approximation) you can plug back in above to get $A$.

share|cite|improve this answer
Thanks, is there any particular method you can suggest to solve/approximate the last equation? – Mino Dec 6 '10 at 23:20
Even something like Newton's method should converge to a solution pretty quickly. I plugged a few examples into Wolfram Alpha and it was able to come up with approximations to solutions. – Zarrax Dec 7 '10 at 0:19
Ok thanks, I checked and implemented a simple Newton-Raphson solver. However, take this case: (2; 0.2) and (20; 0.8). It doesn't seem to have real solutions: – Mino Dec 7 '10 at 13:34
See here for a simple javascript implementation: [here 'low-end' and 'high-end' are the two points (x1;y1) and (x2;y2)]. – Mino Dec 7 '10 at 14:14

Your Answer


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.