What does Spirit Writing, Ideomotor Action and Text Attribution conclude, in numbers, about “The Limits of Attribution: Text Length, Open Sets and Register Confounds”?

Answer: Chapter 6 tests short texts and open candidate sets: at 300 characters and a threshold of 0.45, writers missing from the list are wrongly named only 0.043 of the time while 0.940 of in-list texts are still named correctly.

Scope of the numbers: Its parameters are illustrative and its revealed texts are synthetic demonstrations written for it; all calculations are generated by its programs. Chapter 5 demonstrates three attribution methods on a synthetic corpus, character-bigram cosine, Burrows's Delta and naive Bayes; all six revealed texts are attributed correctly, while the naive-Bayes log odds of 8.92 to 21.37 are systematically too large.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.043, 0.45, 0.940, 300

texts of 300 syllables
threshold tin-list named rightD wrongly named
0.001.0001.000
0.400.9970.413
0.450.9400.043
0.500.7770.000
texts of 100 syllables
threshold tin-list named rightD wrongly named
0.000.9871.000
0.400.4100.003
0.450.2030.000
0.500.0370.000
Show the full program
# Chapter 6. p62: the open-set trap and an abstention threshold
# Same seeded generator as p51. A closed-set method always names one of
# the candidates, even when the real writer, here a fourth medium D who
# is not on the list, wrote the text. Rule: name the best candidate
# only if its bigram cosine is at least t; otherwise abstain. For each t
# we report, on 300 fresh seance texts by in-list writers (A, B, C) and
# 300 by D, the share correctly named and the share of D's texts that
# are wrongly pinned on someone. Synthetic data only.
# 模型:开放集溯源与弃权阈值;语料全部为自拟合成示范。
import bisect
import math
import random
from collections import Counter

SYL = ("zhi hu zhe ye yi er qi suo wei yu ze nai ru ruo gu fu bu wu"
       " you ren xin tian di shan shui yue ri feng yun hua men jia lu"
       " chun qiu he jiang shi wen ming").split()
OWN = {"A": "cha jiu qin shu", "B": "mai dou can sang",
       "C": "chuan hai qiao zhou"}
DEITY = "shen xian fo sheng dan jing tan luan".split()
SEEDS = {"A": 11, "B": 22, "C": 33}


def profile(name):
    # an author's habits: a locally shuffled Zipf order of the shared
    # syllables and one favourite successor for each syllable
    rng = random.Random(SEEDS[name])
    order = list(range(len(SYL)))
    for _ in range(30):
        i = rng.randrange(len(SYL) - 1)
        j = min(len(SYL) - 1, i + 1 + rng.randrange(6))
        order[i], order[j] = order[j], order[i]
    weight = [0] * len(SYL)
    for rank, idx in enumerate(order):
        weight[idx] = 600 // (rank + 2)
    habit = [rng.randrange(len(SYL)) for _ in SYL]
    return weight, habit


def write(name, length, deity, rng):
    # deity register: a shared ritual vocabulary at rate 0.2 and a
    # doubled taste for the four sentence particles
    weight, habit = profile(name)
    if deity:
        weight = [w * 2 if i < 4 else w for i, w in enumerate(weight)]
        topic, rate = DEITY, 0.20
    else:
        topic, rate = OWN[name].split(), 0.10
    cum, tot = [], 0
    for w in weight:
        tot += w
        cum.append(tot)
    out, prev = [], None
    for _ in range(length):
        u = rng.random()
        if u < rate:
            tok = topic[rng.randrange(len(topic))]
            prev = None
        elif prev is not None and u < rate + 0.12:
            prev = habit[prev]
            tok = SYL[prev]
        else:
            prev = bisect.bisect_right(cum, rng.randrange(tot))
            tok = SYL[prev]
        out.append(tok)
    return out


def corpus(rng):
    own = {m: [write(m, 400, False, rng) for _ in range(5)]
           for m in "ABC"}
    truth = "AABBBC"
    revealed = [write(m, 300, True, rng) for m in truth]
    return own, revealed, truth


SEEDS["D"] = 44
OWN["D"] = "ma che jie qiang"


def bigrams(tokens):
    return Counter(zip(tokens, tokens[1:]))


def cosine(a, b):
    keys = sorted(set(a) & set(b))
    dot = math.fsum(a[k] * b[k] for k in keys)
    na = math.sqrt(math.fsum(v * v for v in a.values()))
    nb = math.sqrt(math.fsum(v * v for v in b.values()))
    return dot / (na * nb) if na and nb else 0.0


def best(text, big):
    b = bigrams(text)
    sims = [cosine(b, big[m]) for m in "ABC"]
    top = max(sims)
    return "ABC"[sims.index(top)], top


if __name__ == "__main__":
    rng = random.Random(20261112)
    own, _, _ = corpus(rng)
    big = {m: bigrams([t for e in own[m] for t in e]) for m in "ABC"}
    for length in (300, 100):
        inset = []
        for _ in range(300):
            who = "ABC"[rng.randrange(3)]
            inset.append((who, best(write(who, length, True, rng), big)))
        outset = [best(write("D", length, True, rng), big)
                  for _ in range(300)]
        print("texts of {} syllables".format(length))
        print("  threshold t   in-list named right   D wrongly named")
        for t in (0.0, 0.40, 0.45, 0.50):
            good = len([1 for w, (n, s) in inset if s >= t and n == w])
            bad = len([1 for n, s in outset if s >= t])
            print("  {:11.2f}   {:19.3f}   {:15.3f}".format(
                t, good / 300, bad / 300))

Single source and citation

Fan, Y. (2026). Ideomotor Micro-Movements in Spirit Writing, Random-Walk Stylus Trajectories and Stylometric Attribution of Revealed Texts (Version 1.0.0), Chapter 6: The Limits of Attribution: Text Length, Open Sets and Register Confounds. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-226 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026226,
  author    = {Fan, Yafu},
  title     = {Ideomotor Micro-Movements in Spirit Writing, Random-Walk Stylus Trajectories and Stylometric Attribution of Revealed Texts},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book