  We analyze the electromagnetic current correlator at an arbitrary photon
invariant mass $q^2$ by exploiting its associated dispersion relation. The
dispersion relation is turned into an inverse problem, via which the involved
vacuum polarization function $\Pi(q^2)$ at low $q^2$ is solved with the
perturbative input of $\Pi(q^2)$ at large $q^2$. It is found that the result
for $\Pi(q^2)$, including its first derivative $\Pi^\prime(q^2=0)$, agrees with
those from lattice QCD, and its imaginary part accommodates the $e^+e^-$
annihilation data. The corresponding hadronic vacuum polarization contribution
$a^{\rm HVP}_\mu= (641^{+65}_{-63})\times 10^{-10}$ to the muon anomalous
magnetic moment $g-2$, where the uncertainty arises from the variation of the
perturbative input, also agrees with those obtained in other phenomenological
and theoretical approaches. We point out that our formalism is equivalent to
imposing the analyticity constraint to the phenomenological approach solely
relying on experimental data, and can improve the precision of the $a^{\rm
HVP}_\mu$ determination in the Standard Model.
