The phonon spectra of calcium, strontium, barium, radium, cadmium, zinc, magnesium, germanium, tin, and lead titanates with the perovskite structure are calculated from first principles within the density functional theory. By analyzing the unstable modes in the phonon spectra, the possible lattice distortions are determined and the energies of the corresponding phases are calculated. From analyzing the phonon spectra, force constants, and eigenvectors of TO phonons, a conclusion is drawn on the origin of the ferroelectricity in considered crystals. It is shown that the main factors determining the possible off-centering of atoms in the A position are the geometric size and electronic configuration of these atoms.