Menu
News
All News
Dungeons & Dragons
Level Up: Advanced 5th Edition
Pathfinder
Starfinder
Warhammer
2d20 System
Year Zero Engine
Industry News
Reviews
Dragon Reflections
White Dwarf Reflections
Columns
Weekly Digests
Weekly News Digest
Freebies, Sales & Bundles
RPG Print News
RPG Crowdfunding News
Game Content
ENterplanetary DimENsions
Mythological Figures
Opinion
Worlds of Design
Peregrine's Nest
RPG Evolution
Other Columns
From the Freelancing Frontline
Monster ENcyclopedia
WotC/TSR Alumni Look Back
4 Hours w/RSD (Ryan Dancey)
The Road to 3E (Jonathan Tweet)
Greenwood's Realms (Ed Greenwood)
Drawmij's TSR (Jim Ward)
Community
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions, OSR, & D&D Variants
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Resources
Wiki
Pages
Latest activity
Media
New media
New comments
Search media
Downloads
Latest reviews
Search resources
EN Publishing
Store
EN5ider
Adventures in ZEITGEIST
Awfully Cheerful Engine
What's OLD is NEW
Judge Dredd & The Worlds Of 2000AD
War of the Burning Sky
Level Up: Advanced 5E
Events & Releases
Upcoming Events
Private Events
Featured Events
Socials!
EN Publishing
Twitter
BlueSky
Facebook
Instagram
EN World
BlueSky
YouTube
Facebook
Twitter
Twitch
Podcast
Features
Top 5 RPGs Compiled Charts 2004-Present
Adventure Game Industry Market Research Summary (RPGs) V1.0
Ryan Dancey: Acquiring TSR
Q&A With Gary Gygax
D&D Rules FAQs
TSR, WotC, & Paizo: A Comparative History
D&D Pronunciation Guide
Million Dollar TTRPG Kickstarters
Tabletop RPG Podcast Hall of Fame
Eric Noah's Unofficial D&D 3rd Edition News
D&D in the Mainstream
D&D & RPG History
About Morrus
Log in
Register
What's new
Search
Search
Search titles only
By:
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions, OSR, & D&D Variants
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Menu
Log in
Register
Install the app
Install
Upgrade your account to a Community Supporter account and remove most of the site ads.
Rocket your D&D 5E and Level Up: Advanced 5E games into space! Alpha Star Magazine Is Launching... Right Now!
Community
General Tabletop Discussion
*TTRPGs General
ENnies - let's launch the voting booth!
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Olgar Shiverstone" data-source="post: 998869" data-attributes="member: 5868"><p>Does PHP have a function that calculates percentages of a standard normal?</p><p></p><p>Unfortunately, if PHP doesn't have a function that computes percentages as a function of a standard normal distribution, there really isn't an easy way to do it (which is why even in the computer age we still use Z-tables).</p><p></p><p>The function that returns the percentage is:</p><p></p><p>[Integrated from -infinity to X] (1 / SQRT(2 * pi)) * EXP (-1 * (x^2)/2)</p><p></p><p>So of course the integration is the problem. You could create a numerical integration function that stepped through the entire integration at very small intervals summing rectangles as an approximation, ie (translate this into PHP or whatever):</p><p></p><p>percent = 0</p><p>for i = -5 to x step 0.01</p><p> percent = percent + ((1 / SQRT(2* pi)) * exp (-1 * (i^2)/2)) * 0.01</p><p>next</p><p>percent=percent*100</p><p></p><p></p><p>Which should give a rough approximation (x is the normed value of the individual score ranging from -3 to +3). Smaller steps (change all 0.01 to 0.0001, for example) will yield a more precise value. I'm not sure exactly what method Excel uses to do this integration.</p><p></p><p>Edit: Forgot the square root of 2*pi</p></blockquote><p></p>
[QUOTE="Olgar Shiverstone, post: 998869, member: 5868"] Does PHP have a function that calculates percentages of a standard normal? Unfortunately, if PHP doesn't have a function that computes percentages as a function of a standard normal distribution, there really isn't an easy way to do it (which is why even in the computer age we still use Z-tables). The function that returns the percentage is: [Integrated from -infinity to X] (1 / SQRT(2 * pi)) * EXP (-1 * (x^2)/2) So of course the integration is the problem. You could create a numerical integration function that stepped through the entire integration at very small intervals summing rectangles as an approximation, ie (translate this into PHP or whatever): percent = 0 for i = -5 to x step 0.01 percent = percent + ((1 / SQRT(2* pi)) * exp (-1 * (i^2)/2)) * 0.01 next percent=percent*100 Which should give a rough approximation (x is the normed value of the individual score ranging from -3 to +3). Smaller steps (change all 0.01 to 0.0001, for example) will yield a more precise value. I'm not sure exactly what method Excel uses to do this integration. Edit: Forgot the square root of 2*pi [/QUOTE]
Insert quotes…
Verification
Post reply
Community
General Tabletop Discussion
*TTRPGs General
ENnies - let's launch the voting booth!
Top