1
$\begingroup$

I'm looking for a way to adjust the probability distribution of a uniform random function I'm using in a program.

I want to find some discrete probability distribution that includes a parameter for "adjusting" how uniform the distribution is relative to the "center" event. For example, if that parameter, lets say s=0, then the probability of 5 events is exactly equal at 20% each. If I were to change that parameter to s=1, the function would now adjust the probability depending on the distance from the center. So, the probability would change to:

  • Event 1: 16%
  • Event 2: 18%
  • Event 3: 20%
  • Event 4: 22%
  • Event 5: 24%

And adjusting s higher would yield increasing probability above the "center" event and decreasing probability below the center event, depending on distance from the center - all while retaining a total probability of 100%. Statistics is not my strong point, so I'm just hoping someone with some experience might understand what I'm looking for :)

$\endgroup$
3
$\begingroup$

Consider the function $p_s(x)=\frac{2-3s}{10}+\frac{s}{10}x$ with $s\in[-1,1]$.

Notice that $$\sum_{i=1}^{5}p_s(i)=\sum_{i=1}^{5}\left(\frac{2-3s}{10}+\frac{s}{10}i\right)=1-\frac{15}{10}s+\frac{15}{10}s=1$$ and the restriction on $s$ forces all of $p_s(1)$ through $p_s(5)$ to be at least zero and at most one. Thus, $p_s$ is a probability distribution over the integers $1$ through $5$.

The example you give above is the special case when $s=\frac{2}{10}$: $p_{s=2/10}(x)=0.14+0.02x$.

$\endgroup$
  • $\begingroup$ Excellent! Thank you very much - just what I was looking for. I realize I was a bit vague in my description, but you nailed it. If you don't mind me picking your brain a bit, I rearranged the equation into p(x)=2/10+s(x-3)/10. If i were to want a more exponential change in distribution, how would I modify it? I tried (x-3)^3, but that throws off the summation to 1... $\endgroup$ – 7200rpm Mar 14 '13 at 2:28
  • $\begingroup$ Try this: Let $$p_1(x)=\frac{(x-3)^3+8}{\sum_{j=1}^{5}\left((j-3)^3+8\right)}$$ and $$p_{-1}(x)=p_1(6-x)$$ and $$p_s(x)=s\times p_1(x)+(1-s)\times p_{-1}(x)$$ with $s\in[0,1]$. When $s=1/2$, $p_s$ is uniform over $1,\ldots,5$. $\endgroup$ – assumednormal Mar 14 '13 at 3:31
  • $\begingroup$ If you have a function $f(x)$ such that $f(1),\ldots,f(5)$ are all finite, a few simple steps will turn this function into a probability distribution over the integers $1,\ldots,5$. (1) Define $g(x)=f(x)-\textrm{min}(f(1),\ldots,f(5))$. (2) Define $p(x)=g(x)/\sum_{i=1}^{5}g(i)$. Now $p(x)$ is a probability distribution over the integers $1,\ldots,5$ and it has a shape similar to the original function $f(x)$. $\endgroup$ – assumednormal Mar 14 '13 at 3:41
  • $\begingroup$ Thanks again! Super helpful, sometimes it can be difficult to find a function based only on vague sense of the kind of output you want. $\endgroup$ – 7200rpm Mar 14 '13 at 4:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.