Parameterizing cliffs

60 Views Asked by At

I am looking for a function $f(x; \alpha, X_1, X_2, Y_1, Y_2)$ that has the following property: For $\alpha=0$ it behaves linearly between $(X_1, Y_1)$ and $(X_2, Y_2)$, and as $\alpha$ gets closer to 1, it approximates a sharp cliff, as in the figure below. The function needs not be defined for $\alpha=1$.

Is there a relatively "simple" function (trigonometrics, powers, logarithms and exponentials are fine) that captures this behavior?

enter image description here

3

There are 3 best solutions below

5
On BEST ANSWER

Consider the function $$f(x)=\left(1-x-\frac{1}{x} \right)(1-\alpha)^2+\frac{1-\alpha}{x}$$ on $[0,1]$. When $\alpha=0$, we have $f(x)=1-x$. As $\alpha \uparrow 1$, the graph approaches a right angle (try plotting it for yourself with Wolfram Alpha). A transformed version of this function should work for your example.

2
On

The linear equation is given by

$$\frac{x - x_1}{\lvert x_2 - x_1\rvert} + \frac{y - y_2}{\lvert y_1 - y_2\rvert} = 1.$$

We can get successively 'sharper' curves by using

$$\left(\frac{x - x_1}{\lvert x_2 - x_1\rvert}\right)^{k} + \left(\frac{y - y_2}{\lvert y_1 - y_2\rvert}\right)^k = 1$$ for integer $k \geq 1$, using larger $k$.

Here are the graphs for $k = 1, 2, 3, 4, 5, 6$ through the points $(0, 2)$ and $(3, 0)$:

enter image description here

For $k = 1$, we have the linear equation. For $k = 2$, it's one quarter of an ellipse.

Unfortunately, I'm not sure how to translate my parameter of positive integer $k$-values into the parameter $\alpha \in [0, 1)$. I'll leave this here for now, and think about it.

EDIT: It appears that using $k = \dfrac{1+ \alpha}{1 - \alpha}$ for the exponent works quite well.

Here is an image with $\alpha \in \{0, 0.05, 0.1, 0.2, 0.3, 0.5, 0.7, 0.9\}$:

enter image description here

And if instead you use the function

$$\left\lvert\frac{x - x_1}{x_2 - x_1}\right\rvert^{k} + \left\lvert\frac{y - y_2}{y_1 - y_2}\right\rvert^k = 1,\quad \alpha = \frac{1 + \alpha}{1 - \alpha} \in [0, 1),$$

you get something that behaves rather well, regardless of whether $x_1 < x_2$, etc. Now these are between the points $(x_1, y_1) = (0, 2)$ and $(x_2, y_2) = (3, 4)$, with some bonus points thrown in:

enter image description here

0
On

The beta distribution is the uniform when $\alpha$ and $\beta$ are both equal to 1, and it gets progressivly "sharper" as the parameters change. Therefore, if you let $B(\alpha, \beta)$ represent the CDF of the beta and let $a$ be the alpha from your equation, to prevent confusion and let $y$ be $\frac{x - X2}{X1 - X2}$, the following may work: $$ f(y;a, X_1, X_2, Y_1, Y_2) = \left(B\left(1 + \frac{a}{1-a}, 1\right)\biggr\rvert_0^1\cdot\frac{Y_1-Y_2}{X_1-X_2}\right)\cdot\left(X1 - X_2\right) + Y_1 $$