How to rescale a list for its elements to be closer to their mean?

40 Views Asked by At

Given a uniform list of numbers between 0 and 1, I would like to create a bell-shaped normal distribution.

So far, I:

  • calculate the z-score for each element in the list (element - mean) / standard deviation
  • I clamp the z-scores in the range [-2, 2] with MAX(-2, MIN(z, 2))
  • I rescale each value to [0, 10] with ROUND((clampled_z/5+0.5)*10, 1)

The resulting shape is not convincing enter image description here

I would like my bell shape to be fatter in the middle with few extrema values. I suppose I need to add some logarithm or exponential transformation to the dataset.

What would be a good way to rescale values proportionally closer to their mean value?

Thank you in advance for your suggestions

1

There are 1 best solutions below

4
On

Not sure exactly what you need, but this may be helpful.

If you want to generate a random sample with a known CDF $F_X$ from a list of uniformly-distributed samples in $[0,1]$, then just apply $F_X^{-1}$ to each of the samples.

The resulting sample will be distributed like $X$.

In your case, if your uniformly-distributed samples are $x_1, x_2, x_3,\ldots$ then the transformed values $\Phi^{-1}(x_1), \Phi^{-1}(x_2), \Phi^{-1}(x_3)\ldots$ will be normally distributed.