{"name":"distributions","description":"A collection of probability distribution functions","version":"2.2.0","author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"main":"./distributions.js","scripts":{"test":"tap test/simple/*"},"repository":{"type":"git","url":"git://github.com/AndreasMadsen/distributions.git"},"keywords":["distribution","normal","studentt","uniform"],"dependencies":{"cephes":"^2.0.0"},"devDependencies":{"tap":"^18.0.0"},"license":"MIT","_id":"distributions@2.2.0","gitHead":"9a2ad08f961467815385cd55838cc17e70b97de5","bugs":{"url":"https://github.com/AndreasMadsen/distributions/issues"},"homepage":"https://github.com/AndreasMadsen/distributions#readme","_nodeVersion":"21.7.3","_npmVersion":"10.5.0","dist":{"integrity":"sha512-n7ybud+CRAOZlpg+ETuA0PTiSBfyVNt8Okns5gSK4NvHwj7RamQoufptOucvVcTn9CV4DZ38p1k6TgwMexUNkQ==","shasum":"1b5852bb241498eb3aeb5f12db43eb103dbe5572","tarball":"http://registry-npm.ywwl.com/distributions/download/distributions-2.2.0.tgz","fileCount":15,"unpackedSize":34851,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBHIPfOROfnD11xMgtU183g7dz8WJbt4LWFwTtBUDw8aAiATwhAP71t7fjY4qXOgEtf8Rgfn58zLW6rXfSpNVsCFaA=="}],"size":8695,"noattachment":false,"key":"/distributions/-/distributions-2.2.0.tgz"},"_npmUser":{"name":"andreasmadsen","email":"amwebdk@gmail.com"},"directories":{},"maintainers":[{"name":"andreasmadsen","email":"amwebdk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/distributions_2.2.0_1714748189148_0.4368329657828789"},"_hasShrinkwrap":false,"readme":"# distributions\n\n> A collection of probability distribution functions\n\n## Installation\n\n```sheel\nnpm install distributions\n```\n\n## Example\n\n```javascript\nvar distributions = require('distributions');\nvar normal = distributions.Normal(1 /* mean */, 2 /* std deviation */);\n\nconsole.log(normal.pdf(1)); // 0.199...\nconsole.log(normal.cdf(1)); // 0.5\nconsole.log(normal.inv(1)); // Infiniy\n\nconsole.log(normal.mean()); // 1\nconsole.log(normal.median()); // 1\nconsole.log(normal.variance()); // 4\n```\n\n## Documentation\n\nAll distributions in this module takes some or no arguments and can have a\ndefault value. They are also created by calling the constructor:\n\n```javascript\n// both do the same\nvar uniform = distributions.Uniform(-2, 2);\nvar uniform = new distributions.Uniform(-2, 2);\n```\n\nThe instance then has 3 probability functions:\n\n```javascript\nvar y = uniform.pdf(x); // probability density function\nvar p = uniform.cdf(q); // cumulative distribution function\nvar q = uniform.inv(p); // quantile function\n```\n\nand also 3 general methods for the _median_, _mean_ and _variance_:\n\n```javascript\nuniform.median();\nuniform.mean();\nuniform.variance();\n```\n\nThe currently implemented distributions are listed bellow.\n\n##### `Uniform(a = 0, b = 1)` - The Uniform Distribution\n\nCreate a uniform distribution, with a range from `a` to `b`. Note that\n`uniform.inv(p)` will return `NaN` outside the range from `0` to `1`,\nand that `uniform.inv(0) == a` and  `uniform.inv(1) == b`.\n\n##### `Normal(mean = 0, sd = 1)` - The Normal Distribution\n\nCreate a normal distribution, with a custom mean (`mean`) and standard deviation\n(`sd`).\n\n##### `Studentt(df)` - The Student t Distribution\n\nCreate a student t distribution, with a degree of freedom set to `df`.\n\n##### `Binomial(properbility, size)` - The Binomial Distribution\n\nCreate a binomial distribution, with a a given `properbility` of success and\nsample `size`.\n\n## Testing\n\nAll functions are tested by comparing with a mathematical reference\neither _MatLab_, _Maple_ or _R_.\n\n## License\n\n**The software is license under \"MIT\"**\n\n> Copyright (c) 2013 Andreas Madsen\n>\n> Permission is hereby granted, free of charge, to any person obtaining a copy\n> of this software and associated documentation files (the \"Software\"), to deal\n> in the Software without restriction, including without limitation the rights\n> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n> copies of the Software, and to permit persons to whom the Software is\n> furnished to do so, subject to the following conditions:\n>\n> The above copyright notice and this permission notice shall be included in\n> all copies or substantial portions of the Software.\n>\n> THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n> THE SOFTWARE.\n","publish_time":1714748189306,"_cnpm_publish_time":1714748189306,"dist-tags":{"latest":"2.2.0"}}