Last active
November 20, 2020 14:22
-
-
Save rkichenama/a2c08c4f6ac8e9da21dc2c6c0a4a2d2f to your computer and use it in GitHub Desktop.
Revisions
-
rkichenama revised this gist
Nov 20, 2020 . 1 changed file with 10 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,13 @@ const NormDist = (avg, stdev) => { const { E, sqrt } = Math; const variance = stdev ** 2; const stdevTau = stdev * sqrt(2 * Math.PI); const doubleVariance = 2 * variance; return (x) => { const distFromAvg = (x - avg) ** 2; return ( (E ** -(distFromAvg / doubleVariance)) / stdevTau ); }; }; -
rkichenama revised this gist
Nov 20, 2020 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,11 @@ const NormDist = (avg, stdev) => { const variance = stdev * stdev; const thStdevTau = 1 / (stdev * Math.sqrt(2 * Math.PI)); const doubleVariance = 2 * variance; const pdf = (x) => ( thStdevTau * Math.pow(Math.E, Math.pow(-(x - avg), 2) / doubleVariance) ); return { pdf, }; }; -
rkichenama created this gist
Nov 19, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ const NormDist = (avg, stdev) => { pdf (x) { return () ; } };