{"name":"distributions","description":"A collection of probability distribution functions","version":"1.0.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":{"mathfn":"^1.0.0"},"devDependencies":{"tap":"^6.3.0"},"license":"MIT","gitHead":"18e6d16137a6ab30f4e2721b69e644f0bb11061e","bugs":{"url":"https://github.com/AndreasMadsen/distributions/issues"},"homepage":"https://github.com/AndreasMadsen/distributions#readme","_id":"distributions@1.0.0","_shasum":"16466e676df7f311929941d3d7f02010466671a9","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.2-pre","_npmUser":{"name":"andreasmadsen","email":"amwebdk@gmail.com"},"dist":{"shasum":"16466e676df7f311929941d3d7f02010466671a9","tarball":"http://registry-npm.ywwl.com/distributions/download/distributions-1.0.0.tgz","integrity":"sha512-whZgPSACZKP9XAqPsmHeKs6U0e95eYcD4A94WqfzKf+g0t1UmiNTK4iuV0U1RbsBzTgllkkfKJN+kp0Ce5GnZw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICb7R5H75wVUPPX/wlfR+p0i/Jz38jVVFzNCXpz8q+uUAiBOcp5eAfLncrgax2Ft+ngjDWjbNkaMAL4uS4r+l+LCiA=="}],"size":4714,"noattachment":false,"key":"/distributions/-/distributions-1.0.0.tgz"},"maintainers":[{"name":"andreasmadsen","email":"amwebdk@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/distributions-1.0.0.tgz_1470832814065_0.9235431863926351"},"directories":{},"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":1470832815774,"_cnpm_publish_time":1470832815774,"dist-tags":{"latest":"2.2.0"}}