  We develop a first-principles scheme to study ferroelectric phase transitions
for perovskite compounds. We obtain an effective Hamiltonian which is fully
specified by first-principles ultra-soft pseudopotential calculations. This
approach is applied to BaTiO$_3$, and the resulting Hamiltonian is studied
using Monte Carlo simulations. The calculated phase sequence, transition
temperatures, latent heats, and spontaneous polarizations are all in good
agreement with experiment. The order-disorder vs.\ displacive character of the
transitions and the roles played by different interactions are discussed.
