3
$\begingroup$

I want to define a function family $f_a(x)$ with a parameter $a$ in $(0,1)$, where:

For any $a$, $f_a(0) = Y_0$ and $f_a(X_0) = 0$ (see image)

For $a = 0.5$, this function is a straight line from $(0,Y_0)$ to $(X_0, 0)$. For $a < 0.5$, up to zero (asymptotically perhaps), I want $f_a$ to be a curve below, and for $a > 0.5$, the curve should be to the other side.

I didn't fill the diagram with many examples, but I hope you get the idea. Different values of $a$ always produce a distinct, monotonic curve, below all curves of larger values of $a$, and above all curves for smaller values of $a$. E.g.: when I decrease $a$, the distance of the $(0,0)$ point from the curve decreases, and if I increase $a$, it increases.

Sorry for the clumsy description but I hope you got the intuition of what I'm trying to define! Any suggestion of how this function $f_a(x)$ could look like?

Depiction of the function family I want to define

5 Answers 5

6

Here is a completely different approach that leads to much nicer behavior at the corners.

The idea is to take a line of negative unit slope, $y=\beta-x$, extending to infinity in both directions, and then squeeze it into your target rectangle using the logistic function and its inverse the logit.

The logistic function and logit contains exponentials and logarithm, but these mostly cancel out each other when we put the whole thing together, and we get $$y = \frac{y_0}{1+e^{-\beta}\frac{x}{x_0-x}}$$ We then have to decide how $\beta$ must depend on $a$ -- your desired behavior will result if we set $e^{-\beta}=(1-a)/a$, to get the final definition $$ y = \frac{y_0}{1+\frac{(1-a)x}{a(x_0-x)}}$$ This has a number of nice properties:

  • It's a simple rational expression.
  • For $a=1/2$ the curve is a straight line, as specified.
  • The slope of the curve varies smoothly with $a$ everywhere, even at the endpoints.
  • When $x_0=y_0$, all curves are symmetric about the line $x=y$.
  • When $x_0=y_0$, replacing $a$ with $1-a$ will simply reflect the curve about the diagonal.
  • 0
    wow, brilliant! I tried this, and it works. I'm very excited that you managed to avoid exponentials, that was the only thorn that was bothering me. So simple, yet I would never figure it myself. If you have a paypal account or google checkout, I'd be extremely glad to channel a donation, thanks!2011-09-20
  • 0
    No money donations accepted, but you can tell everyone how brilliant and helpful a guy I am ... By the way, I just noticed that I had calibrated my expression for $02011-09-20
  • 0
    No worries over that little detail, I'm not _that_ useless! :) Oh, of course I can tell everyone: https://plus.google.com/116229150468867889128/posts/D5HiqFR9NpQ2011-09-20
  • 0
    Nice, Henning! $\mbox{}$2011-09-21
  • 0
    I have one final question, but I probably need to post it separately. (But I'm not sure how I can type that y = y0 / (1 + ....) formula and look nice, any FAQ regarding the language I should use?). Anyway, till I figure how to post the question, here is the question itself, in a nutshell. If I give you the area (integral) of the curve, can you give me the _parameter_ ([0.0, 1.0]) of the curve? The area being, obviously, a value from [0.0, x0 * y0]. I suspect this function might be a line, since (area = 0 => a = 0), (area = x0*y0/2 => a = 0.5), (area = x0*y0 => a = 1.0), but don't know for sure2011-10-09
  • 0
    Yes, ask that as a separate question. You can write math in LaTeX format between `$dollar signs$`, or `$$double dollar signs$$` for displayed formulas. For casual use, the best way to learn the format of the text between the dollar signs is probably just extrapolating from examples; you can right-click any formula on the site and select "show source" to see the course code. (Or begin editing your question above here to see some examples in context).2011-10-09
  • 0
    Very practical tip, thanks! So I managed, I hope, to describe the problem as accurately as I could, here: http://math.stackexchange.com/questions/71331/integrate-a-family-of-curves2011-10-10
5

Perhaps $x^n + y^n = 1$, or $y = (1-x^n)^{1/n}$, will serve?
            enter image description here
Above I set $n=\frac{1}{4},\frac{1}{3},\frac{1}{2} ,1,2,3,4$. Then adjust for your $x_0$ and $y_0$.

  • 0
    Thanks for the nice plot! I think this is the same formula as given by @anon, I'm starting to make sense of it. I feel bad that all of you can easily figure this!2011-09-19
4

I'd recommend putting everything the others said together: $$f_a(x)=Y_0\left(1-(x/X_0)^{a/(1-a)}\right)^{(1-a)/a} $$

This way you

  1. Get the desired curve at $a=1/2$ (as in Makholm and Israel's answers) and
  2. Get the desired curves as $a\to0$ or $1$ and
  3. Get the curves stretched to the desired rectangle framed by $X_0$ and $Y_0$ and
  4. Get the curves to look like as they do in Joseph's answer (or a previous answer of mine), i.e. they are symmetric about the line $y=x$ before being stretched to the rectangle.

Low-res colored examples (taken from stretching a graphic from Mathworld, see link): $\hskip 1.5in $ colors

  • 0
    Wow, till I comment on Israel's answer, there is a bunch more. Thanks, I was puzzled over achieving the symmetry you describe. Let me plot this2011-09-19
  • 0
    The others apparently are correct too, I'll pick this one though since it is the most complete. I've very grateful to all though (too bad this site doesn't seem to support channeling donations to contributors)2011-09-19
2

You might try $f_a(x) = y_0 (1 - x/x_0)^{(1-a)/a}$.

  • 0
    Hmm .. you have the slopes varying smoothly with $a$ at $(0,y_0)$ but a discontinuity for $a\to1/2$ at $(x_0,0)$. I have it the other way around. Neither is really satisfying.2011-09-19
  • 0
    Thanks for the answer! And it only took a few minutes for you!? (blush) I'm trying to plot this ( http://www.wolframalpha.com/input/?i=graph+%281-x%29^%28%281-a%29%2Fa%29%2C+x%3D0+to+1%2C+a%3D0.3 ), and I notice that this isn't very symmetric though, right? Do you think I can reasonably make it similar to the 1/x curve, which is nicely symmetric, just with extra parameter? http://upload.wikimedia.org/wikipedia/commons/thumb/2/2b/Function-1_x.svg/600px-Function-1_x.svg.png (I wish I could explain my problem more concisely!) Again, many thanks for the help!2011-09-19
  • 0
    Hmm, Wolfram confuses me, unfortunately it doesn't use the same scale for the two axes, will find another way to plot this2011-09-19
2

How about $$f_a(x) = y_0\left(1-(x/x_0)^{\frac{a}{1-a}}\right)$$ ?