Skip to content

Conversation

mourner
Copy link
Contributor

@mourner mourner commented Jul 9, 2015

Closes #107. The tables are identical. The calculation itself is sub-1ms.

We could improve the current precision further by either bumping the table size, the number of digits and iterations.

Or, we could expose the actual function with memoization. A non-rounding calculating function call takes about 3-4 times more than the table call currently with 20 iterations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does 3.09 come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the max the original table has. :) We can change to 3 and update the tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, the question is then why does the original table stop then...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably because it's so close to 1 for values after 3 that the error becomes acceptable. See the graph here https://en.wikipedia.org/wiki/File:Normal_Distribution_CDF.svg, red line.

tmcw added a commit that referenced this pull request Jul 9, 2015
Calculate standard normal table
@tmcw tmcw merged commit d0d4e8f into simple-statistics:v1.0.0 Jul 9, 2015
@tmcw
Copy link
Member

tmcw commented Jul 9, 2015

👍 awesome

@mourner mourner deleted the calc-snt branch July 9, 2015 20:09
@tmcw tmcw mentioned this pull request Aug 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants