{"_id":"pdfast","_rev":"11-41e660cdeddc856c94013d1f21fcc6f2","name":"pdfast","description":"Fast kernel density estimation library","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.1":{"name":"pdfast","version":"0.0.1","description":"Fast kernel density estimation library","main":"index.js","keywords":["pdf","probabilty","density","function","estimation","kernel"],"scripts":{"test":"mocha --timeout 10000 $(find tests -name *.spec.js)"},"author":{"name":"William Gozali","email":"will.gozali@gmail.com"},"license":"MIT","devDependencies":{"chai":"^3.5.0","lodash":"^4.14.2","mocha":"^3.0.2","rewire":"^2.5.2"},"gitHead":"c362a0e9b72c7186f8fae5424ff88231e404cb32","_id":"pdfast@0.0.1","_shasum":"f77d75fe1268cb789b462e624f74e931cbc0f6de","_from":".","_npmVersion":"3.7.1","_nodeVersion":"4.2.2","_npmUser":{"name":"gyosh","email":"will.gozali@gmail.com"},"dist":{"shasum":"f77d75fe1268cb789b462e624f74e931cbc0f6de","tarball":"https://registry.npmjs.org/pdfast/-/pdfast-0.0.1.tgz","integrity":"sha512-JLhDLUtdN1fVXl6DvoTEKfUbJCLmXoyJSHuVBUjsJlONI2qnrtLOsjGYO+btKMMeZCNmYEL1KFlV01BBGPPLbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICft6WBXBPil4YfAki1NgEWGGQISpDw3BLA9KTEuCwMgAiBldndn0PJEUP9emKR63wJ4T44/6KQddgxGVAUf6ZEJOA=="}]},"maintainers":[{"name":"gyosh","email":"will.gozali@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/pdfast-0.0.1.tgz_1470936404911_0.8894047704525292"}},"0.0.2":{"name":"pdfast","version":"0.0.2","description":"Fast kernel density estimation library","main":"src/index.js","keywords":["pdf","probabilty","density","function","estimation","kernel"],"repository":{"type":"git","url":"git+https://github.com/gyosh/pdfast.git"},"bugs":{"url":"https://github.com/gyosh/pdfast"},"homepage":"https://github.com/gyosh/pdfast","scripts":{"test":"mocha --timeout 10000 $(find tests -name *.spec.js)"},"author":{"name":"William Gozali","email":"will.gozali@gmail.com"},"license":"MIT","devDependencies":{"chai":"^3.5.0","lodash":"^4.14.2","mocha":"^3.0.2","rewire":"^2.5.2"},"gitHead":"9627dad89d61cb868ee67fbee901232e683b7b57","_id":"pdfast@0.0.2","_shasum":"f5428e767c4108c2b11da15e5864e6c6cd383318","_from":".","_npmVersion":"3.7.1","_nodeVersion":"4.2.2","_npmUser":{"name":"gyosh","email":"will.gozali@gmail.com"},"dist":{"shasum":"f5428e767c4108c2b11da15e5864e6c6cd383318","tarball":"https://registry.npmjs.org/pdfast/-/pdfast-0.0.2.tgz","integrity":"sha512-jItphozebnUih8yvL1N5NcpN/F5if5KQujR5vkI5g1e9cMpuA1j13jVUPceBa1H0aksQ62k7TW826merDSp9FQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCp0BSUjcXTvCp/LQXrlwo6NzdmXjn18M0GiWniHJXQtwIhALk5rU919MHIM5y03/zJ+EdBexgYvzH2KwaNUnDdr56w"}]},"maintainers":[{"name":"gyosh","email":"will.gozali@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/pdfast-0.0.2.tgz_1470938211558_0.8392631823662668"}},"0.0.3":{"name":"pdfast","version":"0.0.3","description":"Fast kernel density estimation library","main":"src/index.js","keywords":["pdf","probabilty","density","function","estimation","kernel"],"repository":{"type":"git","url":"git+https://github.com/gyosh/pdfast.git"},"bugs":{"url":"https://github.com/gyosh/pdfast"},"homepage":"https://github.com/gyosh/pdfast","scripts":{"test":"mocha --timeout 10000 $(find tests -name *.spec.js)"},"author":{"name":"William Gozali","email":"will.gozali@gmail.com"},"license":"MIT","devDependencies":{"chai":"^3.5.0","lodash":"^4.14.2","mocha":"^3.0.2","rewire":"^2.5.2"},"gitHead":"1ae03dbbac464271f3b3f3d6bb55f7130af9fa7e","_id":"pdfast@0.0.3","_shasum":"bc8bc95faeb8cb5130cff97d35e2d53e68570355","_from":".","_npmVersion":"3.7.1","_nodeVersion":"4.2.2","_npmUser":{"name":"gyosh","email":"will.gozali@gmail.com"},"dist":{"shasum":"bc8bc95faeb8cb5130cff97d35e2d53e68570355","tarball":"https://registry.npmjs.org/pdfast/-/pdfast-0.0.3.tgz","integrity":"sha512-RobK2bckfD36x6dcGlvNjiVQLS+ZdOmi06qdy4CMExfa1zv01fGOpObOQkSXwdlbDjbm3JeiQd1qDAM0rMrv0w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFX3ww407fpx6SPWFLPTXFC55z/M+qSG4bMM21yQNF0QIgYPR0DLGgQMbJfSI7RhIibN2nsz0W8hlV3rHpPziRrao="}]},"maintainers":[{"name":"gyosh","email":"will.gozali@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/pdfast-0.0.3.tgz_1470938363008_0.13554891292005777"}},"0.0.4":{"name":"pdfast","version":"0.0.4","description":"Fast kernel density estimation library","main":"src/index.js","keywords":["pdf","probabilty","density","function","estimation","kernel"],"repository":{"type":"git","url":"git+https://github.com/gyosh/pdfast.git"},"bugs":{"url":"https://github.com/gyosh/pdfast"},"homepage":"https://github.com/gyosh/pdfast","scripts":{"test":"mocha --timeout 10000 $(find tests -name *.spec.js)"},"author":{"name":"William Gozali","email":"will.gozali@gmail.com"},"license":"MIT","devDependencies":{"chai":"^3.5.0","lodash":"^4.14.2","mocha":"^3.0.2","rewire":"^2.5.2"},"gitHead":"953a11ede85bfa3baebe27d63dab5cc0bc2e6b31","_id":"pdfast@0.0.4","_shasum":"10d5a08d0814bf2c0266ca9b29c0d4876bb63175","_from":".","_npmVersion":"3.7.1","_nodeVersion":"4.2.2","_npmUser":{"name":"gyosh","email":"will.gozali@gmail.com"},"dist":{"shasum":"10d5a08d0814bf2c0266ca9b29c0d4876bb63175","tarball":"https://registry.npmjs.org/pdfast/-/pdfast-0.0.4.tgz","integrity":"sha512-PM20qBy4SFEFkreuf35NLAvdC29+HZ+LTDh0ID1OHcQ/fO73dFQTh/cOpIPXOBiZ0J2DIg96LD1Lzzwjzjt/vA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDa9spcvUuyz8h6jQYkflK5RsjNB/U8PAn7F0R8z3Y4OAIhAPuxt67PZBPm5mvJtAwapOZCSiris1gd1V4AAQB8andN"}]},"maintainers":[{"name":"gyosh","email":"will.gozali@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pdfast-0.0.4.tgz_1471054745438_0.8304294645786285"}},"0.0.5":{"name":"pdfast","version":"0.0.5","description":"Fast kernel density estimation library","main":"src/index.js","keywords":["pdf","probabilty","density","function","estimation","kernel"],"repository":{"type":"git","url":"git+https://github.com/gyosh/pdfast.git"},"bugs":{"url":"https://github.com/gyosh/pdfast"},"homepage":"https://github.com/gyosh/pdfast","scripts":{"test":"mocha --timeout 10000 $(find tests -name *.spec.js)"},"author":{"name":"William Gozali","email":"will.gozali@gmail.com"},"license":"MIT","devDependencies":{"chai":"^3.5.0","lodash":"^4.14.2","mocha":"^3.0.2","rewire":"^2.5.2"},"gitHead":"44711dc3fd49cb98e72c5cb3174799eacb2dba3b","_id":"pdfast@0.0.5","_shasum":"68de6322604864598ff9e3f5fd908524d914ac39","_from":".","_npmVersion":"3.7.1","_nodeVersion":"4.2.2","_npmUser":{"name":"gyosh","email":"will.gozali@gmail.com"},"dist":{"shasum":"68de6322604864598ff9e3f5fd908524d914ac39","tarball":"https://registry.npmjs.org/pdfast/-/pdfast-0.0.5.tgz","integrity":"sha512-62dtiZBUlR0OGTwtutFTl2Lh0jBXdqz4vdP/SiI9dqy8WwcOQlkzid6U/RT2wbG6BpfNNzMSS+0BIJlcFXVO2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID9jW44vQnd/+BTjIyT1K4t/7q60dJTfCAf6zb2IoPfMAiEAg671rTgMZJoziUO9zkyWND2SBYZWC+t1UNQRMDE4kec="}]},"maintainers":[{"name":"gyosh","email":"will.gozali@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/pdfast-0.0.5.tgz_1471097818928_0.9628156188409775"}},"0.1.0":{"name":"pdfast","version":"0.1.0","description":"Fast kernel density estimation library","main":"src/index.js","keywords":["pdf","probabilty","density","function","estimation","kernel"],"repository":{"type":"git","url":"git+https://github.com/gyosh/pdfast.git"},"bugs":{"url":"https://github.com/gyosh/pdfast"},"homepage":"https://github.com/gyosh/pdfast","scripts":{"test":"mocha --timeout 10000 $(find tests -name *.spec.js)"},"author":{"name":"William Gozali","email":"will.gozali@gmail.com"},"license":"MIT","devDependencies":{"chai":"^3.5.0","lodash":"^4.14.2","mocha":"^3.0.2","rewire":"^2.5.2"},"gitHead":"419d5eac3b54fae839a59bf78ce6c4af0e05adf3","_id":"pdfast@0.1.0","_shasum":"fada64f5857fae288f3e9f76729cd6574f5f0b59","_from":".","_npmVersion":"3.7.1","_nodeVersion":"4.2.2","_npmUser":{"name":"gyosh","email":"will.gozali@gmail.com"},"dist":{"shasum":"fada64f5857fae288f3e9f76729cd6574f5f0b59","tarball":"https://registry.npmjs.org/pdfast/-/pdfast-0.1.0.tgz","integrity":"sha512-/P9Jkzcvj6EbjvDOIY181pAm5Wv9HUHMdg7lHVlGFH7sg1NBGC/EFpY9/6ww/3Vrc7nSiWvEu6ZJKWjObymyUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD449NCzPHIkcDI/gzTqTAJ3FvUSleR0bcwhwumfXVZ5gIhAK7itjoFPZnawGtN3ISsZg1tAry42haiseOC0VbPpcf0"}]},"maintainers":[{"name":"gyosh","email":"will.gozali@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pdfast-0.1.0.tgz_1471416724458_0.13233372708782554"}},"0.1.1":{"name":"pdfast","version":"0.1.1","description":"Fast kernel density estimation library","main":"src/index.js","keywords":["pdf","probabilty","density","function","estimation","kernel"],"repository":{"type":"git","url":"git+https://github.com/gyosh/pdfast.git"},"bugs":{"url":"https://github.com/gyosh/pdfast"},"homepage":"https://github.com/gyosh/pdfast","scripts":{"test":"mocha --timeout 10000 $(find tests -name *.spec.js)"},"author":{"name":"William Gozali","email":"will.gozali@gmail.com"},"license":"MIT","devDependencies":{"chai":"^3.5.0","lodash":"^4.14.2","mocha":"^3.0.2","rewire":"^2.5.2"},"gitHead":"e504d897106417129086eb135ba0c73e968ae085","_id":"pdfast@0.1.1","_shasum":"7d8d63c04d0a4d86321e1b858c6c2239c4474da2","_from":".","_npmVersion":"3.7.1","_nodeVersion":"4.2.2","_npmUser":{"name":"gyosh","email":"will.gozali@gmail.com"},"dist":{"shasum":"7d8d63c04d0a4d86321e1b858c6c2239c4474da2","tarball":"https://registry.npmjs.org/pdfast/-/pdfast-0.1.1.tgz","integrity":"sha512-Hj8mmw1o1PR0A+S/X+Khpfzr+WYtDnRIYXbAZBOhSNuw+8zru679soiLqH5L/zRX9+1CDzBwrf2zvRriIU1leA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAnPKCThBR+B84fzpEItaSwsUQ3RVRdA4ktjK19hzjcbAiEAsCQpS4n84H/2pTKAne+4+ealEPKuWUZEJ5nfTzIYzlU="}]},"maintainers":[{"name":"gyosh","email":"will.gozali@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pdfast-0.1.1.tgz_1471419310088_0.8856011240277439"}},"0.1.2":{"name":"pdfast","version":"0.1.2","description":"Fast kernel density estimation library","main":"src/index.js","keywords":["pdf","probabilty","density","function","estimation","kernel"],"repository":{"type":"git","url":"git+https://github.com/gyosh/pdfast.git"},"bugs":{"url":"https://github.com/gyosh/pdfast"},"homepage":"https://github.com/gyosh/pdfast","scripts":{"test":"mocha --timeout 10000 $(find tests -name *.spec.js)"},"author":{"name":"William Gozali","email":"will.gozali@gmail.com"},"license":"MIT","devDependencies":{"chai":"^3.5.0","lodash":"^4.14.2","mocha":"^3.0.2","rewire":"^2.5.2"},"gitHead":"81144acd190e33ab01e5bc0345871d47416432e6","_id":"pdfast@0.1.2","_shasum":"75743dc5863b8759340de2cf50de9cc3ad30a69a","_from":".","_npmVersion":"3.7.1","_nodeVersion":"4.2.2","_npmUser":{"name":"gyosh","email":"will.gozali@gmail.com"},"dist":{"shasum":"75743dc5863b8759340de2cf50de9cc3ad30a69a","tarball":"https://registry.npmjs.org/pdfast/-/pdfast-0.1.2.tgz","integrity":"sha512-8F6Aa5zV0U/t0pebG48UBlN6NXlNS6b/2bTh5rscMUYH+5yHMZP98vMNuHqDcWMvy8BBnWdDpgQck7wPF23o4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFM/CcQ4J1aNMEUBgaRAjI2bmCb6FtIsheoqZWOSNKiwIhAKfqsdlEz4Tq1ziV66utnN9QG0/AY82o+45yM8eGo5Da"}]},"maintainers":[{"name":"gyosh","email":"will.gozali@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pdfast-0.1.2.tgz_1472219577204_0.39470195514149964"}},"0.2.0":{"name":"pdfast","version":"0.2.0","description":"Fast kernel density estimation library","main":"src/index.js","keywords":["pdf","kde","probabilty","density","function","estimation","kernel","estimator"],"repository":{"type":"git","url":"git+https://github.com/gyosh/pdfast.git"},"bugs":{"url":"https://github.com/gyosh/pdfast"},"homepage":"https://github.com/gyosh/pdfast","scripts":{"test":"mocha --timeout 10000 $(find tests -name *.spec.js)"},"author":{"name":"William Gozali","email":"will.gozali@gmail.com"},"license":"MIT","devDependencies":{"chai":"^3.5.0","lodash":"^4.14.2","mocha":"^3.0.2","rewire":"^2.5.2"},"gitHead":"6b0d5c2830b8e00fd11e2561aeb267df5166ded0","_id":"pdfast@0.2.0","_shasum":"8cbc556e1bf2522177787c0de2e0d4373ba885c9","_from":".","_npmVersion":"3.7.1","_nodeVersion":"4.2.2","_npmUser":{"name":"gyosh","email":"will.gozali@gmail.com"},"dist":{"shasum":"8cbc556e1bf2522177787c0de2e0d4373ba885c9","tarball":"https://registry.npmjs.org/pdfast/-/pdfast-0.2.0.tgz","integrity":"sha512-cq6TTu6qKSFUHwEahi68k/kqN2mfepjkGrG9Un70cgdRRKLKY6Rf8P8uvP2NvZktaQZNF3YE7agEkLj0vGK9bA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+F9nBadOPMP6MjXIehzEenPQ6ppNj07nSdN+kPAAsVAIgfaml1vAfU9UdiJ7DmN6xzPzN/Yw4qMU/IdEahU/doMw="}]},"maintainers":[{"name":"gyosh","email":"will.gozali@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pdfast-0.2.0.tgz_1472749598248_0.8701685892883688"}}},"readme":"[![Build Status](https://travis-ci.org/gyosh/pdfast.svg)](https://travis-ci.org/gyosh/pdfast)\n[![npm version](https://badge.fury.io/js/pdfast.svg)](https://badge.fury.io/js/pdfast)\n\n# About\n\nKernel Density Estimation, generating probability density function (pdf) using triangular kernel, optimized to run in O(N + K).\n\nWhere:\n\n  * N: number of elements in the sample.\n  * K: number of points to represent the pdf.\n\n# API\n\n## create(arr, options)\n\nCreate pdf with given array and options.\n\nOptions:\n\n  * `min`: min value for the pdf's x range. If resulting pdf won't fit, the pdf's left part will be squeezed, as [described here](http://stats.stackexchange.com/questions/65866/good-methods-for-density-plots-of-non-negative-variables-in-r). Defaults to smallest value in the array minus some threshold.\n  * `max`: max value for the pdf's x range. If resulting pdf won't fit, the pdf's right will be squeezed. Defaults to largest value in the array plus some threshold.\n  * `size`: number of points to represent the pdf. Defaults to 50.\n  * `width`: determine how many points to the left and right does an element affect, similar to *bandwidth* in kernel density estimation. Defaults to 2.\n\n```js\nvar arr = [1, 2, 3, 3, 4, 5, 5, 5, 6, 8, 9, 9];\nvar options = {\n  min: 0,\n  max: 10,\n  size: 12,\n  width: 2\n};\n\nvar pdf = pdfast.create(arr, options);\n```\n\n`pdf`'s value:\n```\n[ { x: 0, y: 0.020833333333333332 },\n  { x: 0.9090909090909091, y: 0.0625 },\n  { x: 1.8181818181818181, y: 0.10416666666666667 },\n  { x: 2.727272727272727, y: 0.125 },\n  { x: 3.6363636363636362, y: 0.14583333333333334 },\n  { x: 4.545454545454545, y: 0.16666666666666666 },\n  { x: 5.454545454545454, y: 0.10416666666666667 },\n  { x: 6.363636363636363, y: 0.041666666666666664 },\n  { x: 7.2727272727272725, y: 0.08333333333333333 },\n  { x: 8.181818181818182, y: 0.10416666666666667 },\n  { x: 9.09090909090909, y: 0.041666666666666664 },\n  { x: 10, y: 0 } ]\n```\n\n## getExpectedValueFromPdf(pdf)\n\n```js\nexpect(\n  pdfast.getExpectedValueFromPdf([\n    {x: 1, y: 0.2},\n    {x: 2, y: 0.3},\n    {x: 3, y: 0.3},\n    {x: 4, y: 0.2},\n    {x: 5, y: 0.0}\n  ])\n).closeTo(2.5, 1e-8);\n```\n\n## getXWithLeftTailArea(pdf, area)\n\n```js\nvar pdf = [\n  {x: 1, y: 0.2},\n  {x: 2, y: 0.4},\n  {x: 3, y: 0.3},\n  {x: 4, y: 0.075},\n  {x: 5, y: 0.025}\n];\n\nexpect(pdfast.getXWithLeftTailArea(pdf, 0)).equal(1);\nexpect(pdfast.getXWithLeftTailArea(pdf, 0.12)).equal(1);\nexpect(pdfast.getXWithLeftTailArea(pdf, 0.19)).equal(1);\nexpect(pdfast.getXWithLeftTailArea(pdf, 0.21)).equal(2);\nexpect(pdfast.getXWithLeftTailArea(pdf, 0.95)).equal(4);\nexpect(pdfast.getXWithLeftTailArea(pdf, 1)).equal(5);\n```\n\n## getPerplexity(pdf)\n\n```js\nexpect(\n  pdfast.getPerplexity([\n    {x: 1, y: 0.2},\n    {x: 2, y: 0.4},\n    {x: 3, y: 0.3},\n    {x: 4, y: 0.075},\n    {x: 5, y: 0.025}\n  ])\n).closeTo(3.8041316039860336, EPS);\n```\n\n## getUnifiedMinMax(arr, options)\n\nTakes the same options as `create`. Returns an object with key `min` and `max`.\n\nIf you left `min` or `max` or both to be non number, it will be filled with number which will fit the data distribution.\n\n## getUnifiedMinMaxMulti([arr1, arr2, ...], options)\n\nSimilar with `getUnifiedMinMax`, but takes list of arrays. The generated `min` and/or `max` will fit all the arrays' distribution.\n\nUseful when trying to generate pdf for multiple labelled data and want to display them in the same chart. With same `min` and `max`, one can combine the pdf correctly.\n\n# License\nMIT\n","maintainers":[{"name":"gyosh","email":"will.gozali@gmail.com"}],"time":{"modified":"2022-06-23T16:40:51.343Z","created":"2016-08-11T17:26:47.207Z","0.0.1":"2016-08-11T17:26:47.207Z","0.0.2":"2016-08-11T17:56:53.796Z","0.0.3":"2016-08-11T17:59:25.661Z","0.0.4":"2016-08-13T02:19:05.674Z","0.0.5":"2016-08-13T14:17:01.787Z","0.1.0":"2016-08-17T06:52:04.737Z","0.1.1":"2016-08-17T07:35:10.339Z","0.1.2":"2016-08-26T13:52:57.436Z","0.2.0":"2016-09-01T17:06:38.477Z"},"keywords":["pdf","kde","probabilty","density","function","estimation","kernel","estimator"],"author":{"name":"William Gozali","email":"will.gozali@gmail.com"},"license":"MIT","readmeFilename":"README.md","homepage":"https://github.com/gyosh/pdfast","repository":{"type":"git","url":"git+https://github.com/gyosh/pdfast.git"},"bugs":{"url":"https://github.com/gyosh/pdfast"}}