# AIC formula in latex

Excuse my naive question, have been searching around a lot!

How could I properly write the formula for the AIC estimation in a Latex Article?

Thank you!

• $\mathrm{AIC}=2k-2\ln\bigl(\hat{L}\bigr)$ should do it, albeit with \widehat, it would probably look better. Aug 20, 2021 at 22:30
• Thank you Bernard!! Aug 20, 2021 at 22:59

It looks like you obtained the screenshot of the formula you're interested in replicating from the AIC Wikipedia page. If you click on that page's "edit" button, you'll find the following math-ml expression that underlies the screenshot you posted:

$\mathrm{AIC} \, = \, 2k - 2\ln(\hat L)$


Translating this code to "pure" LaTeX, you might write

\begin{math} \mathrm{AIC} = 2k - 2\ln(\hat L) \end{math}


or, more succinctly,

$\mathrm{AIC} = 2k - 2\ln(\hat L)$


where $ is a TeX-special character that's used to initiate and terminate inline math mode. As @Bernard has noted in a comment, using \widehat instead of \hat would make the formula look even better, especially if one dispenses with the unnecessary parentheses. \documentclass{article} % or some other suitable document class \begin{document}$\mathrm{AIC} = 2k - 2\ln\widehat{L}\$
\end{document}

• I'm not sure that \widehat is better. Aug 21, 2021 at 21:02

You should write something like:

$$\mathrm{AIC} = 2 k - 2 \ln \widehat{L}$$


The \mathrm{...} bit gives roman (upright, spaced as text, not a sequence of three variables).

• AIC is an acronym for "Akaike Information Criterion" and is named for the Japanese statistician Hirotsugu Akaike, who first proposed it as a model selection criterion roughly 50 years ago. The AIC is is computed as the sum of (i) the (negative of) the model likelihood (\widehat{L}) and (ii) a linear penalty term (2k), the number of parameters used in the estimating the model. The AIC is not an operator in the normal sense of the word. The upshot? Just write \mathrm{AIC}.
– Mico
Aug 21, 2021 at 0:49
• @Mico, learned some (La)TeX today. Thanks! Aug 21, 2021 at 13:08