Results 1 to 7 of 7

Thread: simple function to decrease small numbers and increase large numbers

  1. #1
    Banned
    Joined
    Jul 2011
    Posts
    28
    Thanks
    1

    simple function to decrease small numbers and increase large numbers

    Hello,

    Say I have a set of real numbers in a range such as 0 to 1. I am looking for a function that will decrease the value of numbers toward the lower end, increase the value of numbers near the upper end, and leave values in the middle more or less unchanged. The method would need to work on any range of numbers, but I use 0 to 1 as an example.

    I have looked at something in the form of,
    f(x)=a+b*x

    Modifying a and b will alter the upper and lower ends of a range of numbers, but after playing around a bit I can't seem to get both ends in line at the same time. I don't know if I need one more term of if I am thinking about this in the wrong way so I though I would post. I was originally thinking of a sigmoid, but that doesn't give anything like the results I am looking for.

    I can post data if that would help, just let me know.

    Anything ring a bell?

    Thanks,

    LMHmedchem
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Sep 2012
    From
    Australia
    Posts
    6,572
    Thanks
    1710

    Re: simple function to decrease small numbers and increase large numbers

    Hey LHMmedchem.

    You won't get a linear function that will do this - you need something non-linear.

    I would look at using combinations of exponential functions for something like this. Do you know much about them?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor

    Joined
    Apr 2005
    Posts
    19,240
    Thanks
    2835

    Re: simple function to decrease small numbers and increase large numbers

    y= x^2 makes numbers less than 1 smaller ( (1/2)^2= 1/4) and makes numbers larger than 1 larger ( 2^2= 4). Is that what you mean?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Banned
    Joined
    Jul 2011
    Posts
    28
    Thanks
    1

    Re: simple function to decrease small numbers and increase large numbers

    Quote Originally Posted by chiro View Post
    You won't get a linear function that will do this - you need something non-linear.

    I would look at using combinations of exponential functions for something like this. Do you know much about them?
    I know some calculus with squashing functions like the log sigmoid and tangent sigmoid but that is more or less the limit of my experience with exponential.

    I tried a bit with a log sigmoid,

    f(x)=1/1+e^{-ax}

    where I modified the value of a to change the steepness, but trial and error didn't give me anything that was looking promising. Another issue was that I needed to rescale x to fall between 0 and 1. It's almost like I need a sigmoid with non-horizontal asymptotes if that makes any sense. This is just to say that the function would need to be linear over some range in the middle and then bend down at the bottom and up at the top where you can modify the linear range and the degree of bend at each end.

    I have tried a bit with something of the form,

    f(x) = a + bx + cx^2

    where a=-90, b=1.1, c=0.005. In this case the x values range from 200 to 1350. This stated to look better, but since the function is more or less exponential growth I'm not sure the form makes any sense for what I am trying to do. In this case I didn't need to rescale x, which is a benefit.

    Thanks for the assistance,

    LMHmedchem
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Banned
    Joined
    Jul 2011
    Posts
    28
    Thanks
    1

    Re: simple function to decrease small numbers and increase large numbers

    Quote Originally Posted by HallsofIvy View Post
    y= x^2 makes numbers less than 1 smaller ( (1/2)^2= 1/4) and makes numbers larger than 1 larger ( 2^2= 4). Is that what you mean?
    All of the x values would be positive and likely fall either between 0 and 1 or > 1 unless I rescale. One set of data I am looking at has value that range from 200 to 1350 and it looks like I would need to decrease values below 400 and increase values above 1100. The scale is not very relevant but there are some things you can do when you data ranges above and below 1, above and below 0, etc, that I wouldn't be able to do without rescaling.

    LMHmedchem
    Last edited by LMHmedchem; Feb 18th 2015 at 06:52 AM.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Banned
    Joined
    Jul 2011
    Posts
    28
    Thanks
    1

    Re: simple function to decrease small numbers and increase large numbers

    Quote Originally Posted by HallsofIvy View Post
    y= x^2 makes numbers less than 1 smaller ( (1/2)^2= 1/4) and makes numbers larger than 1 larger ( 2^2= 4). Is that what you mean?
    All of the x values would be positive and likely fall either between 0 and 1 or > 1 unless I rescale. One set of data I am looking at has value that range from 200 to 1350 and it looks like I would need to decrease values below 400 and increase values above 1100. The scale is not very relevant but there are some things you can do when you data ranges above and below 1, above and below 0, etc, that I wouldn't be able to do without rescaling.

    LMHmedchem
    Last edited by LMHmedchem; Feb 18th 2015 at 06:53 AM.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Banned
    Joined
    Jul 2011
    Posts
    28
    Thanks
    1

    Re: simple function to decrease small numbers and increase large numbers

    I have attached an excel spreadsheet with something like what I am looking for.

    In the spreadsheet I have added some test data consisting of a set of values from 200 to 1350. The X and Y columns are the same. In the column Y-test, I have manually altered the value of Y to produce something similar to what I am looking for. I did a 3rd order polynomial curve fit to the Y-test values and the resulting equation is given on the first line. Column Y-func shows the Y values as modified by the polynomial equation.

    The first plot X,Y-test show the plot of the manually modified Y values and the second plot, X,Y-func shows the values modified by the polynomial. The curve of the second plot is something like what I am looking for.

    Is there a more generic name for the kind of function that is displayed in these plots? I would like to be able to manipulate the shape of the curve in several ways. In particular, the point of departure from the XY line (currently ~400, ~1100), and the degree of bend away from the XY line. Is there a straightforward explanation for how adjustments to the coefficients will affect these characteristics? I assume that the sign of the coefficients needs to stay the same.

    This is the 3rd order equation for those who don't want to bother with the spreadsheet.

    y = 7.1095E-07x^3 - 1.6530E-03x^2 + 2.2197x - 283.3688

    This is the plot of X,Y-func as well

    simple function to decrease small numbers and increase large numbers-function.jpg

    Thanks for the help so far. This question may be more related to functions than algebra, so perhaps it should be in the per-calculus section instead.

    LMHmedchem
    Attached Files Attached Files
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. GCD of two really large numbers
    Posted in the Discrete Math Forum
    Replies: 5
    Last Post: May 31st 2014, 11:25 AM
  2. law of large numbers
    Posted in the Advanced Statistics Forum
    Replies: 0
    Last Post: Feb 12th 2011, 11:39 AM
  3. Replies: 2
    Last Post: Mar 26th 2010, 07:36 AM
  4. Law of Large Numbers
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: Aug 2nd 2009, 11:53 PM
  5. Using the weak law of large numbers
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: Nov 25th 2007, 01:23 AM

Search Tags


/mathhelpforum @mathhelpforum