Maximin, Minimax Regret, and the Hurwicz Criterion
Environment
Python 3.14.6, NumPy 2.5.4, SciPy 1.18.1, Matplotlib 3.11.2 (Jupyter Notebook).
This article is a rewrite of a post from around 2021, with calculations performed in the environment described above.
Overview
Compare three decision criteria that do not specify state probabilities. From one profit table, calculate worst profit, maximum regret, and a weighted average of best and worst profit, then explain why the selected actions differ.
This article corresponds to Chapter 3, “Decision Making under Uncertainty”, of The Theory and Practice of Decision Making. The numerical examples are illustrative, not observed data.
Setup
Run the cells in order. Round to three significant figures only when displaying results.
Check versions, import libraries, and configure plots
import sys
from pathlib import Path
from pprint import pprint
import numpy as np
import scipy
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter, ScalarFormatter
from matplotlib_inline.backend_inline import set_matplotlib_formats
from IPython.display import Math, display
# 表示だけを丸め、計算には丸める前の値を使う。
def s3(value):
return format(float(value), "#.3g").rstrip(".")
np.set_printoptions(formatter={"float_kind": s3})
set_matplotlib_formats("svg")
plt.rcParams.update({
"figure.figsize": (7, 4),
"font.size": 11,
"axes.spines.top": False,
"axes.spines.right": False,
"axes.grid": True,
"grid.alpha": 0.200,
"svg.fonttype": "path",
})
OUT_DIR = Path("108_nb_files")
OUT_DIR.mkdir(exist_ok=True)
def save_fig(fig, name):
# 数値の目盛りだけを整形し、候補名などのラベルは保つ。
for ax in fig.axes:
for axis in (ax.xaxis, ax.yaxis):
if isinstance(axis.get_major_formatter(), ScalarFormatter):
axis.set_major_formatter(FuncFormatter(lambda x, pos: s3(x)))
# SVGをファイルとセル出力の両方に残す。
fig.tight_layout()
fig.savefig(OUT_DIR / f"{name}.svg", format="svg", bbox_inches="tight")
display(fig)
plt.close(fig)
assert sys.version_info[:3] == (3, 14, 6), "Python 3.14.6のカーネルを選択すること"
print("実行環境: wa-src(3.14.6)")
print("Python:", sys.version.split()[0])
print("NumPy:", np.__version__, "SciPy:", scipy.__version__)
print("Matplotlib:", matplotlib.__version__)
実行環境: wa-src(3.14.6)
Python: 3.14.6
NumPy: 2.5.4 SciPy: 1.18.1
Matplotlib: 3.11.2
1. What is evaluated without probabilities?
The following matrix gives profits for business sizes S, M, and L. Columns are low, medium, and high demand; amounts are in units of 10,000 JPY. No probabilities are assigned, and one action is chosen deterministically.
$$ \mathbf{G}=\begin{pmatrix}20&20&20\\-10&40&70\\-50&20&120\end{pmatrix}. $$
Choosing a criterion involves judgment. Unknown probabilities do not justify treating all states as equally likely. An equal-weight average adds a separate assumption.
2. Maximin: compare the worst profits
Find the minimum profit for each action, then choose an action with the largest minimum.
$$ m(a)=\min_sG(a,s),\qquad a^*\in\arg\max_a m(a). $$
The minima for S, M, and L are $(20,-10,-50)$, so S is selected. This raises the profit floor over the specified state set. Improving other payoffs leaves the evaluation unchanged if the minimum stays fixed.
With a loss table $\mathbf{L}=-\mathbf{G}$, write $\arg\min_a\max_sL(a,s)$. Moving from profit to loss reverses both optimization directions.
3. Minimax regret: limit opportunity loss in hindsight
Let $b_s=\max_aG(a,s)$ be the best profit if state $s$ were known before choosing. Regret here means monetary opportunity loss, not the intensity of an emotion.
$$ R(a,s)=b_s-G(a,s),\qquad a^*\in\arg\min_a\max_sR(a,s). $$
The column maxima are $\mathbf{b}=(20,40,120)$. For example, M has regret $120-70=50$ under high demand.
$$ \mathbf{R}=\begin{pmatrix}0&20&100\\30&0&50\\70&20&0\end{pmatrix}. $$
Maximum regrets are $(100,50,70)$, so M is selected, unlike the profit-floor criterion that selects S. Each state uses its best available action as a benchmark. Adding an action that changes a column maximum can therefore change regret values.
actions = ["S", "M", "L"]
profit = np.array([[20, 20, 20], [-10, 40, 70], [-50, 20, 120]], dtype=float)
worst = profit.min(axis=1)
best = profit.max(axis=1)
regret = profit.max(axis=0, keepdims=True) - profit
worst_regret = regret.max(axis=1)
pprint({"最悪利益": worst, "最大後悔": worst_regret,
"Maximin": actions[int(np.argmax(worst))],
"Minimax Regret": actions[int(np.argmin(worst_regret))]})
assert np.allclose(worst_regret, [100, 50, 70])
assert np.all(regret >= 0)
fig, ax = plt.subplots()
im = ax.imshow(regret, cmap="YlOrRd", vmin=0, vmax=100)
ax.set(xticks=range(3), xticklabels=["Low", "Middle", "High"],
yticks=range(3), yticklabels=actions, xlabel="State", ylabel="Action")
for i, j in np.ndindex(regret.shape):
ax.text(j, i, s3(regret[i, j]), ha="center", va="center",
color="white" if regret[i, j] >= 70 else "black")
fig.colorbar(im, ax=ax, label="Regret (10,000 JPY)")
save_fig(fig, "01_regret_matrix")
{'Maximin': 'S',
'Minimax Regret': 'M',
'最大後悔': array([100, 50.0, 70.0]),
'最悪利益': array([20.0, -10.0, -50.0])}
4. Hurwicz: specify optimism explicitly
Use optimism parameter $\alpha\in[0,1]$ to combine best and worst profit.
$$ H_\alpha(a)=\alpha\max_sG(a,s)+(1-\alpha)\min_sG(a,s). $$
Here $\alpha$ weights the best profit. Some references use the opposite convention, so check the formula. At $\alpha=0$, this is Maximin; at $\alpha=1$, it is Maximax, which compares only the best profits.
$$ \begin{aligned} H_\alpha(S)&=20,\\ H_\alpha(M)&=70\alpha-10(1-\alpha)=-10+80\alpha,\\ H_\alpha(L)&=120\alpha-50(1-\alpha)=-50+170\alpha. \end{aligned} $$
S and M meet at $20=-10+80\alpha$, or $\alpha=3/8=0.375$. M and L meet at $-10+80\alpha=-50+170\alpha$, or $\alpha=4/9\approx0.444$. S and L also meet at $\alpha=7/17$, but M is above both there.
The upper envelope is therefore S for $\alpha<3/8$, M for $3/8<\alpha<4/9$, and L for $\alpha>4/9$. Two actions tie at each boundary.
$\alpha$ is not a demand-state probability. The best and worst states may differ by action, so this criterion must be distinguished from expectation under a common state distribution.
$$ \displaystyle H_{0.400}(S)=20,\quad H_{0.400}(M)=22.0,\quad H_{0.400}(L)=18.0 $$
alpha = np.linspace(0, 1, 501)
hurwicz = worst[:, None] + (best - worst)[:, None] * alpha
fig, ax = plt.subplots()
for i, action in enumerate(actions):
ax.plot(alpha, hurwicz[i], label=action)
ax.axvline(3 / 8, color="gray", linestyle=":")
ax.axvline(4 / 9, color="gray", linestyle=":")
ax.plot(alpha, hurwicz.max(axis=0), color="black", linestyle="--", label="Maximum")
ax.set(xlabel="Optimism alpha", ylabel="Hurwicz score")
ax.legend()
save_fig(fig, "02_hurwicz_scores")
# 同点を落とさず、許容誤差内の全候補を返す。
def maximizing_actions(scores):
return [actions[i] for i in np.flatnonzero(np.isclose(scores, np.max(scores)))]
for a in [0, 3 / 8, 0.400, 4 / 9, 1]:
scores = worst + a * (best - worst)
pprint({"alpha": s3(a), "最適行動": maximizing_actions(scores)})
assert maximizing_actions(worst + (3 / 8) * (best - worst)) == ["S", "M"]
assert maximizing_actions(worst + (4 / 9) * (best - worst)) == ["M", "L"]
{'alpha': '0.00', '最適行動': ['S']}
{'alpha': '0.375', '最適行動': ['S', 'M']}
{'alpha': '0.400', '最適行動': ['M']}
{'alpha': '0.444', '最適行動': ['M', 'L']}
{'alpha': '1.00', '最適行動': ['L']}
5. Record the assumptions behind the comparison
Both the state set and the action set are fixed here. Adding a worse state can change the Maximin answer. Hurwicz ignores intermediate payoffs. Minimax regret emphasizes how far an action falls short of another action in the same state, rather than whether its absolute profit is negative.
Allowing randomized mixtures of actions can change the robust optimum. Our solutions require choosing exactly one of S, M, and L. Report the minimum profit and maximum regret along with the criterion name so that the basis for the choice is visible.
Conclusion
We applied Maximin, Minimax Regret, and Hurwicz to the same table and found their selected actions and switching conditions.
Maximin chooses S and Minimax Regret chooses M. Hurwicz switches from S to M to L as optimism increases. State the evaluation priority behind the criterion you use.
References
Lempert (2019), Robust Decision Making (RDM) . Reference on decisions when probabilities are difficult to specify.