The phase-transition sequence of a ferroelectric perovskite such as BaTiO_3 can be simulated by computing the statistical mechanics of a first-principles derived effective Hamiltonian [Zhong, Vanderbilt and Rabe, Phys. Rev. Lett. 73, 1861 (1994)]. Within this method, the effect of an external pressure (in general, of any external field) can be studied by considering the appropriate enthalpy instead of the effective Hamiltonian itself. The legitimacy of this approach relies on two critical assumptions that, to the best of our knowledge, have not been adequately discussed in the literature to date: (i) that the zero-pressure relevant degrees of freedom are still the only relevant degrees of freedom at finite pressures, and (ii) that the truncation of the Taylor expansion of the energy considered in the effective Hamiltonian remains a good approximation at finite pressures. Here we address these issues in detail and present illustrative first-principles results for BaTiO_3. We also discuss how to construct effective Hamiltonians in cases in which these assumptions do not hold.