First-principles predictions of temperature-dependent infrared dielectric function of polar materials by including four-phonon scattering and phonon frequency shift