Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redefine score curves with p90 rather than podr #10706

Closed
paulirish opened this issue May 6, 2020 · 1 comment · Fixed by #10715
Closed

Redefine score curves with p90 rather than podr #10706

paulirish opened this issue May 6, 2020 · 1 comment · Fixed by #10715

Comments

@paulirish
Copy link
Member

It's come up a few times.. most recently here #10495 (comment)

we should really consider reworking our math so we can define in terms of the 90 cutoff :) haha

It makes sense, since 90 is passing and a key threshold. Our source of truth should use them instead of numbers SO CLOSE to it.

@paulirish
Copy link
Member Author

Now, the hard part (the MATH) has now been done, thanks to @brendankenny.

desmos: https://www.desmos.com/calculator/wbudrdywv2

Brendan's JS:

const INVERSE_ERFC_ONE_FIFTH = 0.90619380243682323694542901648674160242080688476562500;

function getLogNormalPercentile({median, ninetieth}, value) {
  // Shape (σ) is `|log(ninetieth/median) / (sqrt(2)*erf-1(1/5))|` and standardizedX
  // is then `1/2 erfc(log(value/median) / (sqrt(2)*σ))`, so simplify a bit.
  const xLogRatio = Math.log(value / median);
  const ninetiethLogRatio = Math.abs(Math.log(ninetieth / median));
  const standardizedX = xLogRatio * INVERSE_ERFC_ONE_FIFTH / ninetiethLogRatio;
  return (1 - erf(standardizedX)) / 2;
}

left to do:

  • adopt in statistics.js w/ test
  • calculate p90 for all existing curves and redefine them, confirming their shape doesn't change. set new desmos links.
  • update scoring calc, i guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants