@cognitive-swarm/math
v0.2.0
Published
Mathematical foundations — Bayesian inference, entropy, game theory, Markov chains
Readme
@cognitive-swarm/math
Mathematical foundations -- Bayesian inference, entropy, game theory, Markov chains, and more.
Install
npm install @cognitive-swarm/mathOverview
A 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.
Modules
Bayesian Inference
import { BeliefNetwork, voteToLikelihoodRatio } from '@cognitive-swarm/math'
const net = new BeliefNetwork(prior)
net.update(evidence)Information Theory
import { EntropyTracker, shannonEntropy, klDivergence, jsDivergence } from '@cognitive-swarm/math'Game Theory
import { AgreeChallenge } from '@cognitive-swarm/math'
// Models agree/challenge dynamics between agents with configurable payoffsMarkov Chains
import { MarkovChain } from '@cognitive-swarm/math'
const chain = new MarkovChain(transitionMatrix)
chain.predictConvergence()Mutual Information
import { RedundancyDetector } from '@cognitive-swarm/math'
// Detects redundant agents by measuring pairwise mutual informationParticle Swarm Optimization
import { ParticleSwarm } from '@cognitive-swarm/math'Topological Data Analysis
import { TopologyAnalyzer } from '@cognitive-swarm/math'
// Clustering, gap detection, persistence pairsOpinion Dynamics (Hegselmann-Krause)
import { OpinionDynamics } from '@cognitive-swarm/math'
// Models opinion convergence and polarizationReplicator Dynamics
import { ReplicatorDynamics } from '@cognitive-swarm/math'
// Evolutionary strategy balancing across agentsInfluence Graph
import { InfluenceGraph } from '@cognitive-swarm/math'
// Spectral analysis of agent influence networksOptimal Stopping (CUSUM + Secretary Problem)
import { OptimalStopping } from '@cognitive-swarm/math'
// Decides when the swarm should stop iteratingShapley Values
import { ShapleyValuator } from '@cognitive-swarm/math'
// Fair attribution of each agent's marginal contributionLicense
Apache-2.0
