For a movie rating, we can have its distribution like this:

enter image description here

Each rating would have a percentage. Consequently, we can obtain the mean, std from this distribution.

The question is what is the value range for the mean - std for the movie ratings?

Obivously, its bounded, and the std would be 0 for mean rating at 10. For 5.5 rating, the upper limit of std would be around 4? (given the extreme case that 50% for 10 and 50% for 1). And it should be centered around 5.5.

My questions are that:

  1. Is there any distribution for the mean - std for such distribution?

  2. How can I obtain the value range, in Python? (I can probably obtain it through generating random values and then calculate the mean and std. but it's a little bit hard to do it from scratch.)


My simulation result:

enter image description here


Let's let $X$ be a random variable for the movie rating. Let's represent the probability distribution over $X$ as a vector $p$ s.t. $p_x = P(X = x)$. Let's let $f(p)$ be mean - std as a function of $p$. This gives us $f(p) = \sum_{x=1}^{10}xp_x - \sqrt{\sum_{x=1}^{10}(x - \sum_{x=j}^{10}xp_x)^2}$. We're looking for the range of values that mean - std can take for different probability distributions. This is equivalent to finding the minimum and maximum value of $f(p)$ under the constraint that $p$ represents a valid probability distribution. More precisely, we want:

$\min_p f(p)$ s.t. $\sum_{x=1}^{10}p_x = 1$ and $\forall x$, $p_x \geq 0$, which is the minimum value that mean - std can take, and we want $\min_p -f(p)$ s.t. $\sum_{x=1}^{10}p_x = 1$ and $\forall x$, $p_x \geq 0$, which is the max value that mean - std can take.

These are both examples of constrained optimization problems and can be solved in python using minimize from scipy.optimize. However, this may not give the correct minimum if $f(p)$ is not convex and may not give the correct maximum if $-f(p)$ is not convex.

  • $\begingroup$ I now thinks that I can use Dirichlet distribution to simulute the rating distribution, and then calculate the mean - std relationship. $\endgroup$ – cqcn1991 May 24 '17 at 4:16
  • $\begingroup$ Also, I just update with my simulation result, you can take a look at it. $\endgroup$ – cqcn1991 May 24 '17 at 6:43

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.