0

I was recently interested in a mathematical way to fairly rate movies - as I was discouraged by the subjectivity of my ratings.

I decided to set up a system as follows:

$$p_m(x)=Ce^{-\frac{1}{10}\left(x-\frac{20}{3}\right)^2}$$

Where C is defined such that:

$$\int_0^{10}p_m(x)dx=1$$

So $C \approx 0.191728558267$, and therefore we have that $p_m(x)$ is a probability distribution function of my ratings of movies, on a scale of $1$ to $10$. Using this distribution function, I am now able to calculate the percentile rating (what percentage of movies it was rated better than) of a movie based on its score:

$$p_e(s)=\int_0^sp_m(x)dx$$

However, my problem is that I plan to rate movies on a table based on how much I liked them. I would then use the percentile values of the movie in my table, and based off that, solve for my score for that movie. Ideally, I want to find a expression (possibly using erf) for $s$ as a function of $p_e(s)$.

So, that's my question. Can I, using the definition of $p_e(s)$ above, solve for $s$?

An example case would be:

My Table:

  1. La La Land
  2. Hidden Figures
  3. Doctor Strange
  4. Fantastic Beasts and Where to Find Them
  5. BvS

On this scale, to find the score of FBaWtFT, we first take its percentile, which is $25\%$ (it is better than $\frac14$ of all other movies in the table).

So we solve:

$$0.25=\int_0^sp_m(x)dx$$

Can we solve for $s$, which according to desmos, is about $5.044$ but gives no good explanation how this was solved.

1 Answers1

3

Considering $$p_m(x)=Ce^{-\frac{1}{10}\left(x-\frac{20}{3}\right)^2}$$ $$\int_0^{10}p_m(x)\,dx=1\implies C\sqrt{\frac{5 \pi }{2}} \left(\text{erf}\left(\frac{\sqrt{10}}{3}\right)+\text{erf}\left(\frac{2 \sqrt{10}}{3}\right)\right)=1$$ that is to say $$C=\frac{\sqrt{\frac{2}{5 \pi }}}{\text{erf}\left(\frac{\sqrt{10}}{3}\right)+\text{erf}\left(\frac{2 \sqrt{10}}{3}\right)}\approx 0.191729$$ Similarly $$p_e(s)=\int_0^sp_m(x)\,dx=C\sqrt{\frac{5 \pi }{2}} \left(\text{erf}\left(\frac{2 \sqrt{10}}{3}\right)-\text{erf}\left(\frac{20-3 s}{3 \sqrt{10}}\right)\right)$$ So, if you want $p_e(s)=a$, you need to solve for $s$ the equation $$\frac{\text{erf}\left(\frac{2 \sqrt{10}}{3}\right)-\text{erf}\left(\frac{20-3 s}{3 \sqrt{10}}\right)}{\text{erf}\left(\frac{2\sqrt{10}}{3}\right)+\text{erf}\left(\frac{ \sqrt{10}}{3}\right)}=a$$ that is to say $$\text{erf}\left(\frac{20-3 s}{3 \sqrt{10}}\right)=(1-a)\, \text{erf}\left(\frac{2 \sqrt{10}}{3}\right)-a\, \text{erf}\left(\frac{\sqrt{10}}{3}\right)$$ For more simplicity, let us define $$X=\frac{20-3 s}{3 \sqrt{10}}\qquad \text{and} \qquad A=(1-a)\, \text{erf}\left(\frac{2 \sqrt{10}}{3}\right)-a\, \text{erf}\left(\frac{\sqrt{10}}{3}\right)$$ which reduce the problem to solving for $X$ equation $$\text{erf}(X)=A$$

Looking at this post, you would find two approximations of the error function $$\mathrm{erf}\!\left(X\right)\approx \sqrt{1-\exp\Big(-\frac {4X^2} {\pi} \Big)}\tag 1$$ $$\mathrm{erf}\!\left(X\right)\approx\sqrt{1-\exp\Big(-\frac 4 {\pi}\,\frac{1+\alpha\, X^2}{1+\beta\, X^2}\,X^2 \Big)}\tag 2$$ where $$\alpha=\frac{10-\pi ^2}{5 (\pi -3) \pi }\qquad \text{and}\qquad \beta=\frac{120-60 \pi +7 \pi ^2}{15 (\pi -3) \pi }$$ Approximation $(1)$ is simple to solve for $X$ and approximation $(2)$ just requires solving a quadratic equation in $X^2$.

Let us try for $a=0.25$ corresponding to $A\approx 0.531857$. So, using $(1)$ leads to $$X\approx 0.511024 \implies s\approx 5.05067$$ using $(2)$ leads to $$X\approx 0.513010\implies s\approx 5.04439$$ while the exact solution would be $s\approx 5.04439$ ! Bingo !

May be, you wish the exact general formula; it is "simply" $$s=\frac{20}{3}-\sqrt{10} \,\text{erf}^{-1}\left[(1-a)\, \text{erf}\left(\frac{2 \sqrt{10}}{3}\right)-a\, \text{erf}\left(\frac{\sqrt{10}}{3}\right)\right]$$