{"name":"distributions","description":"A collection of probability distribution functions","version":"0.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":{"mathfn":"0.3.x"},"devDependencies":{"tap":"0.4.x"},"license":"MIT","engines":{"node":"0.10","npm":"1"},"bugs":{"url":"https://github.com/AndreasMadsen/distributions/issues"},"_id":"distributions@0.2.0","dist":{"shasum":"168b6ec79a59080976fe6a258b20eda676f7a25d","tarball":"http://registry-npm.ywwl.com/distributions/download/distributions-0.2.0.tgz","integrity":"sha512-JWKKEFPA91ekq76avMqVfVPgrJuHEX9eIpi71SRnHUbrcxuHVEzBDRpV5JiFuZb6u5tqokFnolHRdRjLZvGb4w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpwVEq+Zpfvf3Ys/6/mFpi6/HfWxrO925eRUpB3TbrEwIgE4PItD3DDXzc0V5lS+Um3jtxoXb9yd7YXX8cFJiRTro="}],"size":4817,"noattachment":false,"key":"/distributions/-/distributions-0.2.0.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"andreasmadsen","email":"amwebdk@gmail.com"},"maintainers":[{"name":"andreasmadsen","email":"amwebdk@gmail.com"}],"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":1372623523994,"_cnpm_publish_time":1372623523994,"dist-tags":{"latest":"2.2.0"}}