{"_id":"@apocentre/alias-sampling","_rev":"2-384eb3577ea537da4ea9fa404c798deb","name":"@apocentre/alias-sampling","dist-tags":{"latest":"0.5.3"},"versions":{"0.5.2":{"name":"@apocentre/alias-sampling","version":"0.5.2","description":"Library for sampling of random values from a discrete probability distribution, using the Walker-Vose alias method.","main":"index.js","scripts":{"test":"node test.js"},"keywords":["sampling","distribution","discrete","alias method","Vose"],"author":{"name":"Antonis Poulakis","email":"antwnic4@gmail.com"},"license":"GPL","repository":{"type":"git","url":"git+https://github.com/apocentre/sampling.git"},"bugs":{"url":"https://github.com/apocentre/sampling/issues"},"homepage":"https://github.com/apocentre/sampling#readme","devDependencies":{"tape":"^2.10.2"},"gitHead":"16e6f6c02038c809295b9414f8c8c5d78fcd8751","_id":"@apocentre/alias-sampling@0.5.2","_nodeVersion":"12.17.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-mxdeoS6eKl4NJJ9gQkqlrnRpOiZLP5ervtaVGK3GCIxG4s19y+J4ceBbd1CeaRAwDsuAH23BBesNc3onTX0kHQ==","shasum":"7a3346168e67dae225607c4127d01b6ec26614a5","tarball":"https://registry.npmjs.org/@apocentre/alias-sampling/-/alias-sampling-0.5.2.tgz","fileCount":6,"unpackedSize":24371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKpxOCRA9TVsSAnZWagAAJA0P/jQqTb6MwSTLoAKeRcxN\nGxOAqklB/ZLWMhBCZwqPRnTD2JN7zQqLkXeHdHffk2Aij8KUexHtyxCEPL5v\nKospg8F5qOXRAFGLefD2ugnxOoFNzNC2SzbezmUcHNg1rISqBWF95rKK6mtO\nOZiyQaL4tFGFTKI29jDU3I+jtT97is31q1+zDevUiZJiPbIEFkXWySK/+yhK\nvdwuC64J8YAYRXa1eM3p/b8FyTphCgXEkPWWs4byIjGIi+Ttt8j2PuaLcos4\n2VxFotVy+u44EXnyA06L1Mc+uN8BMyFq6eJ8K0lPBoTdhpMn9hF6thqchCiH\nN5aU3Y/znfwqfBiFgkezY9QOu4rZf/3CzJ3+IfVY0K6FQhEUvQMlhU6qQJgP\nrd5/JfYqdY9qfqwydhtXbnXl9q5Jbe5Q6m+khH55CVGsH0HGytJLpKxrZ7fE\nYtOYcG72zDlrzlN0iX9faNwUe1BKd14smzaiSigIKx9tkVYWlMjo3N0lqIZ0\nKMCHl2CfSs5QpkjIRsNwx0IaF9R5gT1A7Zgw3Wne8FwFZpHZZNNokQNkBSmp\nlgYW6NKxXGumczTPalso9+c3kuUUWYv30HhE9yeLHUFSoW7MJtpI0JqYV2jB\nicg5mU/FTR6wilHnjdt+vi/SlljMAyx5zB0xeANqdsNFs4tIK8q0Ca4j+V9Q\nIDGJ\r\n=0VkP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCC9qzOKe1AV9qTGqmIqI3qKjYi+hOnW4ucKYoFulNxbAIhANAgwFyNnNO3JqatQ3KSDUmZDWMG//jFcVzCO/nQdCmc"}]},"_npmUser":{"name":"antwnic4","email":"antwnic4@gmail.com"},"directories":{},"maintainers":[{"name":"antwnic4","email":"antwnic4@gmail.com"},{"name":"nikosfotiadis","email":"nikosfotiadis0@gmail.com"},{"name":"ppoliani","email":"ppoliani@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alias-sampling_0.5.2_1613405261884_0.17331366739153276"},"_hasShrinkwrap":false},"0.5.3":{"name":"@apocentre/alias-sampling","version":"0.5.3","description":"Library for sampling of random values from a discrete probability distribution, using the Walker-Vose alias method.","main":"index.js","scripts":{"test":"node test.js"},"keywords":["sampling","distribution","discrete","alias method","Vose"],"author":{"name":"Antonis Poulakis","email":"antwnic4@gmail.com"},"license":"GPL","repository":{"type":"git","url":"git+https://github.com/apocentre/sampling.git"},"bugs":{"url":"https://github.com/apocentre/sampling/issues"},"homepage":"https://github.com/apocentre/sampling#readme","devDependencies":{"tape":"^2.10.2"},"gitHead":"16e6f6c02038c809295b9414f8c8c5d78fcd8751","_id":"@apocentre/alias-sampling@0.5.3","_nodeVersion":"12.17.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7UDWIIF9hIeJqfKXkNIzkVandlwLf1FWTSdrb9iXvOP8oF544JRXQjCbiTmCv2c9n44n/FIWtehhBfNuAx2CZA==","shasum":"897ff181b48ad7b2bcb4ecf29400214888244f08","tarball":"https://registry.npmjs.org/@apocentre/alias-sampling/-/alias-sampling-0.5.3.tgz","fileCount":6,"unpackedSize":24339,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKp0DCRA9TVsSAnZWagAAmNYP/1PawnuWeWlBsa6EM+3k\nSBhHKhEwYgNGpcWCBnMc/JhNDepe1rvFQg0xK+17B/Yk6wTlrIiTc01poZ4J\nD+MC98DYF5QwGkWfvQbUupxg8EW9HSLSq1XqEXAK99pIA/FKfwfDmZIWPJQZ\nRkyPfewgYquEpsOL3O/6mpyeY0x8+0lG6ZE3SAMlVh4M/rIvOfqyWobCGT83\nNAXRLQ+6nx3ryVeps/x6rS83xzxRk370HeEgQNUFMK43xQrzBFWPUz4Lv/Ry\nC6ngQ4YAGjzkX0EqkwZqpKS+NgdtiNmOp6fsswIrlkVQmPb6pknGmKz/omOl\nSos/mbFG24w6gpZLb8ntYQKhC+cL4ZTPhNpxjS3W6TZS0OGHjMFC7nLDCrbt\n45rrADg4NYWA1mFbc4009ffCk4iqE+ttXhCj7SsY/BEiBTw0OhVNcxjuOckt\nZU0EDP/iOIXpVzb2DL41XSwHsz7wmHODEbFP4r7eZRUuJmPVD8iDMQafiXVl\n0uAGBIaeflAP2FfWPL6BGmSBz4m9Qwec/Be9Ytf6PVSsW2JI4UYa/7fSDe2g\nfPy7rsZf9Y/HYUsQCzoZvaSu6jWcNuiKkSYG8hUfO9aWjgd8EVOQ7UgA+n5U\naspiAdmh9/XIh7fq6tadTMURgZ0dpx9UETM0XwSyr28yH/wj2PyKhl9laGEw\nhbs8\r\n=Bhf8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFE71O/gYYpEDQXxFUdlndTVB9LfyLlszkN1yUHzdcGLAiAR4qOB+qZa5IvnOww2bLMAr9qg8Cmr7NN/pE1PcfgS2Q=="}]},"_npmUser":{"name":"antwnic4","email":"antwnic4@gmail.com"},"directories":{},"maintainers":[{"name":"antwnic4","email":"antwnic4@gmail.com"},{"name":"nikosfotiadis","email":"nikosfotiadis0@gmail.com"},{"name":"ppoliani","email":"ppoliani@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alias-sampling_0.5.3_1613405442750_0.7214119850937319"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-15T16:07:41.567Z","0.5.2":"2021-02-15T16:07:42.030Z","modified":"2022-04-04T14:39:18.236Z","0.5.3":"2021-02-15T16:10:42.861Z"},"maintainers":[{"name":"antwnic4","email":"antwnic4@gmail.com"},{"name":"nikosfotiadis","email":"nikosfotiadis0@gmail.com"},{"name":"ppoliani","email":"ppoliani@gmail.com"}],"description":"Library for sampling of random values from a discrete probability distribution, using the Walker-Vose alias method.","homepage":"https://github.com/apocentre/sampling#readme","keywords":["sampling","distribution","discrete","alias method","Vose"],"repository":{"type":"git","url":"git+https://github.com/apocentre/sampling.git"},"author":{"name":"Antonis Poulakis","email":"antwnic4@gmail.com"},"bugs":{"url":"https://github.com/apocentre/sampling/issues"},"license":"GPL","readme":"# Alias Method for Sampling\n\nLibrary for sampling of random values from a discrete probability distribution, using the Walker-Vose alias method.\n\n## Installation\n\n```shell script\nyarn add @apocentre/aliasing\n```\n\n## Usage\n\n```javascript\nvar s = sample([0.5, 0.25, 0.25], ['A', 'B', 'C']);\ns.next(); // => random outcome according to specified probabilities\n```\n\n```javascript\nvar s = sample([0.5, 0.25, 0.25], [10, 20, 30]);\ns.next(1000); // => 1000 random samples according to specified probabilities\n```\n\n```javascript\nvar s = sample([0.5, 0.25, 0.25]);\ns.next(); // => random index according to specified probabilities\n```\n\n```javascript\nvar rand = Math.rand; // custom random generator function\nvar s = sample([0.5, 0.25, 0.25], null, rand);\ns.next(); // => random index according to specified probabilities\n```\n\n* * * *\n\nHave fun!\n\n[![Build Status](https://travis-ci.org/mfornos/sampling.svg)](https://travis-ci.org/mfornos/sampling)\n","readmeFilename":"README.md"}