Causality Analyzer
    Preparing search index...

    Online Dirichlet parameter learner for CPT updates.

    Maintains Dirichlet priors for each CPT cell and updates them with new observations using closed-form moments (no MCMC needed).

    • Prior: Dirichlet(α)
    • After n observations: Dirichlet(α + counts)
    • Mean: (α + count) / (α₀ + n)
    • Variance: closed-form from Dirichlet moments

    Usage:

    const learner = new DirichletLearner({ alpha: 1 });
    learner.update('A', '', true); // root node A observed anomalous
    learner.update('B', '1', false); // B observed normal when parent=1
    const cpt = learner.getCPTs(); // get updated CPTs
    Index
    • Number of observations seen for a node+parent combination.

      Parameters

      • node: string
      • parentKey: string

      Returns number

    • Update the learner with a new observation.

      Parameters

      • node: string

        — variable name

      • parentKey: string

        — comma-separated parent values ('' for root nodes)

      • isAnomalous: boolean

        — whether the node was anomalous

      Returns void