Argmax in LaTeX (\arg\max)
- LaTeX command
\arg\max- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
The argument of the maximum: the input value at which a function attains its largest value.
Written as \arg\max, it combines two predefined operators: \arg, which never takes limits, and \max, which does. The result is that a subscript in display style lands under max only, so the constraint sits off-center. A cleaner approach is \operatorname*{arg\,max}, or defining \DeclareMathOperator*{\argmax}{arg\,max} in the preamble, which centers the subscript beneath the whole word. It appears in classification rules like \hat{y} = \arg\max_k p(k|x), in maximum likelihood estimation, and in greedy policies in reinforcement learning. Note that it returns a set when the maximizer is not unique.
Also listed under: 최적화
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Argmax: $\arg\max$
\[ \hat{y} = \arg\max_{k} \, p(y = k \mid x) \]
\end{document}Related symbols
- Argmin
\arg\min - KL divergence (short form)
\text{KL}(P \| Q) - Argmax Subscript
\arg\max_{\theta} - KL Divergence
D_{\text{KL}}(P \| Q) - Argmin Subscript
\arg\min_{\theta} - Expectation
\mathbb{E}[X]
Frequently asked questions
- How do I write Argmax in LaTeX?
- Type \arg\max in math mode, for example $\hat{y} = \arg\max_{k} \, p(y = k \mid x)$. It works in plain LaTeX without loading any package.
- Which package do I need for \arg\max?
- None. \arg\max is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use \arg\max in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\arg\max$ in running text.
최고의 AI LaTeX 편집기, Overleaf 대안
Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움
- AI로 아름다운 TikZ 다이어그램 생성
- 이미지를 업로드하고 LaTeX로 원활하게 변환
- 논문 작성 및 서식에 대한 즉각적인 지원 받기