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 need a function that will produce a graph similar to the one below.

This is the graph (png)

This function is odd, symmetrical relatively to origin in III quarter. A is an asymptote (the top part is similar to hyper-tangent); B is the length of "dead zone" (straight line), where the function value is 0. By changing A and B params the user can control the look of the function, so they have to be included in equation somewhere.

Also it's interesting to know, is there some unified procedure for restoring the function by graph? Maybe some super-computer can do that? I can imagine the approximation by using NURBS methods or similar, but hardly imagine this using analytical way.

share|improve this question
Are you looking for a piecewise solution? How do you feel about $\frac{A}{2}(1 + \frac{2}{pi} tan^{-1}(x-C))$ for an offset C? –  Joshua Shane Liberman Feb 7 '11 at 12:58
@Joshua Shane Liberman, your graph is close, but rotated 90 deg, and the linear part cannot be controlled by A value. Piecewise solution is possible but how to make the correct inflections? –  Andrew Feb 7 '11 at 13:24
I think Joshua's proposal was 0 for 0<x<B and $\frac{A}{2}(1 + \frac{2}{pi} tan^{-1}(x-B))$ for $x\ge B$ It appears the length of the linear part is controlled by B, not A. –  Ross Millikan Feb 7 '11 at 13:46
I'm sorry for my stupidity, now I understood that tan^-1 means "arctan". Yes, your solution is suitable. Can you move it to answers for me to check it? –  Andrew Feb 7 '11 at 14:00

1 Answer 1

up vote 2 down vote accepted

For the more general question, there are basically two approaches. One is what Joshua Shane Lieberman did, to think about the characteristics you want in the function and create a function that does that. There are a number of sigmoid functions beside the arctangent (the logistic function is another.) and working from a graph (as opposed to measured points) it is hard to tell one from another. The other is to have some mathematical model with adjustable parameters and do a numeric fit to determine them. Any numerical analysis text will describe this, for example see chapters 12 and 15 of Numerical Recipes

share|improve this answer
Ross and Joshua, thank you very much for help –  Andrew Feb 7 '11 at 14:26

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.