Green's functions of fermions are described by matrix-valued Herglotz-Nevanlinna functions. Since analytic continuation is fundamentally an ill-posed problem, the causal space described by the matrix-valued Herglotz-Nevanlinna structure can be instrumental in improving the accuracy and in enhancing the robustness with respect to noise. We demonstrate a three-pronged procedure for robust analytic continuation called PES: (1) projection of data to the causal space; (2) estimation of pole locations; and (3) semidefinite relaxation within the causal space. We compare the performance of PES with the recently developed Nevanlinna and Carathéodory continuation methods and find that PES is more robust in the presence of noise and does not require the usage of extended precision arithmetics. We also demonstrate that a causal projection improves the performance of the Nevanlinna and Carathéodory methods. The PES method is generalized to bosonic response functions, for which the Nevanlinna and Carathéodory continuation methods have not yet been developed. It is particularly useful for studying spectra with sharp features, as they occur in the study of molecules and band structures in solids.