Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Notebook 6: Integration — compact personal influence loop

Combines: reach (NB1), allocation productivity (NB2), credibility (NB3), mismatch (NB4). Toy — replace rules with your thesis-quality model.

from __future__ import annotations

import numpy as np
import matplotlib.pyplot as plt

plt.style.use("dark_background")


def reach(attention: float, credibility: float, clarity: float) -> float:
    x = max(attention, 0.0) * np.clip(credibility, 0, 1) * np.clip(clarity, 0, 1)
    return 100.0 * np.sqrt(x)


def productivity(create: float, distribute: float, learn: float, recover: float) -> float:
    base = 0.4 * create + 0.35 * distribute + 0.15 * learn
    recovery_bonus = min(recover, 3.0) * 0.08
    recovery_penalty = max(0.0, 2.0 - recover) * 0.15
    return max(0.1, base + recovery_bonus - recovery_penalty)


def mismatch_score(msg: np.ndarray, need: np.ndarray) -> float:
    return float(np.linalg.norm(msg - need))


days = 90
need = np.array([0.7, 0.3])
msg = np.array([0.45, 0.55])
cred = 0.5
total = 6.0
alloc = (2.0, 2.0, 1.0, 1.0)
hist = []
for d in range(days):
    create, distribute, learn, recover = alloc
    eff = productivity(create, distribute, learn, recover)
    clarity = float(np.clip(1.0 - 0.5 * mismatch_score(msg, need), 0.1, 1.0))
    attention = total * eff / 3.0
    r = reach(attention, cred, clarity)
    proof = 0.55
    claim = 0.5
    cred = float(np.clip(cred + 0.05 * (proof - claim) + 0.01 * (0.5 - cred), 0.0, 1.0))
    hist.append((d, r, cred, clarity))

arr = np.array(hist)
fig, ax = plt.subplots()
ax.plot(arr[:, 0], arr[:, 1], label="daily reach")
ax.plot(arr[:, 0], arr[:, 2] * 100, label="credibility * 100")
ax.legend()
ax.set_xlabel("day")
plt.show()

One-page report (outline)

  1. Ontology: what entities and what you left out

  2. Baseline vs optimized vs stress — parameters changed

  3. Top 3 sensitivities

  4. Ethical boundary: what you refuse to optimize