prove the Kottwitz formula, in two ways, one assuming validity of Langlands-Rapoport conjecture (Thm. \[thm:Kottwitz\_formula:LR\]) and another one being unconditional (Thm. \[thm:Kottwitz\_formula:Kisin\]), which uses the second version of effectivity criterion of Kottwitz triple (Thm. \[thm:LR-Satz5.25b2\]). In the last section, we stabilize the Kottwitz formula, thereby proving Thm. \[thm\_intro:Kottwitz\_conj\].

In this work, a certain result in the Bruhat-Tits theory, whose hyperspecial case was already used critically in the original work [@LR87] (cf. [@Lee16 Lem. A.0.4]), plays a key role. We provide its proof in Appendix \[sec:elliptic\_tori\_in\_special\_parahorics\]. Also, generalizations to our setting (i.e. $G^{{\mathrm{der}}}\neq G^{{\mathrm{sc}}}$ in general) of previous arguments occur frequently throughout the entire work. For that, it is necessary to work with abelianized cohomology groups which are cohomology groups of complexes of tori. In appendix \[sec:abelianization\_complex\], we collect basic facts about complexes of tori attached to connected reductive groups.

**Acknowledgement** A part of this work was supported by IBS-R003-D1. The author would like to thank M. Rapoport and C.-L. Chai for their interests in this work and encouragement.

**Notations**

Throughout this paper, ${\overline{\mathbb Q}}$ denotes the algebraic closure of ${\mathbb Q}$ inside ${\mathbb C}$.

For a connected reductive group $G$ over a field, we let $G^{{\mathrm{sc}}}$ be the universal covering 