5D Library › Dyadic Phase Coupling, Bilinear Compatibility Tensors and Spatiotemporal Grid Games · 中文

Chapter 1. A Match Score Is a Bilinear Form

From verse to matrix

Any chart-matching rule can be taken apart into two steps. The first encodes each person as a feature vector xx: the strength of the five phases in the Eight Characters, the signs and houses of the planets in a horoscope, the placement of the main stars in a Zi Wei chart — the encodings differ widely, but each ends as a list of numbers. The second step combines two people’s vectors into a score. The most general and yet the simplest combination is a bilinear form

s(A,B)=xA⊤MxB=∑i,jxA,iMijxB,j,s(A, B) = x_A^{\top} M x_B = \sum_{i,j} x_{A,i}\, M_{ij}\, x_{B,j},

where MijM_{ij} says whether A’s feature ii and B’s feature jj “generate” (positive) or “overcome” (negative) each other, and how strongly. The traditional “generating”, “overcoming”, “combining” and “clashing” can all be read as the signs and sizes of certain entries of MM.

This chapter does not ask whether the features encoded in xx have anything to do with people’s temperaments or relationships — that is an empirical question, and Chapter 8 gives a design to test it. It asks only what the form itself dictates once a score has been written this way.

The symmetric and the antisymmetric part

If MM is not symmetric — M≠M⊤M \neq M^{\top}, in the sense of MAB≠MBAM_{AB} \neq M_{BA} — A’s score for B differs from B’s score for A. Every square matrix can be written uniquely as

M=S+K,S=12(M+M⊤),K=12(M−M⊤),M = S + K, \qquad S = \tfrac{1}{2}(M + M^{\top}), \qquad K = \tfrac{1}{2}(M – M^{\top}),

with SS symmetric and KK antisymmetric. It follows at once that

s(A,B)+s(B,A)=2xA⊤SxB,s(A,B)−s(B,A)=2xA⊤KxB.s(A,B) + s(B,A) = 2\, x_A^{\top} S x_B, \qquad s(A,B) – s(B,A) = 2\, x_A^{\top} K x_B .

The first is what the two share; the second is what flows one way: whatever A gains in it, B loses. Because x⊤Kx=0x^{\top} K x = 0 for every xx, a person’s “one-way” part with themselves is always zero — one-sidedness exists only between two different people.

Calculation

Three kinds of pair, defined. A pair in which both directions score positive is called “mutually compatible” (in chart-matching language a “right match”); both negative, “mutually repelling” (an “ill-fated match”); opposite signs, “one-way” — one side’s score positive and the other’s negative, in everyday speech “parasitic” or “siphoning”. These are names for combinations of signs, not judgements about real relationships.

The first program draws a random matrix MM, controls how one-sided it is by the ratio r=‖K‖/‖S‖r = \lVert K \rVert / \lVert S \rVert, draws 20,000 pairs of people and counts each kind of pair; then, in a pool of 200 people, it checks whether the best match chosen “by what A gives” and the best match chosen “by what A receives” are the same person.

Calculation

# Chapter 1. A bilinear compatibility score and its two halves.
# Each person is a vector x of d = 6 traits, each uniform on [-1, 1]. The
# score of A towards B is s(A, B) = x_A' M x_B. If M is not symmetric,
# s(A, B) and s(B, A) differ. Every square M splits uniquely as M = S + K with
#   S = (M + M') / 2  symmetric       -> s(A,B) + s(B,A) = 2 x_A' S x_B
#   K = (M - M') / 2  antisymmetric   -> s(A,B) - s(B,A) = 2 x_A' K x_B
# r = |K| / |S| (Frobenius norms) measures how one-sided M is. For each r the
# program draws M, then 20,000 random pairs, and counts pairs where both
# scores are positive (mutual), where the signs differ (one-way), and where
# both are negative; and, in a pool of 200 people, how often A's best match
# "by what A gives" differs from A's best match "by what A receives".
import random

D, PAIRS, POOL = 6, 20000, 200

def rand_matrix(rng, r):
    a = [[rng.gauss(0, 1) for _ in range(D)] for _ in range(D)]
    s = [[(a[i][j] + a[j][i]) / 2 for j in range(D)] for i in range(D)]
    b = [[rng.gauss(0, 1) for _ in range(D)] for _ in range(D)]
    k = [[(b[i][j] - b[j][i]) / 2 for j in range(D)] for i in range(D)]
    ns = sum(v * v for row in s for v in row) ** 0.5
    nk = sum(v * v for row in k for v in row) ** 0.5
    return [[s[i][j] / ns + r * k[i][j] / nk for j in range(D)]
            for i in range(D)]

def score(m, x, y):
    return sum(x[i] * m[i][j] * y[j] for i in range(D) for j in range(D))

def person(rng):
    return [rng.uniform(-1, 1) for _ in range(D)]

if __name__ == "__main__":
    print("   r = |K|/|S|   mutual   one-way   both negative"
          "   top match differs")
    for r in (0.0, 0.5, 1.0, 2.0):
        rng = random.Random(62001)
        m = rand_matrix(rng, r)
        mu = one = neg = 0
        for _ in range(PAIRS):
            a, b = person(rng), person(rng)
            sab, sba = score(m, a, b), score(m, b, a)
            if sab > 0 and sba > 0:
                mu += 1
            elif sab < 0 and sba < 0:
                neg += 1
            else:
                one += 1
        pool = [person(rng) for _ in range(POOL)]
        diff = 0
        for i, a in enumerate(pool):
            others = [j for j in range(POOL) if j != i]
            give = max(others, key=lambda j: score(m, a, pool[j]))
            get = max(others, key=lambda j: score(m, pool[j], a))
            diff += give != get
        print("      {:3.1f}       {:6.3f}    {:6.3f}      {:6.3f}"
              "            {:5.3f}".format(r, mu / PAIRS, one / PAIRS,
                                          neg / PAIRS, diff / POOL))
    print("\nReading: with a symmetric M (r = 0) no pair is one-way. As the")
    print("antisymmetric part grows, more pairs have scores of opposite sign")
    print("and a person's best match depends on which direction is asked.")
#    r = |K|/|S|   mutual   one-way   both negative   top match differs
#       0.0        0.498     0.000       0.502            0.000
#       0.5        0.355     0.288       0.357            0.840
#       1.0        0.252     0.495       0.253            0.985
#       2.0        0.153     0.699       0.148            1.000
#
# Reading: with a symmetric M (r = 0) no pair is one-way. As the
# antisymmetric part grows, more pairs have scores of opposite sign
# and a person's best match depends on which direction is asked.

When MM is symmetric (r=0r = 0) no pair is one-way, and mutual compatibility and mutual repulsion take half each (0.498 and 0.502). As soon as an antisymmetric part appears, the one-way share climbs fast: 0.288 at r=0.5r = 0.5, 0.495 at r=1r = 1, 0.699 at r=2r = 2. The last column is more striking still. Even at r=0.5r = 0.5, for 0.840 of the pool “the person I give most to” and “the person who gives most to me” are different people; at r=1r = 1, for 0.985.

For any “right match” feature this is a direct design question: if the score matrix is not symmetric, “who is your best match” has two answers, and the system has to say which one it is giving.

What data can see one-sidedness

Suppose someone wants to estimate MM from real data. The easiest outcomes to collect are those the two people share: how long the relationship lasted, whether they married, whether they parted. The second program shows that such data cannot, in principle, estimate KK.

Calculation

# Chapter 1. What symmetric outcomes can and cannot reveal about M.
# True M = S + K on d = 4 traits (16 numbers: 10 in S, 6 in K). N pairs
# (A, B) are observed. Two kinds of data:
#   (a) a SHARED outcome, the same number for both people (e.g. how long
#       the pair lasted): y = s(A,B) + s(B,A) + noise = 2 x_A' S x_B + noise
#   (b) TWO OWN outcomes, one per person: y_A = s(A,B) + noise and
#       y_B = s(B,A) + noise
# M is estimated by least squares on all 16 entries (normal equations solved
# by Gaussian elimination). The program reports the rank of the design, and
# the error of the estimated S and K.
import random

D = 4

def solve(a, b):
    n = len(b)
    m = [row[:] + [b[i]] for i, row in enumerate(a)]
    rank, piv_cols = 0, []
    for c in range(n):
        p = max(range(rank, n), key=lambda r: abs(m[r][c]))
        if abs(m[p][c]) < 1e-9:
            continue
        m[rank], m[p] = m[p], m[rank]
        for r in range(n):
            if r != rank:
                f = m[r][c] / m[rank][c]
                m[r] = [m[r][k] - f * m[rank][k] for k in range(n + 1)]
        piv_cols.append(c)
        rank += 1
    x = [0.0] * n
    for r, c in enumerate(piv_cols):
        x[c] = m[r][n] / m[r][c]
    return x, rank

def fit(rows, ys):
    n = D * D
    ata = [[sum(r[i] * r[j] for r in rows) for j in range(n)]
           for i in range(n)]
    aty = [sum(r[i] * y for r, y in zip(rows, ys)) for i in range(n)]
    return solve(ata, aty)

def feats(x, y):
    return [x[i] * y[j] for i in range(D) for j in range(D)]

def parts(v):
    m = [[v[i * D + j] for j in range(D)] for i in range(D)]
    s = [[(m[i][j] + m[j][i]) / 2 for j in range(D)] for i in range(D)]
    k = [[(m[i][j] - m[j][i]) / 2 for j in range(D)] for i in range(D)]
    return s, k

def err(a, b):
    num = sum((a[i][j] - b[i][j]) ** 2 for i in range(D) for j in range(D))
    den = sum(b[i][j] ** 2 for i in range(D) for j in range(D))
    return (num / den) ** 0.5

if __name__ == "__main__":
    rng = random.Random(62002)
    true = [rng.gauss(0, 1) for _ in range(D * D)]
    ts, tk = parts(true)
    tm = [[true[i * D + j] for j in range(D)] for i in range(D)]
    print("   pairs   data             rank of 16   error in S   error in K")
    for n in (200, 2000):
        rows_a, ys_a, rows_b, ys_b = [], [], [], []
        for _ in range(n):
            x = [rng.uniform(-1, 1) for _ in range(D)]
            y = [rng.uniform(-1, 1) for _ in range(D)]
            sxy = sum(x[i] * tm[i][j] * y[j]
                      for i in range(D) for j in range(D))
            syx = sum(y[i] * tm[i][j] * x[j]
                      for i in range(D) for j in range(D))
            fxy, fyx = feats(x, y), feats(y, x)
            rows_a.append([u + v for u, v in zip(fxy, fyx)])
            ys_a.append(sxy + syx + rng.gauss(0, 0.5))
            rows_b += [fxy, fyx]
            ys_b += [sxy + rng.gauss(0, 0.5), syx + rng.gauss(0, 0.5)]
        for label, rows, ys in (("shared outcome", rows_a, ys_a),
                                ("two own outcomes", rows_b, ys_b)):
            est, rank = fit(rows, ys)
            es, ek = parts(est)
            print("   {:5,d}   {:16s}   {:10d}   {:10.3f}   {:10.3f}".format(
                n, label, rank, err(es, ts), err(ek, tk)))
    print("\nReading: a shared outcome sees only x_A' S x_B. The six numbers")
    print("of K never enter it and the design has rank 10, so the K part of")
    print("the estimate is an arbitrary choice of the solver: every K fits")
    print("the data equally well, however many pairs are observed. Asymmetry")
    print("is visible only in outcomes measured separately for each person.")
#    pairs   data             rank of 16   error in S   error in K
#      200   shared outcome             10        0.055        1.968
#      200   two own outcomes           16        0.068        0.135
#    2,000   shared outcome             10        0.017        1.943
#    2,000   two own outcomes           16        0.017        0.045
#
# Reading: a shared outcome sees only x_A' S x_B. The six numbers
# of K never enter it and the design has rank 10, so the K part of
# the estimate is an arbitrary choice of the solver: every K fits
# the data equally well, however many pairs are observed. Asymmetry
# is visible only in outcomes measured separately for each person.

The reason is simple. A shared outcome is s(A,B)+s(B,A)=2xA⊤SxBs(A,B) + s(B,A) = 2\, x_A^{\top} S x_B plus noise, and KK never enters it. With four features MM has 16 entries, 10 in the symmetric part and 6 in the antisymmetric; the design matrix has rank 10. Whether 200 or 2,000 pairs are observed, the error in SS shrinks (from 0.055 to 0.017), while the estimate of KK is merely an arbitrary choice made in solving the equations (errors 1.968 and 1.943): every KK fits the data equally well. Only when each person’s outcome is measured separately — each one’s own satisfaction, own investment and return — does the design have full rank 16, and the error in KK shrink with the sample (from 0.135 to 0.045).

Evidence

The same conclusion in research on couples. The statistics of couples and dyads made this a basic principle of method long ago: the two outcomes of a couple are measured separately, and the actor-partner interdependence model (APIM) estimates each person’s own effect and the partner’s effect at once; data with only a shared outcome cannot separate the two directions of influence (Kenny et al. 2006). Dynamic models are written the same way: Gottman and colleagues write one equation for each spouse in a conflict, each with its own influence function on the other, and the two influence functions may differ (Gottman et al. 2002); Felmlee and Greenberg’s model of dyadic interaction likewise gives each person separate parameters (Felmlee and Greenberg 1999).

From matrix to tensor

Once time enters, a score can change with the “flowing year” and “flowing month”. The most general form is a third-order tensor: st(A,B)=∑i,j,kTijkxA,ixB,jck(t)s_t(A,B) = \sum_{i,j,k} T_{ijk}\, x_{A,i}\, x_{B,j}\, c_k(t), where c(t)c(t) is a feature vector of time. At every moment a slice of TT is again a matrix, and the decomposition and its conclusions hold slice by slice: data with only a shared outcome cannot see the antisymmetric part of any slice. The time dimension brings no new identifiability, only more parameters to estimate.

Hypothesis · not established

The author’s hypothesis (not established): in longitudinal data that measure both partners’ satisfaction separately, with xx built from any fixed, pre-published chart-matching encoding, the estimated antisymmetric part KK is indistinguishable from zero. What would show it to be wrong: in a pre-registered analysis, an estimate of KK that replicates in an independent sample, in the direction the encoding stated in advance.

Summary

Once a match score is written as a bilinear form xA⊤MxBx_A^{\top} M x_B, the matrix splits uniquely into a symmetric part SS (what the two share) and an antisymmetric part KK (what flows one way). The larger the antisymmetric part, the more “one-way” pairs of opposite sign, and a person’s “best match” depends on the direction asked: at r=0.5r = 0.5 the two answers already differ for 0.840 of people. From an outcome the two share, KK is not identifiable — only 10 of 16 parameters can be estimated; to see one-sidedness each person must be measured separately. The tensor generalisation to time does not change this.

References

Felmlee, Diane H., and David F. Greenberg. 1999. “A Dynamic Systems Model of Dyadic Interaction.” Journal of Mathematical Sociology 23 (3): 155–80.
Gottman, John M., James D. Murray, Catherine C. Swanson, Rebecca Tyson, and Kristin R. Swanson. 2002. The Mathematics of Marriage: Dynamic Nonlinear Models. MIT Press.
Kenny, David A., Deborah A. Kashy, and William L. Cook. 2006. Dyadic Data Analysis. Guilford Press.

Fan, Y. (2026). Dyadic Phase Coupling, Bilinear Compatibility Tensors and Spatiotemporal Grid Games: Asymmetric Kuramoto Locking, Stopping-Time Separation Hazards and Magic-Square Permutation Operators [双人相位耦合、双线性相容张量与时空网格博弈] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090172 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).