First-Principles Studies of Ferroelectric Oxides