0
$\begingroup$

I am trying to get a continuous mapping from (0,∞) to (0,1). What would be a good mapping?

Context:
I need to rank tuples based on values of two of their attributes a and b. a increases very steeply and b much slower. To accomodate both of them in ranking, I am generating c=a*b and am using that for ranking. c could vary from sub-1 values to a few billions. this makes comparison very difficult. I tried log10(c)..while that helps in reducing the range significantly, having a proper way to map the values to (0,1) would help. I am trying to look for a function to map c to (0,1) that would have a good spread over entire range of the iterval (0,1).I considered sigmoid, but then I thought since all values are psoitive, sigmoid values would be restricted to (0.5,1)..so had to drop that idea..

  • 6
    $x\mapsto x/(1+x)$.2012-04-12
  • 1
    The one proposed by Didier seems really good. Perhaps you could provide us with details concerning what you require of your mapping. Since you posted it under the "numerical-methods" tag, I suppose you want it to be well-conditionned and rapidly computed (here Didier's example is perfect), but perhaps there is something else ?2012-04-12
  • 0
    Yet another: $x\mapsto 1-e^{-x}$.2012-04-12
  • 1
    You could multiply the sigmoid by $2$ and subtract $1$ to normalize it to $(0,1)$.2012-04-12
  • 0
    @Didier Thanks Didier. I should have been more specific..I am looking for a function that would not only map to (0,1) but would also have a good spread over that interval. x/(1+x) does not satisfy this latter requirement.2012-04-12
  • 0
    @Brian Thanks Brian. Tried the function..it rapidly converges to 1.0 and doesnt help much in this particular case.2012-04-12
  • 0
    @Brian Subtracting 1 from twice of sigmoid didnt help2012-04-12
  • 0
    What do you call *a good spread*? Surely you noted that $x\mapsto x/(1+x)$ maps $(0,\infty)$ to $(0,1)$.2012-04-12
  • 0
    @Didier good spread : lower values (in the order of a few hundreds) mapping to lower range in (0,1) say 0.2 and we reach the close to 1 only when input value is fairly high (say in the order of a few millions)2012-04-12
  • 0
    Then $x\mapsto\log(1+x)/(1+\log(1+x))$ or even $x\mapsto\log(1+x)/(c+\log(1+x))$ for some suitable positive $c$.2012-04-12

2 Answers 2