Class: Redist

Redist

new Redist()

Functions used to redistrubute values in the range 0-1

Theses function are used to redistribute data located in the range 0-1 They take all the data and rearrange them and purturbe them slightly so that they fit a particular distrubution function. For example you can use these to push all the data points closer to 1 so that there are few points near 0 each redistribution function has different properties. Properties of these functions the domain is (0-1) for the range (0-1) in this range the function is one to one f(0) == 0 and f(1) == 1

Methods

staticRedist.exports.exp(x, amm, inc){Number}

Exponential redistribution function. This function skews the values either up or down by a particular ammount according the input parameters. The output distribution will be slight exponential shaped.
Name Type Default Description
x Number The input number in the range [0-1]
amm Number 1 optional The strength of the redistribution
inc Boolean true optional If you want to increase or decrease the input
Returns:
Type Description
Number The redistributed input value

staticRedist.exports.identity(x){Number}

The identity function. It returns the input value x
Name Type Description
x Number The input number in the range [0-1]
Returns:
Type Description
Number Input value

staticRedist.exports.inverse(x){Number}

The inverse fuction. It returns the opposite of the function in the range from [0-1]. This is simply 1 - x.
Name Type Description
x Number The input number in the range [0-1]
Returns:
Type Description
Number The redistributed input value, 1 - x

staticRedist.exports.pow(x, amm, inc, skewDown){Number}

Power redistribution function. This function skews values either up or down by a particular ammount according to the input parameters. The power distribution also has a slight skew up or down on top of the redistribution.
Name Type Default Description
x Number The input number in the range [0-1]
amm Number 2 optional The strength of the redistribution
inc Boolean true optional If you want to increase or decrease the input
skewDown Boolean true optional If you want to skew the input value down towards 0, then skewDown=true. If you want to skew the input value up towards 1, then skewDown=false
Returns:
Type Description
Number The redistributed input value

staticRedist.exports.step(x, bins){Number}

Turns a continious function and turns it into a discrete function that has a specific number of bins to but the distribution into.
Name Type Default Description
x Number The input number in the range [0-1]
bins Number 10 optional The number of bins for the discrite distribution
Returns:
Type Description
Number The discretized input value