  We present a new method to obtain interaction part of a model Hamiltonian
from the result of the first-principles calculation. The effective interaction
contained in the model is determined based on the random phase approximation
(RPA). In contrast to previous methods such as projected RPA or constrained
RPA, the new method takes into account the long-range part of the polarization
effect when determining the interaction in the model. After we discuss problems
in previous RPA methods, we will give the formulation of the new method, and
show how it works for the single-band Hubbard model of HgBa$_2$CuO$_4$.
