关于「费用–收益回归:用最小二乘找出被低估与被高估的卡」,《卡牌费用回归与循环克制》给出的定量结论是什么?
结论:第一章用最小二乘找出被低估与被高估的卡:每一费平均买 1.858 点身材,多元回归还揭示生命比攻击贵、关键词远不如假设的值钱。
数据口径:本书用一款自拟的示意卡牌游戏「衡枢」把这些问题写成可以运行的算术。 书中卡池、胜率与价格参数均为示意;全部计算由书中程序生成;本书不是法律、财务或投资建议,也不推荐任何购买。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 1.858
cards 24 fit: value = 1.533 + 1.858 * cost R^2 = 0.900 residual sd = 1.212 stat points card cost value fitted resid student Y07 3 10 7.11 +2.89 +2.45 A09 5 7 10.82 -3.82 -3.25 faction Y mean residual +0.203 over 12 cards faction A mean residual -0.203 over 12 cards flagged: Y07, A09 (positive = under-costed, too strong) one cost step buys 1.858 stat points; a keyword is worth 1.08 cost
查看完整验算程序
# Chapter 1. p11: Least-squares cost-benefit line for an invented card pool.
# The game "Hengshu" and its 24 creature cards (two asymmetric factions,
# Y and A) are invented for this book; every number is illustrative.
# Value v = attack + health + 2 * keyword (a keyword is priced at two
# stat points, an assumption). We fit v = a + b * cost by ordinary least
# squares (closed form, math.fsum), then flag cards whose studentized
# residual exceeds 2 in absolute value.
import math
POOL = [
("Y01", 1, 2, 1, 0), ("Y02", 1, 1, 2, 0), ("Y03", 2, 2, 3, 0),
("Y04", 2, 1, 2, 1), ("Y05", 3, 3, 3, 0), ("Y06", 3, 2, 3, 1),
("Y07", 3, 4, 4, 1), ("Y08", 4, 4, 5, 0), ("Y09", 4, 3, 4, 1),
("Y10", 5, 5, 5, 1), ("Y11", 6, 6, 6, 0), ("Y12", 7, 7, 7, 1),
("A01", 1, 1, 3, 0), ("A02", 2, 3, 2, 0), ("A03", 2, 2, 2, 1),
("A04", 3, 3, 4, 0), ("A05", 3, 1, 4, 1), ("A06", 4, 4, 4, 1),
("A07", 4, 3, 5, 0), ("A08", 5, 5, 6, 0), ("A09", 5, 3, 4, 0),
("A10", 6, 5, 6, 1), ("A11", 7, 6, 8, 0), ("A12", 7, 6, 7, 1),
]
KW = 2
cost = [float(c) for _, c, _, _, _ in POOL]
val = [float(a + h + KW * k) for _, _, a, h, k in POOL]
n = len(POOL)
mc = math.fsum(cost) / n
mv = math.fsum(val) / n
sxx = math.fsum((c - mc) ** 2 for c in cost)
sxy = math.fsum((c - mc) * (v - mv) for c, v in zip(cost, val))
syy = math.fsum((v - mv) ** 2 for v in val)
b = sxy / sxx
a = mv - b * mc
res = [v - (a + b * c) for c, v in zip(cost, val)]
sse = math.fsum(r * r for r in res)
s = math.sqrt(sse / (n - 2))
r2 = 1 - sse / syy
print("cards {} fit: value = {:.3f} + {:.3f} * cost".format(n, a, b))
print("R^2 = {:.3f} residual sd = {:.3f} stat points".format(r2, s))
print("card cost value fitted resid student")
flag = []
for (name, c, _, _, _), v, r in zip(POOL, val, res):
h = 1 / n + (c - mc) ** 2 / sxx
t = r / (s * math.sqrt(1 - h))
if abs(t) > 2:
flag.append(name)
print("{:4} {:4d} {:5.0f} {:6.2f} {:+5.2f} {:+8.2f}".format(
name, c, v, a + b * c, r, t))
for fac in ("Y", "A"):
rs = [r for (nm, *_), r in zip(POOL, res) if nm[0] == fac]
print("faction {} mean residual {:+.3f} over {} cards".format(
fac, math.fsum(rs) / len(rs), len(rs)))
print("flagged: {} (positive = under-costed, too strong)".format(
", ".join(flag)))
print("one cost step buys {:.3f} stat points; a keyword is worth"
" {:.2f} cost".format(b, KW / b))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《非对称策略卡牌费用收益回归、牌库构筑超几何卡手率边界与优势策略循环克制》第 1 章「费用–收益回归:用最小二乘找出被低估与被高估的卡」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-179 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026179,
author = {Fan, Yafu},
title = {Cost-Benefit Regression for Asymmetric Strategy Cards, Hypergeometric Brick-Rate Bounds in Deck Building and Cyclic Counters to Dominant Strategies},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}