0
$\begingroup$

I know that a simple linear function can map $[a,b]$ to $[A,B]$ by $f(x) = \frac{x-a}{b-a}(B-A) + A$ but what if I want to map $[a,b]$ to $[A,B]$ while ensuring that $f(c) = C$ for $a < c < b$ and $A < C < B$? I assume I will need a quadratic function for this.

Can this be generalized to allow for $n$ interior points to be mapped such that $f(c_i) = C_i$ for $a < c_i < b$ and $A < C_i < B$ where $c_i < c_{i+1}$ and $C_i < C_{i+1}$?

As a more concrete example, I have some data for which I have calculated the min, max, avg, and std, so that I have $\{Xmin, Xavg - Xstd, Xavg, Xavg + Xstd, Xmax\}$ and I want to find a polynomial function which maps these values to $\{0, 0.25, 0.5, 0.75, 1\}$. How should I construct such a function?

  • 0
    Isn't this just fitting a curve to a given set of points $\{(c_0,C_0),\ldots,(c_n,C_n)\}$ ? If you choose a polynomial with degree $n$, then you can fit it to these $n+1$ points exactly. This is a standard technique. Google is your friend, I won't bother to write it up here since you can find it readily. **NOTE:** my $n$ and your $n$ aren't the same. I am labeling the points from $0$ to $n+1$, so adjust for that. I guess your $n$ is one plus mine.2017-01-18
  • 0
    (continued) Hmm, I see now that there is no immediately obvious guarantee that $c_i2017-01-18
  • 0
    (continued) However, using a piecewise linear fit on the subintervals does give you a continuous piecewise linear function, which may be better (certainly computationally less expensive) than a general polynomial fit, and has the bounding properties you want on each subinterval.2017-01-18
  • 0
    I actually need this to be continuous and differentiable. I'm working out the math for a polynomial fit now which isn't actually has hard as I thought. If I can get it work then I'll post an answer.2017-01-18
  • 0
    For such a small number of points, it can easily be done by hand. But to automate it, might have to prove strict montonicity on each subinterval.2017-01-18

0 Answers 0