{"_id":"@cognitive-swarm/math","name":"@cognitive-swarm/math","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@cognitive-swarm/math","version":"0.2.0","description":"Mathematical foundations — Bayesian inference, entropy, game theory, Markov chains","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","test":"vitest run","test:watch":"vitest","lint":"eslint src/","clean":"rm -rf dist"},"dependencies":{"@cognitive-swarm/core":"*"},"license":"Apache-2.0","author":{"name":"Dmitry Zorin"},"repository":{"type":"git","url":"git+https://github.com/medonomator/cognitive-swarm.git","directory":"packages/math"},"publishConfig":{"access":"public"},"homepage":"https://medonomator.github.io/cognitive-swarm/","bugs":{"url":"https://github.com/medonomator/cognitive-swarm/issues"},"gitHead":"8613f7b139c03719ef14fe9f2c01bdc1c5532a26","_id":"@cognitive-swarm/math@0.2.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-pvuN/0KD2uBQ6CT2mK749HFzjrmbfos+1wYy1g+zqg5rvGlMug4J4Rzu3PfBbzdHPjr9kJjR5lqHXovVDsmYJg==","shasum":"351f89d05b215d812bf99e9be9ffb43cd71204e1","tarball":"https://registry.npmjs.org/@cognitive-swarm/math/-/math-0.2.0.tgz","fileCount":122,"unpackedSize":584641,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDJXxPxGeRLeuUPCjBfsoPzz+kKpixpVknrMWjCVhBjBgIgTDQWjmZ9zxOVKrk3Ny42zoMAzBtpxXxpU5nJfO9e1BY="}]},"_npmUser":{"name":"medonomator","email":"budteschastlivi1@gmail.com"},"directories":{},"maintainers":[{"name":"medonomator","email":"budteschastlivi1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/math_0.2.0_1776497120462_0.7952448745192418"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-18T07:25:20.377Z","0.2.0":"2026-04-18T07:25:20.682Z","modified":"2026-04-18T07:25:20.959Z"},"maintainers":[{"name":"medonomator","email":"budteschastlivi1@gmail.com"}],"description":"Mathematical foundations — Bayesian inference, entropy, game theory, Markov chains","homepage":"https://medonomator.github.io/cognitive-swarm/","repository":{"type":"git","url":"git+https://github.com/medonomator/cognitive-swarm.git","directory":"packages/math"},"author":{"name":"Dmitry Zorin"},"bugs":{"url":"https://github.com/medonomator/cognitive-swarm/issues"},"license":"Apache-2.0","readme":"# @cognitive-swarm/math\n\nMathematical foundations -- Bayesian inference, entropy, game theory, Markov chains, and more.\n\n## Install\n\n```bash\nnpm install @cognitive-swarm/math\n```\n\n## Overview\n\nA pure-math toolkit that powers the swarm's analytical capabilities. Every module is stateless or self-contained, with no dependency on the rest of the swarm runtime -- use them independently or let the orchestrator wire them in automatically.\n\n## Modules\n\n### Bayesian Inference\n```typescript\nimport { BeliefNetwork, voteToLikelihoodRatio } from '@cognitive-swarm/math'\nconst net = new BeliefNetwork(prior)\nnet.update(evidence)\n```\n\n### Information Theory\n```typescript\nimport { EntropyTracker, shannonEntropy, klDivergence, jsDivergence } from '@cognitive-swarm/math'\n```\n\n### Game Theory\n```typescript\nimport { AgreeChallenge } from '@cognitive-swarm/math'\n// Models agree/challenge dynamics between agents with configurable payoffs\n```\n\n### Markov Chains\n```typescript\nimport { MarkovChain } from '@cognitive-swarm/math'\nconst chain = new MarkovChain(transitionMatrix)\nchain.predictConvergence()\n```\n\n### Mutual Information\n```typescript\nimport { RedundancyDetector } from '@cognitive-swarm/math'\n// Detects redundant agents by measuring pairwise mutual information\n```\n\n### Particle Swarm Optimization\n```typescript\nimport { ParticleSwarm } from '@cognitive-swarm/math'\n```\n\n### Topological Data Analysis\n```typescript\nimport { TopologyAnalyzer } from '@cognitive-swarm/math'\n// Clustering, gap detection, persistence pairs\n```\n\n### Opinion Dynamics (Hegselmann-Krause)\n```typescript\nimport { OpinionDynamics } from '@cognitive-swarm/math'\n// Models opinion convergence and polarization\n```\n\n### Replicator Dynamics\n```typescript\nimport { ReplicatorDynamics } from '@cognitive-swarm/math'\n// Evolutionary strategy balancing across agents\n```\n\n### Influence Graph\n```typescript\nimport { InfluenceGraph } from '@cognitive-swarm/math'\n// Spectral analysis of agent influence networks\n```\n\n### Optimal Stopping (CUSUM + Secretary Problem)\n```typescript\nimport { OptimalStopping } from '@cognitive-swarm/math'\n// Decides when the swarm should stop iterating\n```\n\n### Shapley Values\n```typescript\nimport { ShapleyValuator } from '@cognitive-swarm/math'\n// Fair attribution of each agent's marginal contribution\n```\n\n## License\n\nApache-2.0\n\n## Links\n\n- [cognitive-swarm root](https://github.com/medonomator/cognitive-swarm)\n","readmeFilename":"README.md","_rev":"1-597c14b97b109b94aadf6a19bc605db0"}