Calculating the Magnetic Anisotropy of Rare-Earth-Transition-Metal Ferrimagnets.