  Using a Bayesian model-to-data analysis, we estimate the temperature
dependence of the heavy quark diffusion coefficients by calibrating to the
experimental data of $D$-meson $R_{\mathrm{AA}}$ and $v_2$ in AuAu collisions
($\sqrt{s_{NN}}=200$ GeV) and PbPb collisions ($\sqrt{s_{NN}}=2.76$
TeV)~\cite{Xie:2016iwq}. The spatial diffusion coefficient $D_s2\pi T$ is found
to be mostly constraint around $(1.3-1.5) T_c$ and is compatible with lattice
QCD calculations. We demonstrate the capability of our improved Langevin model
to simultaneously describe the $R_{\mathrm{AA}}$ and $v_2$ at both RHIC and the
LHC energies, as well as the feasibility to apply a Bayesian analysis to
quantitatively study the heavy flavor transport in heavy-ion collisions.
